reaway/think-cache
最新稳定版本:v8.1.1
Composer 安装命令:
composer require reaway/think-cache
包简介
think cache
README 文档
README
安装
composer require reaway/think-cache
用法
use Think\Component\Cache\Facade\Cache; require __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; Cache::setConfig([ 'default' => 'file', 'stores' => [ 'file' => [ 'type' => 'File', // 缓存保存目录 'path' => __DIR__ . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR, // 缓存前缀 'prefix' => '', // 缓存有效期 0表示永久缓存 'expire' => 0, ], 'redis' => [ 'type' => 'redis', 'host' => '127.0.0.1', 'port' => 6379, 'prefix' => '', 'expire' => 0, ], ], ]); Cache::set('key', 'value'); Cache::get('key');
文档
详细参考 缓存处理
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-01-05