|
|
il y a 3 ans | |
|---|---|---|
| .. | ||
| tests | il y a 3 ans | |
| .codeclimate.yml | il y a 3 ans | |
| .editorconfig | il y a 3 ans | |
| .gitignore | il y a 3 ans | |
| .travis.yml | il y a 3 ans | |
| Cache.php | il y a 3 ans | |
| Connection.php | il y a 3 ans | |
| README.md | il y a 3 ans | |
| Session.php | il y a 3 ans | |
| composer.json | il y a 3 ans | |
| phpredis-vs-yii-redis.png | il y a 3 ans | |
| phpunit.xml.dist | il y a 3 ans | |
This extension provides the redis key-value store support for the Yii framework 2.0.
It includes a Cache and Session storage handler in redis.
Notice: THIS REPO DOES NOT SUPPORT ACTIVE RECORD.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist dcb9/yii2-phpredis
or add
"dcb9/yii2-phpredis": "~1.0"
to the require section of your composer.json.
To use this extension, you have to configure the Connection class in your application configuration:
return [
//....
'components' => [
'redis' => [
'class' => 'dcb9\redis\Connection',
'hostname' => 'localhost',
'port' => 6379,
'database' => 0,
],
]
];
You can specific your redis config
$ cp tests/config.php tests/config-local.php
$ vim tests/config-local.php
and Run
$ ./vendor/bin/phpunit
PHPUnit 5.6.1 by Sebastian Bergmann and contributors.
............ 12 / 12 (100%)
Time: 600 ms, Memory: 10.00MB
OK (12 tests, 50 assertions)
$ php tests/performance.php