zxin/think-redis
最新稳定版本:v2.2.1
Composer 安装命令:
composer require zxin/think-redis
包简介
think redis
README 文档
README
快速使用
安装
composer require zxin/think-redis
普通环境下直接使用。
\Zxin\Think\Redis\RedisManager::store()->get('xxxx');
协程环境下使用方法与普通环境一致,但为了更优雅的退出,在workerStop与workerExit下调用以下代码。
\Zxin\Think\Redis\RedisManager::destroy();
替换Cache中的redis驱动以提供全局redis管理服务
- 先在
config/redis.php配置文件声明一个连接 config/cache.php配置文件中需要提供redis连接的位置替换驱动
[
'default' => 'test',
'stores' => [
'test' => [
'type' => \Zxin\Think\Redis\CacheDriver::class,
'connection' => 'main_redis', // 在redis统一配置中声明的有效连接
...
],
...
]
]
统计信息
- 总下载量: 2.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2020-08-14