From d39319fa838b1681b010943c7f8e2c9b046197d4 Mon Sep 17 00:00:00 2001 From: JaguarJack <82664165@qq.com> Date: Thu, 17 Jan 2019 16:29:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20env=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.emp | 15 +++++++++++++++ config/app.php | 4 ++-- config/database.php | 12 ++++++------ 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 .env.emp diff --git a/.env.emp b/.env.emp new file mode 100644 index 0000000..fc3c700 --- /dev/null +++ b/.env.emp @@ -0,0 +1,15 @@ +app_debug=true +app_trace=true + +db_connection=mysql +db_host=localhost +db_database=thinking +db_username=user +db_port=3306 +db_password=password + +redis_host= +redis_port= +redis_password= + + diff --git a/config/app.php b/config/app.php index c90a2dc..11dfc17 100644 --- a/config/app.php +++ b/config/app.php @@ -19,9 +19,9 @@ return [ // 应用地址 'app_host' => '', // 应用调试模式 - 'app_debug' => true, + 'app_debug' => env('app_debug'), // 应用Trace - 'app_trace' => true, + 'app_trace' => env('app_trace'), // 是否支持多模块 'app_multi_module' => true, // 入口自动绑定模块 diff --git a/config/database.php b/config/database.php index 8543d98..e475ba8 100644 --- a/config/database.php +++ b/config/database.php @@ -11,17 +11,17 @@ return [ // 数据库类型 - 'type' => 'mysql', + 'type' => env('db_connection'), // 服务器地址 - 'hostname' => '127.0.0.1', + 'hostname' => env('db_host'), // 数据库名 - 'database' => 'cms', + 'database' => env('db_database'), // 用户名 - 'username' => 'root', + 'username' => env('db_username'), // 密码 - 'password' => 'admin', + 'password' => env('db_password'), // 端口 - 'hostport' => '3306', + 'hostport' => env('db_port'), // 连接dsn 'dsn' => '', // 数据库连接参数