smoke / zf2-cache-storage-redis-array
Zend Framework 2 的 RedisArray 缓存存储
v1.2.0
2019-07-29 13:14 UTC
Requires
- php: ^5.5 || ^7.0
- ext-redis: >=2.2.3
- zendframework/zend-cache: ^2.0
Requires (Dev)
- cache/integration-tests: ^0.16.0
- phpunit/phpunit: ^4.8.36 || ^5.7.27 || ^6.5.8 || ^7.1.2
- squizlabs/php_codesniffer: ^3.3
- zendframework/zend-serializer: ^2.7
This package is not auto-updated.
Last update: 2024-09-14 16:06:49 UTC
README
这是基于 \Zend\Cache\Storage\Adapter\Redis 的 RedisArray 缓存存储适配器组件,用于 ZF2
安装
此模块仅通过 Composer 官方支持安装。有关 Composer 文档,请参阅 getcomposer.org。
您可以从命令行安装模块
$ php composer.phar require smoke/zf2-cache-storage-redis-array:1.0.*
或者,您也可以手动在 composer.json
文件中添加依赖项
{ "require": { "smoke/zf2-cache-storage-redis-array": "1.0.*" } }
配置设置
在您的 config/autoload/redis-array.php 中,放置以下设置以定义 servers_array
return array( 'caches' => array( 'Cache\General' => array( 'adapter' => array( 'name' => '\Smoke\Cache\Storage\Adapter\RedisArray' ), 'options' => array( 'servers_array' => array( array('host' => 'host1'/*, 'port' => 1234*/), array('host' => 'host2') ), //'lazy_connect' => true, //'connect_timeout' => 15 ), ), ), );
对于 ZF2 缓存工厂所需的其他设置,请参阅 http://framework.zend.com/manual/2.3/en/modules/zend.cache.storage.adapter.html
许可协议
此存档中的文件在 MIT 许可证下发布。您可以在 LICENSE.txt 中找到此许可证的副本。