dev-master
9999999-devRedis component for Yii2
GPLv3
The Requires
by Anton Korniychuk
Redis component for Yii2
This component is wrapper, it based on really powerful php-redis extension.
Please, install those php-extension before use this., (*1)
Documentation can be found at here, (*2)
Feel free to let me know what else you want added via:, (*3)
The preferred way to install this extension is through composer., (*4)
Either run, (*5)
$ php composer.phar require ancor/yii2-redis
or add, (*6)
"ancor/yii2-redis": "dev-master"
to the require
section of your composer.json
file., (*7)
Configuration is easy. Add this to your main-local.php
config, (*8)
'components' => [ 'redis' => \redis\redis\Redis::build(), ],
Or with settings, (*9)
'components' => [ 'redis' => \redis\redis\Redis::build([ // 'host' => '127.0.0.1', // 'port' => 6379, // 'timeout' => 0, // 'retryInterval' => null, // 'password' => null, // 'database' => 0, // default database number ]), ],
$redis = Yii::$app->redis; $redis->set('my:key', 'some-value'); $res = $redis->get('my:key');
Redis component for Yii2
GPLv3