Fix getenv() not working with .env.local.php

This commit is contained in:
Steffen Roßkamp
2019-02-26 18:30:49 +01:00
committed by GitHub
parent d9dc7a8ff5
commit ea8af673c9
@@ -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)) {