Browse Source

优化config

shish 6 years ago
parent
commit
58055f9eb4

+ 1 - 23
app/admin/config/main-local.php

@@ -1,26 +1,4 @@
 <?php
-
 $config = [
-    'components' => [
-        'request' => [
-            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
-            'cookieValidationKey' => '3i18DOM7ZDqqQfr2S0hj0c60wFxxTb3J',
-        ],
-    ],
 ];
-
-if (!YII_ENV_TEST) {
-    // configuration adjustments for 'dev' environment
-    $config['bootstrap'][] = 'debug';
-    $config['modules']['debug'] = [
-        'class' => 'yii\debug\Module',
-	    'allowedIPs' => ['*'],
-    ];
-    $config['bootstrap'][] = 'zhhHuahuibaoGii';
-    $config['modules']['zhhHuahuibaoGii'] = [
-        'class' => 'yii\gii\Module',
-        'allowedIPs' => ['*'],
-    ];
-}
-
-return $config;
+return $config;

+ 38 - 40
app/admin/config/main.php

@@ -1,5 +1,5 @@
 <?php
-$params = array_merge (
+$params = array_merge(
 	require(__DIR__ . '/../../../common/config/params.php'),
 	require(__DIR__ . '/../../../common/config/params-local.php'),
 	require(__DIR__ . '/params.php'),
@@ -7,42 +7,40 @@ $params = array_merge (
 );
 
 return [
-    'id' => 'app-backend',
-    'basePath' => dirname(__DIR__),
-    'bootstrap' => ['log'],
-    'defaultRoute' => 'main/index',//默认控制器
-    'controllerNamespace' => 'backend\controllers',
-    'modules' => [],
-    'components' => [
-	    'user' => [
-		    'identityClass' => 'common\models\xhAdmin',
-		    'enableAutoLogin' => true,
-		    'identityCookie' => [
-		    	'name' => 'backendUser', // unique for backend
-		    ],
-		    'loginUrl' => ['main/login'],
-	    ],
-        'log' => [
-            'traceLevel' => YII_DEBUG ? 3 : 0,
-            'targets' => [
-                [
-                    'class' => 'yii\log\FileTarget',
-                    'levels' => ['error', 'warning'],
-                ],
-            ],
-        ],
-        'errorHandler' => [
-            'errorAction' => 'site/error',
-        ],
-        'urlManager' => [
-            'enablePrettyUrl' => true,
-            'showScriptName' => false,
-            'rules' => [
-            	'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
-            ],
-        ],
-    ],
-    'params' => $params,
-]
-
-;
+	'id' => 'app-backend',
+	'basePath' => dirname(__DIR__),
+	'bootstrap' => ['log'],
+	'defaultRoute' => 'main/index',//默认控制器
+	'controllerNamespace' => 'backend\controllers',
+	'modules' => [],
+	'components' => [
+		'user' => [
+			'identityClass' => 'common\models\xhAdmin',
+			'enableAutoLogin' => true,
+			'identityCookie' => [
+				'name' => 'backendUser', // unique for backend
+			],
+			'loginUrl' => ['main/login'],
+		],
+		'log' => [
+			'traceLevel' => YII_DEBUG ? 3 : 0,
+			'targets' => [
+				[
+					'class' => 'yii\log\FileTarget',
+					'levels' => ['error', 'warning'],
+				],
+			],
+		],
+		'errorHandler' => [
+			'errorAction' => 'site/error',
+		],
+		'urlManager' => [
+			'enablePrettyUrl' => true,
+			'showScriptName' => false,
+			'rules' => [
+				'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
+			],
+		],
+	],
+	'params' => $params,
+];

+ 0 - 1
app/admin/config/params.php

@@ -1,4 +1,3 @@
 <?php
 return [
-    'adminEmail' => 'admin@example.com',
 ];

+ 0 - 22
app/backend/config/main-local.php

@@ -1,26 +1,4 @@
 <?php
-
 $config = [
-    'components' => [
-        'request' => [
-            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
-            'cookieValidationKey' => '3i18DOM7ZDqqQfr2S0hj0c60wFxxTb3J',
-        ],
-    ],
 ];
-
-if (!YII_ENV_TEST) {
-    // configuration adjustments for 'dev' environment
-    $config['bootstrap'][] = 'debug';
-    $config['modules']['debug'] = [
-        'class' => 'yii\debug\Module',
-	    'allowedIPs' => ['*'],
-    ];
-    $config['bootstrap'][] = 'zhhHuahuibaoGii';
-    $config['modules']['zhhHuahuibaoGii'] = [
-        'class' => 'yii\gii\Module',
-        'allowedIPs' => ['*'],
-    ];
-}
-
 return $config;

+ 0 - 1
app/backend/config/params.php

@@ -1,4 +1,3 @@
 <?php
 return [
-    'adminEmail' => 'admin@example.com',
 ];

+ 0 - 22
app/frontend/config/main-local.php

@@ -1,26 +1,4 @@
 <?php
-
 $config = [
-    'components' => [
-        'request' => [
-            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
-            'cookieValidationKey' => '4pBghRkKnDb8eBXcsiwLXXi6748-5LuH',
-        ],
-    ],
 ];
-
-if (!YII_ENV_TEST) {
-    // configuration adjustments for 'dev' environment
-    $config['bootstrap'][] = 'debug';
-    $config['modules']['debug'] = [
-        'class' => 'yii\debug\Module',
-        'allowedIPs' => ['*'],
-    ];
-    $config['bootstrap'][] = 'zhhHuahuibaoGii';
-    $config['modules']['zhhHuahuibaoGii'] = [
-        'class' => 'yii\gii\Module',
-        'allowedIPs' => [],
-    ];
-}
-
 return $config;

+ 0 - 2
app/frontend/config/params.php

@@ -1,5 +1,3 @@
 <?php
 return [
-    'adminEmail' => 'admin@example.com',
-    'luckDrawSecretKey' => '#C^LpNy~a8',//抽奖活动-加密密钥
 ];

+ 0 - 22
app/mini/config/main-local.php

@@ -1,26 +1,4 @@
 <?php
-
 $config = [
-    'components' => [
-        'request' => [
-            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
-            'cookieValidationKey' => '4pBghRkKnDb8eBXcsiwLXXi6748-5LuH',
-        ],
-    ],
 ];
-
-if (!YII_ENV_TEST) {
-    // configuration adjustments for 'dev' environment
-    $config['bootstrap'][] = 'debug';
-    $config['modules']['debug'] = [
-        'class' => 'yii\debug\Module',
-        'allowedIPs' => ['*'],
-    ];
-    $config['bootstrap'][] = 'zhhHuahuibaoGii';
-    $config['modules']['zhhHuahuibaoGii'] = [
-        'class' => 'yii\gii\Module',
-        'allowedIPs' => [],
-    ];
-}
-
 return $config;

+ 0 - 3
app/mini/config/params.php

@@ -1,6 +1,3 @@
 <?php
 return [
-    'adminEmail' => 'admin@example.com',
-    'luckDrawSecretKey' => '#C^LpNy~a8',//抽奖活动-加密密钥
-	'pageSize' => 15,//每页显示数目
 ];

+ 0 - 22
app/mobile/config/main-local.php

@@ -1,26 +1,4 @@
 <?php
-
 $config = [
-    'components' => [
-        'request' => [
-            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
-            'cookieValidationKey' => '4pBghRkKnDb8eBXcsiwLXXi6748-5LuH',
-        ],
-    ],
 ];
-
-if (!YII_ENV_TEST) {
-    // configuration adjustments for 'dev' environment
-    $config['bootstrap'][] = 'debug';
-    $config['modules']['debug'] = [
-        'class' => 'yii\debug\Module',
-        'allowedIPs' => ['*'],
-    ];
-    $config['bootstrap'][] = 'zhhHuahuibaoGii';
-    $config['modules']['zhhHuahuibaoGii'] = [
-        'class' => 'yii\gii\Module',
-        'allowedIPs' => [],
-    ];
-}
-
 return $config;

+ 0 - 2
app/mobile/config/params.php

@@ -1,5 +1,3 @@
 <?php
 return [
-    'adminEmail' => 'admin@example.com',
-    'luckDrawSecretKey' => '#C^LpNy~a8',//抽奖活动-加密密钥
 ];

+ 0 - 23
app/openend/config/main-local.php

@@ -1,27 +1,4 @@
 <?php
-
 $config = [
-    'components' => [
-        'request' => [
-            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
-            'cookieValidationKey' => '3i18DOM7ZDqqQfr2S0hj0c60wFxxTb3J',
-        ],
-    ],
 ];
-
-if (!YII_ENV_TEST) {
-    // configuration adjustments for 'dev' environment
-    $config['bootstrap'][] = 'debug';
-    $config['modules']['debug'] = [
-        'class' => 'yii\debug\Module',
-        'allowedIPs' => ['*'],
-    ];
-
-    $config['bootstrap'][] = 'zhhHuahuibaoGii';
-    $config['modules']['zhhHuahuibaoGii'] = [
-        'class' => 'yii\gii\Module',
-        'allowedIPs' => ['127.0.0.1', '::1'],
-    ];
-}
-
 return $config;

+ 0 - 1
app/openend/config/params.php

@@ -1,4 +1,3 @@
 <?php
 return [
-    'adminEmail' => 'admin@example.com',
 ];

+ 0 - 23
app/platform/config/main-local.php

@@ -1,27 +1,4 @@
 <?php
-
 $config = [
-    'components' => [
-        'request' => [
-            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
-            'cookieValidationKey' => '3i18DOM7ZDqqQfr2S0hj0c60wFxxTb3J',
-        ],
-    ],
 ];
-
-if (!YII_ENV_TEST) {
-    // configuration adjustments for 'dev' environment
-    $config['bootstrap'][] = 'debug';
-    $config['modules']['debug'] = [
-        'class' => 'yii\debug\Module',
-        'allowedIPs' => ['*'],
-    ];
-
-    $config['bootstrap'][] = 'zhhHuahuibaoGii';
-    $config['modules']['zhhHuahuibaoGii'] = [
-        'class' => 'yii\gii\Module',
-        'allowedIPs' => ['222.76.251.2'],
-    ];
-}
-
 return $config;

+ 0 - 1
app/platform/config/params.php

@@ -1,4 +1,3 @@
 <?php
 return [
-    'adminEmail' => 'admin@example.com',
 ];

+ 0 - 23
app/teach/config/main-local.php

@@ -1,27 +1,4 @@
 <?php
-
 $config = [
-    'components' => [
-        'request' => [
-            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
-            'cookieValidationKey' => '3i18DOM7ZDqqQfr2S0hj0c60wFxxTb3J',
-        ],
-    ],
 ];
-
-if (!YII_ENV_TEST) {
-    // configuration adjustments for 'dev' environment
-    $config['bootstrap'][] = 'debug';
-    $config['modules']['debug'] = [
-        'class' => 'yii\debug\Module',
-        'allowedIPs' => ['*'],
-    ];
-
-    $config['bootstrap'][] = 'zhhHuahuibaoGii';
-    $config['modules']['zhhHuahuibaoGii'] = [
-        'class' => 'yii\gii\Module',
-        'allowedIPs' => ['127.0.0.1', '::1'],
-    ];
-}
-
 return $config;

+ 0 - 1
app/teach/config/params.php

@@ -1,4 +1,3 @@
 <?php
 return [
-    'adminEmail' => 'admin@example.com',
 ];