fivelab / cache
Cache system
Installs: 1 160
Dependents: 3
Suggesters: 2
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.4
Requires (Dev)
- doctrine/cache: 1.*
- phpunit/phpunit: 4.*
- symfony/expression-language: 2.*
- symfony/http-kernel: ~2.3
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:
- ArrayCache
- Cache data in internal array. Will be destroyed after ended script.
- RedisCache
- Cache data in Redis storage. Store data in HASH type.
- ChainCache
- 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.