cdyun / webman-cache
Webman plugin cdyun/webman-cache
v1.0.1
2025-09-23 17:13 UTC
Requires
- php: ^8.1
- psr/simple-cache: ^1.0|^2.0|^3.0
- topthink/think-container: ^2.0|^3.0
- workerman/webman-framework: ^2.1 || dev-master
README
基于Think-Cache 的封装,增加了协程和连接池支持,同时支持webman非协程环境。 本缓存只支持redis和文件驱动。
安装
composer require cdyun/webman-cache
基础Cache类
- 提供的接口参考think-cache
use Cdyun\WebmanCache\Cache;
基于基础Cache封装的CacheEnforcer类
-
增加了全局默认参数配置(默认全局标签、默认过期时间)
-
保留默认缓存驱动接口,同时增加了单独的redis缓存接口
use Cdyun\WebmanCache\CacheEnforcer; 方法:setRedis、getRedis、delRedis、clearRedis、hasRedis