realbattletoad / yii2-redis
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Type:yii2-extension
Requires
- php: >=7.2
- ext-json: *
- ext-redis: *
- yiisoft/yii2: ~2.0
README
Fork of trorg/yii2-redis
Simple integration of phpredis.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist realbattletoad/yii2-redis:"1.*"
or add
"realbattletoad/yii2-redis": "1.*"
to the require section of your composer.json.
Configuration
To use this extension, you have to configure the Connection class in your application configuration:
Simple, with one server
return [ //.... 'components' => [ 'redis' => [ 'class' => 'realbattletoad\yii2\redis\Connection', 'servers' => [ 'server1:6379', ], ], ] ];
Redis cluster or Array distribution or Sentinels
return [ //.... 'components' => [ 'redis' => [ 'class' => 'realbattletoad\yii2\redis\Connection', 'servers' => [ 'server1:6379', 'server2:6379', 'server3:6379', ], 'cluster' => 'redis', // or 'array' // or 'sentinels' ], ] ];