From 39060ee778bb2e1e153debb890f710732c748e34 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Fri, 16 Jan 2026 17:31:11 +0300 Subject: [PATCH] =?utf8?q?[ERP-500]=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?utf8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=B3=D1=80=D1=83?= =?utf8?q?=D0=B7=D0=BA=D0=B8=20.env=20=D0=B2=20=D1=82=D0=B5=D1=81=D1=82?= =?utf8?q?=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Изменён Dotenv::createImmutable на createUnsafeImmutable для поддержки getenv() в phpdotenv v5+. Без этого изменения переменные окружения не были доступны через getenv(), что приводило к ошибке подключения к БД. Co-Authored-By: Claude Opus 4.5 --- erp24/tests/_bootstrap.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erp24/tests/_bootstrap.php b/erp24/tests/_bootstrap.php index 6103c859..b4e8f4e6 100755 --- a/erp24/tests/_bootstrap.php +++ b/erp24/tests/_bootstrap.php @@ -5,10 +5,11 @@ defined('YII_DEBUG') or define('YII_DEBUG', true); require __DIR__ .'/../vendor/autoload.php'; // Load .env.testing if exists, otherwise fall back to .env +// Using createUnsafeImmutable to support getenv() in phpdotenv v5+ $dotenvFile = file_exists(__DIR__ . '/../.env.testing') ? '.env.testing' : '.env'; if (file_exists(__DIR__ . '/../' . $dotenvFile)) { - $dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..', $dotenvFile); - $dotenv->safeLoad(); + $dotenv = Dotenv\Dotenv::createUnsafeImmutable(__DIR__ . '/..', $dotenvFile); + $dotenv->load(); } require_once __DIR__ . '/../vendor/yiisoft/yii2/Yii.php'; \ No newline at end of file -- 2.39.5