From fe0e99324eb6e545bce0a7d3f6f79e1f407adab8 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 11 Nov 2018 10:18:16 +0100 Subject: [PATCH] Load .env.dist when it exists and .env is not found --- phpunit/phpunit/4.7/phpunit.xml.dist | 2 +- symfony/framework-bundle/3.3/src/Kernel.php | 6 +++++- symfony/phpunit-bridge/3.3/phpunit.xml.dist | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/phpunit/phpunit/4.7/phpunit.xml.dist b/phpunit/phpunit/4.7/phpunit.xml.dist index a306d95b..65092d6d 100644 --- a/phpunit/phpunit/4.7/phpunit.xml.dist +++ b/phpunit/phpunit/4.7/phpunit.xml.dist @@ -2,7 +2,7 @@ load($path); + if (file_exists($path) || !file_exists($p = "$path.dist")) { + $dotenv->load($path); + } else { + $dotenv->load($p); + } if (null === $env = isset($_SERVER['APP_ENV']) ? $_SERVER['APP_ENV'] : (isset($_ENV['APP_ENV']) ? $_ENV['APP_ENV'] : null)) { $dotenv->populate(array('APP_ENV' => $env = 'dev')); diff --git a/symfony/phpunit-bridge/3.3/phpunit.xml.dist b/symfony/phpunit-bridge/3.3/phpunit.xml.dist index ae501d84..e283e8db 100644 --- a/symfony/phpunit-bridge/3.3/phpunit.xml.dist +++ b/symfony/phpunit-bridge/3.3/phpunit.xml.dist @@ -2,7 +2,7 @@