]> gitweb.erp-flowers.ru Git - yii-erp24/.git/commitdiff
правки по настройке подключения к БД из консоли
authorAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Wed, 8 May 2024 11:27:43 +0000 (14:27 +0300)
committerAleksey Filippov <Aleksey.Filippov@erp-flowers.ru>
Wed, 8 May 2024 11:27:43 +0000 (14:27 +0300)
erp24/config/prod.console.config.php

index 10b700bf13d783cbef90c8c621bac1c5d4409db4..e68d082265e75797b14d71c962e5ee77476c2081 100755 (executable)
@@ -34,18 +34,7 @@ return [
             'enablePrettyUrl' => true,
             'showScriptName' => false,
         ],
-        'db' => [
-            'class' => yii\db\Connection::class,
-            'dsn' => strtr('mysql:host={host};dbname={dbname}', [
-                '{host}' => getenv('DB_HOST') ?: $_CONFIG_SITE["mysql_host"],
-                '{dbname}' => getenv('DB_SCHEMA') ?: $_CONFIG_SITE["mysql_db"],
-            ]),
-            'username' => getenv('DB_USER') ?: $_CONFIG_SITE["mysql_user"],
-            'password' => getenv('DB_PASSWORD') ?: $_CONFIG_SITE["mysql_pass"],
-            'charset' => 'utf8',
-            'enableSchemaCache' => true,
-            'schemaCacheDuration' => 300,
-        ],
+        'db' => require dirname(__DIR__) . '/config/db.php',
         'db2' => require dirname(__DIR__) . '/config/db2.php',
         'log' => [
             'traceLevel' => YII_DEBUG ? 3 : 0,