From 7333cb63d91b406a6f43c2f9d5842ea1f59b2801 Mon Sep 17 00:00:00 2001 From: hant Date: Wed, 26 Feb 2025 18:08:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20redis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/config.php | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/application/config.php b/application/config.php index e6cb451..d79325d 100755 --- a/application/config.php +++ b/application/config.php @@ -191,19 +191,15 @@ return [ // 缓存保存目录 'path' => CACHE_PATH, // 缓存前缀 - 'prefix' => '', + 'prefix' => 'cache:', // 缓存有效期 0表示永久缓存 'expire' => 0, - 'type' => 'redis', -// 'redis' => [ - 'host' => Env::get('redis.redis_host'), // Redis 服务器地址 - 'port' => Env::get('redis.redis_port'), // Redis 端口 - 'password' => Env::get('redis.redis_password'), // Redis 密码,如果有的话 - 'select' => Env::get('redis.redis_db'), // 默认数据库(0-15) - 'timeout' => 0, // Redis 连接超时 -// 'prefix' => '', // 缓存前缀 -// 'expire' => 3600, // 默认缓存过期时间(秒) + 'host' => Env::get('redis.redis_host'), // Redis 服务器地址 + 'port' => Env::get('redis.redis_port'), // Redis 端口 + 'password' => Env::get('redis.redis_password'), // Redis 密码,如果有的话 + 'select' => Env::get('redis.redis_db'), // 默认数据库(0-15) + 'timeout' => 0, // Redis 连接超时 // ], ], // +---------------------------------------------------------------------- @@ -214,22 +210,15 @@ return [ // SESSION_ID的提交变量,解决flash上传跨域 'var_session_id' => '', // SESSION 前缀 - 'prefix' => 'think', - // 驱动方式 支持redis memcache memcached -// 'type' => 'redis', + 'session_name' => 'session:', // 是否自动开启 SESSION 'auto_start' => true, 'type' => 'redis', -// 'redis' => [ 'host' => Env::get('redis.redis_host'), // Redis 服务器地址 'port' => Env::get('redis.redis_port'), // Redis 端口 'password' => Env::get('redis.redis_password'), // Redis 密码,如果有的话 'select' => Env::get('redis.redis_db'), - 'timeout' => 0, // Redis 连接超时 - - 'expire' => 3600, // 默认缓存过期时间(秒) -// ], ], // +---------------------------------------------------------------------- // | Cookie设置