treehouselabs / cache
v2.0.1
2017-01-12 10:10 UTC
Requires
- php: >=5.5
Requires (Dev)
- doctrine/cache: ^1.1
- phpunit/phpunit: ^4.5
- predis/predis: ^1.0
Suggests
- ext-apcu: When you want to use the APCu driver
- ext-memcached: When you want to use the Memcached driver
- ext-redis: When you want to use the Redis driver
README
此包已废弃,请使用PSR-6解决方案,例如 https://github.com/php-cache/cache
缓存
快速缓存库。支持多种驱动程序。
安装
composer require treehouselabs/cache:^2.0
用法
$driver = new RedisDriver($redis); $serializer = new JsonSerializer(); $cache = new Cache($driver, $serializer); $cache->set('foo', 'bar', 60); $cache->get('foo'); $cache->has('foo'); $cache->remove('foo');