Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

jmhobbs/K3-Cache_Redis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K3-Cache_Redis Module

A Ko3 Module by John Hobbs

Introduction

This module provides a Redis backed cache engine for the cache module

Installation

K3-Cache_Redis is a simple, standard module.

  1. Drop the source in your MODPATH folder.
  2. Add the module to Kohana::modules in your bootstrap.php
  3. Ensure you have enabled the cache module as well.

Usage

To use K3-Cache_Redis you need to configure your Redis servers in application/config/cache.php

Example Config:

<?php defined('SYSPATH') or die('No direct script access.');

  return array(
	  'redis' => array(
      'driver' => 'redis',
      'servers' => array(
        array(
          'host'  => 'localhost',
          'port'  => 6379,
          'alias' => 'local',
        ),
        array(
          'host'  => 'redis.domain.tld',
          'alias' => 'remote',
      ),
    ),
  );

If you provide multiple servers in your configuration the keys are hashed and safely distributed across them.

Once you have it configured, use it as you would a normal cache plugin.

Example:

Cache::instance( 'redis' )->set( 'key', 'value' );
echo Cache::instance( 'redis' )->get( 'key' );
// Prints "value"

Credits

K3-Cache_Redis uses Redisent for Redis access.

License

K3-Cache_Redis is licensed under the MIT License. See LICENSE for more details.

About

Caching module for Kohana 3 using Redis backend.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages