itrnka/ha-apcu-middleware
Composer 安装命令:
composer require itrnka/ha-apcu-middleware
包简介
APCu cache middleware for ha framework. This is a proxy to PHP APCu extension.
README 文档
README
APCu cache middleware for ha framework. This is a proxy to PHP APCu extension. Driver implements cache interface ha\Middleware\Cache\Cache from ha framework. So it can be used as a cache driver.
Installation
Installation is available via composer:
composer require itrnka/ha-apcu-middleware
Requirements
This package is based on ha framework. Composer installs ha framework if it is not already installed. APCu php module is also required.
Configuration
Required configuration keys:
name: by ha framework requirementskeyPrefix: string prefix for cache keys in your applicationdefaultTTL: int default TTL value (must be>= 0)
Add your configuration to the configuration file in ha framework according to this example:
Note: only single instance can be used in your application, class has pseudo singleton protection.
$cfg['middleware'] = [ // ... // APCu cahce [ ha\Middleware\Cache\APCu\APCu::class, [ 'name' => 'apc', 'keyPrefix' => 'someUniqueKeyForAppInYourMachine', 'defaultTTL' => 0, ] ], // ... ];
Then the driver will be available as follows:
// middleware instance $apc = main()->middleware->apc; // example call: $value = main()->middleware->apc->get('myValue', null);
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-11-17