Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (34 sloc) 1.4 KB

koredis

This module is a wrapper of phpredis for kohana3.x. So make sure you have installed phpredis before you start.

Installation

###composer(recommand)

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

touch file composer.json in kohana root directory with the contents:

{
    "require": {
        "jeremywei/koredis": "dev-master"
    }
}

then run composer install, done.

###git submodule

$ git submodule add git://github.com/JeremyWei/koredis.git modules/koredis
$ git submodule update --init --recursive

Using

Enable:

Kohana::modules(array(
	 //'auth'       => MODPATH.'auth',       // Basic authentication
	 'cache'      => MODPATH.'cache',      // Caching with multiple backends
	 'codebench'  => MODPATH.'codebench',  // Benchmarking tool
	 'database'   => MODPATH.'database',   // Database access
	// 'image'      => MODPATH.'image',      // Image manipulation
	// 'orm'        => MODPATH.'orm',        // Object Relationship Mapping
	 'unittest'   => MODPATH.'unittest',   // Unit testing
	// 'userguide'  => MODPATH.'userguide',  // User guide and API documentation
	 'koredis'   => MODPATH.'koredis',           // Redis
	));

Example:

$redis = Koredis::factory();
$redis->set('foo', 'bar');
$redis->get('foo');