Skip to content

Commit

Permalink
Load .dist env files
Browse files Browse the repository at this point in the history
  • Loading branch information
pamil committed Sep 25, 2018
1 parent 581af60 commit 0d8c117
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/Application/bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ if (!isset($_SERVER['APP_ENV'])) {
if (!class_exists(Dotenv::class)) {
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
}
(new Dotenv())->load(__DIR__.'/../.env');

$envFile = file_exists(__DIR__.'/../.env') ? __DIR__.'/../.env' : __DIR__.'/../.env.dist';
(new Dotenv())->load($envFile);
}

$input = new ArgvInput();
Expand Down
4 changes: 3 additions & 1 deletion tests/Application/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
if (!class_exists(Dotenv::class)) {
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.');
}
(new Dotenv())->load(__DIR__.'/../.env');

$envFile = file_exists(__DIR__.'/../.env') ? __DIR__.'/../.env' : __DIR__.'/../.env.dist';
(new Dotenv())->load($envFile);
}

$env = $_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'dev';
Expand Down

0 comments on commit 0d8c117

Please sign in to comment.