gustav/cache
最新稳定版本:v0.7
Composer 安装命令:
composer require gustav/cache
包简介
A small and simple PHP cache system
README 文档
README
A small and simple PHP cache system, which implements PSR-6 interfaces.
Implementations
- Filesystem: Each cache item pool is a simple file. Cache items are saved with help of PHP's default serialization method.
- Debug: Cache item pools will not be persisted. This is just for testing purposes. Don't use this implementation in production environments.
Usage
//configure the system $config = new \Gustav\Cache\Configuration(); $config->setDirectory("path/to/my/cache/files/"); //load cache manager $manager = \Gustav\Cache\ACacheManager::getInstance($config); //fetch the item pool $pool = $manager->getItemPool("myFileName", $myCreatorFunction);
Configuration
You can set the following configurations in \Gustav\Orm\Configuration:
setImplementation(string): Sets the implementation of the cache manager to use here. Default is\Gustav\Cache\Filesystem\CacheManager(i.e. the Filesystem cache).setDirectory(string): Sets the directory on filesystem, where we save the cache pool files. There's no default value.setDefaultExpiration(integer): Sets the default time to live of cache items, if you don't set any explicitly in\Gustav\Cache\CacheItem. Consider that0and lower means, that the items will not expire. Default is0.getLogConiguration(): \Gustav\Utils\Log\Configuration/setLogConfiguration(\Gustav\Utils\Log\Configuration): Configure the error log to use in this cache implementation. By default this uses the default configuration from Utils. See Gustav Utils for further information.
统计信息
- 总下载量: 99
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: GPLv3
- 更新时间: 2014-11-22