Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.8] Revert "[5.8] Allow retrieving env variables with getenv" #27961

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Illuminate/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Dotenv\Environment\DotenvFactory;
use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\HigherOrderTapProxy;
use Dotenv\Environment\Adapter\PutenvAdapter;
use Dotenv\Environment\Adapter\EnvConstAdapter;
use Dotenv\Environment\Adapter\ServerConstAdapter;

Expand Down Expand Up @@ -643,7 +642,7 @@ function env($key, $default = null)
static $variables;

if ($variables === null) {
$variables = (new DotenvFactory([new EnvConstAdapter, new PutEnvAdapter, new ServerConstAdapter]))->createImmutable();
$variables = (new DotenvFactory([new EnvConstAdapter, new ServerConstAdapter]))->createImmutable();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This same line of code is duplicated in LoadEnvironmentVariables.php. You would also need to revert c37702c.

}

return Option::fromValue($variables->get($key))
Expand Down
3 changes: 0 additions & 3 deletions tests/Foundation/Bootstrap/LoadEnvironmentVariablesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ public function testCanLoad()
(new LoadEnvironmentVariables)->bootstrap($this->getAppMock('.env'));

$this->assertSame('BAR', env('FOO'));
$this->assertSame('BAR', getenv('FOO'));
$this->assertSame('BAR', $_ENV['FOO']);
$this->assertSame('BAR', $_SERVER['FOO']);
}

public function testCanFailSilent()
Expand Down