瀏覽代碼

配置更改

linwu 2 年之前
父節點
當前提交
2720e8bbd5
共有 2 個文件被更改,包括 10 次插入9 次删除
  1. 1 1
      data/config/app.php
  2. 9 8
      data/config/database.php

+ 1 - 1
data/config/app.php

@@ -1,5 +1,5 @@
 <?php
 return [
     // 异常页面的模板文件
-    'exception_tmpl'         => __DIR__ . '/../tpl/think_exception.tpl',
+//    'exception_tmpl'         => __DIR__ . '/../tpl/think_exception.tpl',
 ];

+ 9 - 8
data/config/database.php

@@ -2,24 +2,25 @@
 /**
  * 配置文件
  */
+use think\facade\Env;
 
 return [
     // 数据库类型
-    'type'     => 'mysql',
+    'type'     => Env::get('database.type', 'mysql'),
     // 服务器地址
-    'hostname' => '127.0.0.1',
+    'hostname' => Env::get('database.hostname', '127.0.0.1'),
     // 数据库名
-    'database' => 'love',
+    'database' => Env::get('database.database', 'love'),
     // 用户名
-    'username' => 'root',
+    'username' => Env::get('database.username', 'root'),
     // 密码
-    'password' => '',
+    'password' => Env::get('database.password', ''),
     // 端口
-    'hostport' => '3306',
+    'hostport' => Env::get('database.hostport', '3306'),
     // 数据库编码默认采用utf8
-    'charset'  => 'utf8mb4',
+    'charset'  => Env::get('database.charset', 'utf8mb4'),
     // 数据库表前缀
-    'prefix'   => 'cmf_',
+    'prefix'   => Env::get('database.prefix', 'cmf_'),
     "authcode" => 'XkeBVvgoTRUQXWGKZg',
     //#COOKIE_PREFIX#
 ];