pavle / yii2-redis
Yii 2 Redis extension with predis
Installs: 31 902
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 2
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- predis/predis: *
- yiisoft/yii2-redis: *
This package is not auto-updated.
Last update: 2024-11-13 21:27:35 UTC
README
Using Predis and yii2 combination This extension is fully compatible with the yii2-redis extension, and you can use predis only if you replace the configuration
Usage
- Change your redis component configuration, There is no need to change any of the previous code, That's all right.
'redis' => [
'class' => pavle\yii\redis\Connection::class,
'parameters' => ['tcp://xx.xx.x.xx:30001', 'tcp://xx.xx.x.xx:30002', 'tcp://xx.xx.x.xx:30003'],
//'parameters' => 'tcp://192.168.2.240:6379',
'options' => ['cluster' => 'redis'],
],
2.More usage yii2-redis Document
3.Using the predis client
Yii::$app->redis->getClient();