GithubHelp home page GithubHelp logo

yii2-phpredis's Introduction

Redis Cache and Session for Yii2

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.

Build Status Code Climate Test Coverage Issue Count Latest Stable Version Total Downloads License

Notice: THIS REPO DOES NOT SUPPORT ACTIVE RECORD.

Requirements

  • PHP >= 5.4.0
  • Redis >= 2.6.12
  • ext-redis >= 2.2.7
  • Yii2 ~2.0.4

Installation

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.

Configuration

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,
        ],
    ]
];

Run unit test

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)

Performance test

$ php tests/performance.php

phpredis-vs-yii-redis

yii2-phpredis's People

Contributors

arieslee avatar dcb9 avatar lgelfan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

yii2-phpredis's Issues

Cache dependency problem

Hello! Method setValues split array $data that cause a disaster! Redis mset accept associative array, not array of values (splitted [key1,val1,key2,val2,...])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.