添加 redis

This commit is contained in:
hant 2025-02-26 18:08:21 +08:00
parent f515ea4869
commit 7333cb63d9

View File

@ -191,19 +191,15 @@ return [
// 缓存保存目录 // 缓存保存目录
'path' => CACHE_PATH, 'path' => CACHE_PATH,
// 缓存前缀 // 缓存前缀
'prefix' => '', 'prefix' => 'cache:',
// 缓存有效期 0表示永久缓存 // 缓存有效期 0表示永久缓存
'expire' => 0, 'expire' => 0,
'type' => 'redis', 'type' => 'redis',
// 'redis' => [ 'host' => Env::get('redis.redis_host'), // Redis 服务器地址
'host' => Env::get('redis.redis_host'), // Redis 服务器地址 'port' => Env::get('redis.redis_port'), // Redis 端口
'port' => Env::get('redis.redis_port'), // Redis 端口 'password' => Env::get('redis.redis_password'), // Redis 密码,如果有的话
'password' => Env::get('redis.redis_password'), // Redis 密码,如果有的话 'select' => Env::get('redis.redis_db'), // 默认数据库0-15
'select' => Env::get('redis.redis_db'), // 默认数据库0-15 'timeout' => 0, // Redis 连接超时
'timeout' => 0, // Redis 连接超时
// 'prefix' => '', // 缓存前缀
// 'expire' => 3600, // 默认缓存过期时间(秒)
// ], // ],
], ],
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
@ -214,22 +210,15 @@ return [
// SESSION_ID的提交变量,解决flash上传跨域 // SESSION_ID的提交变量,解决flash上传跨域
'var_session_id' => '', 'var_session_id' => '',
// SESSION 前缀 // SESSION 前缀
'prefix' => 'think', 'session_name' => 'session:',
// 驱动方式 支持redis memcache memcached
// 'type' => 'redis',
// 是否自动开启 SESSION // 是否自动开启 SESSION
'auto_start' => true, 'auto_start' => true,
'type' => 'redis', 'type' => 'redis',
// 'redis' => [
'host' => Env::get('redis.redis_host'), // Redis 服务器地址 'host' => Env::get('redis.redis_host'), // Redis 服务器地址
'port' => Env::get('redis.redis_port'), // Redis 端口 'port' => Env::get('redis.redis_port'), // Redis 端口
'password' => Env::get('redis.redis_password'), // Redis 密码,如果有的话 'password' => Env::get('redis.redis_password'), // Redis 密码,如果有的话
'select' => Env::get('redis.redis_db'), 'select' => Env::get('redis.redis_db'),
'timeout' => 0, // Redis 连接超时
'expire' => 3600, // 默认缓存过期时间(秒)
// ],
], ],
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Cookie设置 // | Cookie设置