mirror of
https://github.com/symfony/recipes.git
synced 2026-09-12 07:36:30 +03:00
Fix getenv() not working with .env.local.php
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user