bkhrupa/kohana-rediscache

Very simple phpredis cache module for kohana3.3

Maintainers

👁 bkhrupa

Package info

github.com/bkhrupa/kohana-rediscache

Type:kohana-module

pkg:composer/bkhrupa/kohana-rediscache

Statistics

Installs: 213 664

Dependents: 0

Suggesters: 0

Stars: 5

Open Issues: 0

1.2.0 2015-02-25 22:50 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 2621c1f9cd99f3730d65af56aea66e5abbea3a1a

rediscachemodulekohana

This package is auto-updated.

Last update: 2026-06-24 05:42:43 UTC


README

Very simple cache module phpredis for kohana3.3 :) Require Kohana Cache module

Redis client - phpredis (https://github.com/nicolasff/phpredis)

Original module - (https://github.com/infarmer/phpredis-kohana3.3)

Example

Enable module bootstrap.php

Kohana::modules(array(
 ...
 'cache' => MODPATH.'cache',
 'rediscache' => MODPATH.'rediscache',
 ...
));

Config. Add to Kohana cache config redis driver config/cache.php

...
'redis' => array(
 'driver' => 'redis',
 'port' => 6379,
 'host' => 'localhost',
 'db_num' => 0,
 'igbinary_serialize' => false,
 'password' => '',
),
...

If redis by default cache driver needed bootstrap.php

// default cache driver
Cache::$default = 'redis';

Usage

$redis_cache = Cache::instance('redis');
$redis_cache->set('test_cache', array('foo', 'bar'), 10);
$redis_cache->get('test_cache');