Allow to override .env files per env

This commit is contained in:
Nicolas Grekas
2018-11-09 14:22:38 +01:00
parent 5b3ce90950
commit 95bb54353e
22 changed files with 157 additions and 90 deletions
@@ -1,11 +1,3 @@
<?php
use Symfony\Component\Dotenv\Dotenv;
// The check is to ensure we don't use .env in production
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');
}
App\Kernel::bootstrapEnv('test');