Skip to content

Commit 456c1aa

Browse files
sreichelCopilot
andauthored
Update app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php
Co-authored-by: Copilot <[email protected]>
1 parent 51732df commit 456c1aa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ public function setEnvStore(array $envStorage): void
306306
public function getEnv(): array
307307
{
308308
if (empty($this->envStore)) {
309+
// Use $_ENV instead of getenv() because phpdotenv populates $_ENV with both system environment variables
310+
// and variables from the .env file. This ensures that configuration overrides from .env are respected.
311+
// getenv() would only return system environment variables, not those loaded from .env.
309312
$env = array_filter($_ENV, function ($key) {
310313
return str_starts_with($key, self::ENV_STARTS_WITH);
311314
}, ARRAY_FILTER_USE_KEY);

0 commit comments

Comments
 (0)