[DI] fix loading env while env loaders are loaded
This commit is contained in:
parent
7c111bdcf3
commit
522bd5d99d
@ -141,15 +141,20 @@ class EnvVarProcessor implements EnvVarProcessorInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$loaders = $this->loaders;
|
||||||
|
$this->loaders = new \ArrayIterator();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while ((false === $env || null === $env) && $this->loaders->valid()) {
|
while ((false === $env || null === $env) && $loaders->valid()) {
|
||||||
$loader = $this->loaders->current();
|
$loader = $loaders->current();
|
||||||
$this->loaders->next();
|
$loaders->next();
|
||||||
$this->loadedVars[] = $vars = $loader->loadEnvVars();
|
$this->loadedVars[] = $vars = $loader->loadEnvVars();
|
||||||
$env = $vars[$name] ?? false;
|
$env = $vars[$name] ?? false;
|
||||||
}
|
}
|
||||||
} catch (ParameterCircularReferenceException $e) {
|
} catch (ParameterCircularReferenceException $e) {
|
||||||
// skip loaders that need an env var that is not defined
|
// skip loaders that need an env var that is not defined
|
||||||
|
} finally {
|
||||||
|
$this->loaders = $loaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false === $env || null === $env) {
|
if (false === $env || null === $env) {
|
||||||
|
Reference in New Issue
Block a user