Browse Source

优化配置文件

Anyon 4 years ago
parent
commit
0b6a6bc855
2 changed files with 9 additions and 5 deletions
  1. 5 3
      config/database.php
  2. 4 2
      config/lang.php

+ 5 - 3
config/database.php

@@ -39,12 +39,10 @@ return [
             'hostport'        => '3306',
             // 数据库连接参数
             'params'          => [],
-            // 数据库编码默认采用utf8
+            // 数据库编码默认采用 utf8
             'charset'         => 'utf8mb4',
             // 数据库表前缀
             'prefix'          => '',
-            // 数据库调试模式
-            'debug'           => app()->isDebug(),
             // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
             'deploy'          => 0,
             // 数据库读写是否分离 主从式有效
@@ -57,6 +55,10 @@ return [
             'fields_strict'   => true,
             // 是否需要断线重连
             'break_reconnect' => false,
+            // 监听SQL
+            'trigger_sql'     => app()->isDebug(),
+            // 开启字段缓存
+            'fields_cache'    => false,
         ],
     ],
 ];

+ 4 - 2
config/lang.php

@@ -17,13 +17,15 @@ return [
     // 默认语言
     'default_lang'    => 'zh-cn',
     // 允许的语言列表
-    'allow_lang_list' => ['zh-cn'],
+    'allow_lang_list' => ['zh-cn', 'en-us'],
     // 多语言自动侦测变量名
     'detect_var'      => 'lang',
-    // 是否使用 Cookie 记录
+    // 使用 Cookie 记录
     'use_cookie'      => true,
     // 多语言 Cookie 变量
     'cookie_var'      => 'think_lang',
+    // 多语言 Header 变量
+    'header_var'      => 'think-lang',
     // 是否支持语言分组
     'allow_group'     => false,
     // 扩展语言包