Skip to content

Commit 9b365c2

Browse files
committed
minor #1003 Apply latest changes in FWBundle recipe (bocharsky-bw)
This PR was merged into the master branch. Discussion ---------- Apply latest changes in FWBundle recipe See symfony/recipes#611 Commits ------- 11def45 Apply latest changes in FWBundle recipe
2 parents 3e36a18 + 11def45 commit 9b365c2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

config/bootstrap.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
// Load cached env vars if the .env.local.php file exists
88
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
99
if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) {
10-
$_ENV += $env;
10+
foreach ($env as $k => $v) {
11+
$_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v);
12+
}
1113
} elseif (!class_exists(Dotenv::class)) {
1214
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.');
1315
} else {

0 commit comments

Comments
 (0)