Code Monkey home page Code Monkey logo

sfrediscacheplugin's Introduction

sfRedisCachePlugin

Redis is key/value persistent database. It's faster than APC, distributed like Memcache and most of all, it's not volatile. On server restart, or shutdown, data will remain and even better, the lifetime of cached data is still calculated.

This plugin intends to make Redis server usable as a cache backend method for your factories, or directly, within your code.

Notice: despite the cache backend accepts a compiled Redis class, it requires to have at least the expire method.

Licence

see LICENSE file

Requirements

You need to have at least a decent Redis PHP class supporting those methods:

  • connect
  • delete
  • exists
  • expire
  • get
  • keys
  • mget
  • ping
  • set

So far, it has been unit-tested with the debian package libphp-redis. You can find out some other โˆ’ yet unsupported โˆ’ libraries:

Installation

You can install easily the plugin through symfony CLI: symfony plugin:install sfRedisCachePlugin

Or through SVN repository by adding the following svn:external: sfRedisCachePlugin http://svn.symfony-project.com/plugins/sfRedisCachePlugin/trunk/

Notice: the trunk will one day branched if any compatibility issues appears.

Usage

The main purpose of sfRedisCachePlugin is to use it as a cache backend for your factories.yml. For example:

view_cache:
  class: sfRedisCache
  param:
    host:                      127.0.0.1
    mode:                      shared
    port:                      6379
    prefix:                    %SF_APP_DIR%/template

As the class extends sfCache class, it follows the same usage.

Configuration

The class accepts some option parameters:

  • class': the Redis class we try to load (default to Redis)
  • mode: Defines if we work with the "compiled" (faster) or "shared" (easier) library (default to "shared")
  • host: The default server (default to 127.0.0.1)
  • port: The default port (default to 6379)
  • redis: a redis object (not mandatory)

Todo-list

  • Support for clustering
  • Include autoloader

sfrediscacheplugin's People

Watchers

Yannick Gauthier avatar James Cloos avatar

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.