50 lines
1.5 KiB
PHP
50 lines
1.5 KiB
PHP
<?php
|
||
use think\facade\Env;
|
||
return [
|
||
|
||
// 缓存配置为文件类型
|
||
'type' => 'complex',
|
||
|
||
// 默认缓存配置
|
||
'default' => [
|
||
// 驱动方式
|
||
'type' => 'File',
|
||
// 缓存保存目录
|
||
'path' => '',
|
||
// 缓存前缀
|
||
'prefix' => 'like_shop_',
|
||
// 缓存有效期 0表示永久缓存
|
||
'expire' => 0,
|
||
],
|
||
|
||
// Redis缓存配置
|
||
'redis' => [
|
||
// 驱动方式
|
||
'type' => 'redis',
|
||
// Redis服务器地址
|
||
'host' => Env::get('cache.host','127.0.0.1'),
|
||
// Redis服务器端口
|
||
'port' => Env::get('cache.port','6379'),
|
||
// Redis连接密码(留空表示无密码)
|
||
'password' => Env::get('cache.pwd',''),
|
||
// Redis数据库索引(0-15,默认为0)
|
||
'select' => Env::get('cache.select', 0),
|
||
// 连接超时时间(秒,0表示不限制)
|
||
'timeout' => Env::get('cache.timeout', 0),
|
||
// 是否使用长连接(true=长连接,false=短连接)
|
||
'persistent' => Env::get('cache.persistent', true),
|
||
// 缓存前缀,用于区分不同应用或环境的缓存
|
||
'prefix' => 'like_shop_redis_',
|
||
// 缓存有效期(秒),0表示永久缓存
|
||
'expire' => Env::get('cache.expire', 0),
|
||
],
|
||
|
||
// File缓存配置
|
||
'file' => [
|
||
'type' => 'File',
|
||
'path' => '',
|
||
'prefix' => 'like_shop_file_',
|
||
'expire' => 0,
|
||
],
|
||
];
|