bug #29205 [Dotenv] skip loading "local" env twice (nicolas-grekas)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[Dotenv] skip loading "local" env twice

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

e.g. on homestead, APP_ENV defaults to "local" :)

Commits
-------

978fcfbc03 [Dotenv] skip loading "local" env twice
This commit is contained in:
Nicolas Grekas 2018-11-14 11:17:49 +01:00
commit 8b36baf41e

View File

@ -82,6 +82,10 @@ final class Dotenv
$env = $_SERVER[$varName] ?? $_ENV[$varName] ?? $env;
}
if ('local' === $env) {
return;
}
if (file_exists($p = "$path.$env")) {
$this->load($p);
}