arabcoders / cache
v1.0.2
2016-06-26 05:04 UTC
Requires
- php: >=7.0
Suggests
- ext-apcu: Allows the use of apc cache store.
- ext-redis: Allows the use of Redis cache store.
This package is auto-updated.
Last update: 2022-02-01 12:59:21 UTC
README
在公共接口下,一个基础的缓存处理器可以抽象化所有驱动/适配器的差异,它可以拥有多个驱动。
安装
通过 Composer
$ composer require arabcoders/cache
使用示例
<?php require __DIR__ . '/../../autoload.php'; $adapter = new \arabcoders\cache\Adapters\Redis( [ 'port' => 6379, 'server' => '127.0.0.1' ]); $cache = new \arabcoders\cache\Cache( $adapter ); $cache->set( 'test', 'foo', 120 ); echo $cache->get('test')->getValue();