fivelab/cache

This package is abandoned and no longer maintained. No replacement package was suggested.

Cache system

v1.0 2015-08-31 08:18 UTC

This package is not auto-updated.

Last update: 2017-08-16 12:52:40 UTC


README

With this package you can cache any data in any storage.

Installation

Add FiveLab/Cache in your composer.json:

{
    "require": {
        "fivelab/cache": "~1.0"
    }
}

Now tell composer to download the library by running the command:

$ php composer.phar update fivelab/cache

Basic usage

Available storage:

  1. ArrayCache
    Cache data in internal array. Will be destroyed after ended script.
  2. RedisCache
    Cache data in Redis storage. Store data in HASH type.
  3. ChainCache
  4. NullCache

Examples:

use FiveLab\Component\Cache\ArrayCache;

$cache = new ArrayCache();

if (!$cache->has('my_key')) {
    $cache->set('my_key', 'My Value');
}

print $cache->get('my_key'); // Printing "My Value"

Symfony2

If you use Symfony2 Framework, you can use CacheClearer for clear cache.

Symfony2 ExpressionLanguage

If you use ExpressionLanguage (Symfony Component), you can use ParserCache for store ExpressionLanguage expression.