Skip to content

korniychuk/yii2-redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis component for Yii2

Description

This component is wrapper, it based on really powerful php-redis extension.
Please, install those php-extension before use this.

Documentation can be found at here

Feel free to let me know what else you want added via:

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require ancor/yii2-redis

or add

"ancor/yii2-redis": "dev-master"

to the require section of your composer.json file.

Configuration

Configuration is easy. Add this to your main-local.php config

'components' => [
    'redis' => \redis\redis\Redis::build(),
],

Or with settings

'components' => [
    'redis' => \redis\redis\Redis::build([
        // 'host'    => '127.0.0.1',
        // 'port'    => 6379,
        // 'timeout' => 0,

        // 'retryInterval' => null,

        // 'password' => null,
        // 'database' => 0, // default database number
    ]),
],

Usage

$redis = Yii::$app->redis;

$redis->set('my:key', 'some-value');
$res = $redis->get('my:key');

About

Redis component for Yii2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages