laoshifu/think-cache
最新稳定版本:v1.0.1
Composer 安装命令:
composer require laoshifu/think-cache
包简介
ThinkPHP 8.0 缓存扩展包
README 文档
README
适用于 ThinkPHP 8.0+ 的缓存扩展包。
安装
composer require laoshifu/think-cache
支持的驱动
- File(文件缓存)
- Redis
- Memcache
- Memcached
- Wincache
使用方法
use laoshifu\cache\facade\Cache; // 设置缓存 Cache::set('name', 'value', 3600); // 获取缓存 $value = Cache::get('name'); // 删除缓存 Cache::delete('name'); // 清空缓存 Cache::clear();
配置
在 config/cache.php 中配置:
return [ 'default' => 'file', 'stores' => [ 'file' => [ 'type' => 'File', 'path' => runtime_path('cache'), ], 'redis' => [ 'type' => 'Redis', 'host' => '127.0.0.1', 'port' => 6379, 'password' => '', 'select' => 0, 'timeout' => 0, ], ], ];
版权信息
Copyright © 2025 贵州老师傅到家科技有限公司
Licensed under the Apache License 2.0
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-12-08