From ea8af673c97db17a88fcfcef8d96187049acf840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Ro=C3=9Fkamp?= Date: Tue, 26 Feb 2019 18:30:49 +0100 Subject: [PATCH] Fix getenv() not working with .env.local.php --- symfony/framework-bundle/4.2/config/bootstrap.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/symfony/framework-bundle/4.2/config/bootstrap.php b/symfony/framework-bundle/4.2/config/bootstrap.php index f6afb404..d06bd70d 100644 --- a/symfony/framework-bundle/4.2/config/bootstrap.php +++ b/symfony/framework-bundle/4.2/config/bootstrap.php @@ -7,6 +7,9 @@ require dirname(__DIR__).'/vendor/autoload.php'; // Load cached env vars if the .env.local.php file exists // Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) { + foreach ($env as $name => $value) { + putenv("$name=$value"); + } $_SERVER += $env; $_ENV += $env; } elseif (!class_exists(Dotenv::class)) {