支持通过配置文件配置redis服务器

This commit is contained in:
Chenx221 2024-05-24 20:20:31 +08:00
parent 8614794747
commit d0b7807a36
Signed by: chenx221
GPG Key ID: D7A9EC07024C3021
2 changed files with 8 additions and 2 deletions

View File

@ -18,6 +18,12 @@ DB_USERNAME=
# 数据库密码[string] # 数据库密码[string]
DB_PASSWORD= DB_PASSWORD=
# Redis
# Redis地址[string]
RD_HOST=
# Redis端口[int]
RD_PORT=
# 验证码配置 # 验证码配置
# 验证服务提供商[reCAPTCHA,hCaptcha,Turnstile,None] # 验证服务提供商[reCAPTCHA,hCaptcha,Turnstile,None]
VERIFY_PROVIDER= VERIFY_PROVIDER=

View File

@ -61,8 +61,8 @@ $config = [
], ],
'redis' => [ 'redis' => [
'class' => 'yii\redis\Connection', 'class' => 'yii\redis\Connection',
'hostname' => 'localhost', 'hostname' => $_ENV['RD_HOST'],
'port' => 6379, 'port' => $_ENV['RD_PORT'],
'database' => 0, 'database' => 0,
], ],
'db' => $db, 'db' => $db,