graphstory/cache-interface
Composer 安装命令:
composer require graphstory/cache-interface
包简介
Generic cache interfaces
关键字:
README 文档
README
Simple cache adapters and interface based on Anthony Ferrara's blog post A Followup To An Open Letter To PHP-FIG.
Installation
Using Composer
Use Composer to install the cache-interface library:
$ composer require graphstory/cache-interface
Usage
// Example using Daniel González's Cache library use Desarrolla2\Cache\Cache; use Desarrolla2\Cache\Adapter\File; use GraphStory\Console\Cache\DesarrollaAdapter; $cacheDir = '/tmp'; $adapter = new File($cacheDir); $adapter->setOption('ttl', 3600); $desarrolla2 = new Cache($adapter); $cache = DesarrollaAdapter($desarrolla2); $cache->set('key', 'myKeyValue', 3600); // later ... echo $cache->get('key');
(The above example was mostly cribbed from the desarrolla2/Cache documentation.)
BYOA (bring your own adapter)
You can write your own adapter by creating a class that implements the CacheAdapter interface. Use the other adapters as a reference and you should be good to go!
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-11-19