Commit a0934b6d authored by 郭勇志's avatar 郭勇志

优化结构

parent 7633855a
<?php
defined('PREFIX') or define('PREFIX', 'ROMENS_NEW_');
<?php
return [
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=weishopdb',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
],
//add db1,2,3,4,5,6
'db-100' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=weishopdbs',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
],
]
];
......@@ -5,7 +5,6 @@ $params = array_merge(
require __DIR__ . '/params.php',
require __DIR__ . '/params-local.php'
);
return [
'id' => 'app-backend',
'basePath' => dirname(__DIR__),
......@@ -65,22 +64,6 @@ return [
'GET swaggers/swagger/<id>'=>'swagger/swagger',
],
],
// default db
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=weishopdb',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
],
//add db1,2,3,4,5,6
'db-100' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=weishopdbs',
'username' => 'root',
'password' => '',
'charset' => 'utf8',
],
'redis' => [
'class' => 'yii\redis\Connection',
'hostname' => 'r-m5ed79b6945c5a14.redis.rds.aliyuncs.com',
......
<?php
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
defined('PREFIX') or define('PREFIX', 'ROMENS_NEW_');
require __DIR__ . '/../../vendor/autoload.php';
require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php';
require __DIR__ . '/../../common/config/bootstrap.php';
require __DIR__ . '/../config/bootstrap.php';
require __DIR__ . '/constants.php';
$config = yii\helpers\ArrayHelper::merge(
require __DIR__ . '/../../common/config/main.php',
require __DIR__ . '/../../common/config/main-local.php',
require __DIR__ . '/../config/main.php',
require __DIR__ . '/../config/main-local.php'
require __DIR__ . '/../config/main-local.php',
require __DIR__ . '/../config/db.php'
);
(new yii\web\Application($config))->run();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment