laoshifu/think-cache 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2025-12-08