فهرست منبع

move all credentials to local.php for easier modification and development

Richard Hagen 9 سال پیش
والد
کامیت
c474da4899
2فایلهای تغییر یافته به همراه14 افزوده شده و 8 حذف شده
  1. 14 0
      config/local.php
  2. 0 8
      config/web.php

+ 14 - 0
config/local.php

@@ -11,5 +11,19 @@ putenv('LC_ALL=zh_CN.UTF-8');
 
 return [
     'components' => [
+        'db' => [
+            'dsn'       => 'mysql:host=127.0.0.1;dbname=walle',
+            'username'  => 'root',
+            'password'  => '',
+        ],
+        'mail' => [
+            'transport' => [
+                'username'   => 'service@huamanshu.com',  # smtp 发件用户名
+                'password'   => 'K84erUuxg1bHqrfD',       # smtp 发件人的密码
+            ],
+        ],
+        'request' => [
+            'cookieValidationKey' => 'PdXWDAfV5-gPJJWRar5sEN71DN0JcDRV',
+        ],
     ],
 ];

+ 0 - 8
config/web.php

@@ -9,9 +9,6 @@ $config = [
     'components' => [
         'db' => [
             'class'     => 'yii\db\Connection',
-            'dsn'       => 'mysql:host=127.0.0.1;dbname=walle',
-            'username'  => 'root',
-            'password'  => '',
             'charset'   => 'utf8',
         ],
         'session' => [
@@ -28,8 +25,6 @@ $config = [
             'transport' => [
                 'class'      => 'Swift_SmtpTransport',
                 'host'       => 'smtp.huamanshu.com',     # smtp 发件地址
-                'username'   => 'service@huamanshu.com',  # smtp 发件用户名
-                'password'   => 'K84erUuxg1bHqrfD',       # smtp 发件人的密码
                 'port'       => 25,                       # smtp 端口
                 'encryption' => 'tls',                    # smtp 协议
             ],
@@ -66,9 +61,6 @@ $config = [
                 '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
             ],
         ],
-        'request' => [
-            'cookieValidationKey' => 'PdXWDAfV5-gPJJWRar5sEN71DN0JcDRV',
-        ],
     ],
     'language'   => 'zh', // zh => 中文,  en => English
     'bootstrap'  => [