Authored by wuxiao

修改基础入口引用配置的方式

<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
(@include(__DIR__ . '/../../common/config/params-local.php'))?:[],
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
(@include(__DIR__ . '/params-local.php'))?:[]
);
return [
... ...
... ... @@ -9,9 +9,9 @@ require(__DIR__ . '/../config/bootstrap.php');
$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../common/config/main.php'),
require(__DIR__ . '/../../common/config/main-local.php'),
(@include(__DIR__ . '/../../common/config/main-local.php'))?:[],
require(__DIR__ . '/../config/main.php'),
require(__DIR__ . '/../config/main-local.php')
(@include(__DIR__ . '/../config/main-local.php'))?:[]
);
$application = new yii\web\Application($config);
... ...
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
(@include(__DIR__ . '/../../common/config/params-local.php'))?:[],
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
(@include(__DIR__ . '/params-local.php'))?:[]
);
return [
... ...
<?php
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
(@include(__DIR__ . '/../../common/config/params-local.php'))?:[],
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
(@include(__DIR__ . '/params-local.php'))?:[]
);
return [
... ... @@ -14,6 +14,8 @@ return [
'components' => [
'request' => [
'csrfParam' => '_csrf-frontend',
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'hNWgnTak0P0f9VAiC-2UQZTrMtjzpLoN',
],
'user' => [
'identityClass' => 'common\models\User',
... ... @@ -44,6 +46,13 @@ return [
],
],
*/
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=yii2advanced',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
],
],
'params' => $params,
];
... ...
... ... @@ -9,9 +9,9 @@ require(__DIR__ . '/../config/bootstrap.php');
$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/../../common/config/main.php'),
require(__DIR__ . '/../../common/config/main-local.php'),
(@include(__DIR__ . '/../../common/config/main-local.php'))?:[],
require(__DIR__ . '/../config/main.php'),
require(__DIR__ . '/../config/main-local.php')
(@include(__DIR__ . '/../config/main-local.php'))?:[]
);
$application = new yii\web\Application($config);
... ...