Skip to content

Commit

Permalink
Merge pull request #136 from TYPO3incubator/bugfix/env-file-order
Browse files Browse the repository at this point in the history
[BUGFIX] Load env.prod file before server env vars
  • Loading branch information
lkreitz authored Jun 12, 2024
2 parents ebee376 + 6a643db commit d65bfa5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions config/system/additional.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
$dotenv = Dotenv\Dotenv::createMutable(__DIR__ . '/../../', '.env.dist');
$dotenv->load();

if (file_exists(__DIR__ . '/../../.env')) {
$dotenv = Dotenv\Dotenv::createMutable(__DIR__ . '/../../');
if (\TYPO3\CMS\Core\Core\Environment::getContext() == 'Production') {
$dotenv = Dotenv\Dotenv::createMutable(__DIR__ . '/../../', '.env.prod');
$dotenv->load();
}

if (\TYPO3\CMS\Core\Core\Environment::getContext() == 'Production') {
$dotenv = Dotenv\Dotenv::createMutable(__DIR__ . '/../../', '.env.prod');
if (file_exists(__DIR__ . '/../../.env')) {
$dotenv = Dotenv\Dotenv::createMutable(__DIR__ . '/../../');
$dotenv->load();
}

Expand Down

0 comments on commit d65bfa5

Please sign in to comment.