AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
## Thinkphp中使用Redis **Thinkphp5** cache.php 配置 ~~~ return [ // 缓存配置为复合类型 'type' => 'complex', 'default' => [ 'type' => 'file', // 全局缓存有效期(0为永久有效) 'expire'=> 0, // 缓存前缀 'prefix'=> 'think', // 缓存目录 'path' => '../runtime/cache/', ], 'redis' => [ 'type' => 'redis', 'host' => '127.0.0.1', // 全局缓存有效期(0为永久有效) 'expire'=> 0, // 缓存前缀 'prefix'=> 'think', ], // 添加更多的缓存类型设置 ]; ~~~ **使用Redis缓存** ~~~ Cache::store('redis')->set('name','value',3600); Cache::store('redis')->get('name'); ~~~ 如果要返回当前缓存类型对象的句柄,可以使用 ~~~ // 获取Redis对象 进行额外方法调用 Cache::store('redis')->handler(); ~~~