Skip to content

Commit 7e1bc90

Browse files
Merge branch '4.4' into 5.0
* 4.4: [DependencyInjection] Fix binding tagged services to containers [ProxyManager] fix generating proxies for root-namespaced classes [DI] skip looking for config class when the extension class is anonymous Fix typo Docs - Update debug section of UPGRADE guides for 4.4 and 5.0 versions. [Dotenv] FIX missing getenv [HttpFoundation] fix pdo session handler for sqlsrv [HttpClient][Psr18Client] Remove Psr18ExceptionTrait [HttpKernel] ignore failuresgenerated by opcache.restrict_api
2 parents 7f27ade + c387ab3 commit 7e1bc90

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Dotenv.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ private function resolveVariables(string $value, array $loadedVars): string
458458
} elseif (isset($this->values[$name])) {
459459
$value = $this->values[$name];
460460
} else {
461-
$value = '';
461+
$value = (string) getenv($name);
462462
}
463463

464464
if ('' === $value && isset($matches['default_value']) && '' !== $matches['default_value']) {

Tests/DotenvTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,17 @@ public function testGetVariablesValueFromEnvFirst()
443443
}
444444
}
445445

446+
public function testGetVariablesValueFromGetenv()
447+
{
448+
putenv('Foo=Bar');
449+
450+
$dotenv = new Dotenv(true);
451+
$values = $dotenv->parse('Foo=${Foo}');
452+
$this->assertSame('Bar', $values['Foo']);
453+
454+
putenv('Foo');
455+
}
456+
446457
public function testNoDeprecationWarning()
447458
{
448459
$dotenv = new Dotenv(true);

0 commit comments

Comments
 (0)