Skip to content

Commit 38e4f08

Browse files
Reword
1 parent f8a3c0d commit 38e4f08

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

components/dotenv.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,14 @@ Access the value with ``getenv()`` in your code::
5858
$dbUser = getenv('DB_USER');
5959
// you can also use ``$_ENV`` or ``$_SERVER``
6060

61+
The ``load()`` method never overwrites existing environment variables. Use the
62+
``overload()`` method if you need to overwrite them::
63+
64+
// ...
65+
$dotenv->overload(__DIR__.'/.env');
66+
6167
.. versionadded:: 4.2
62-
Passing ``$overrideExistingVars`` as ``true`` in ``Dotenv::populate()`` or calling ``Dotenv::overload()`` instead of ``Dotenv::load()`` allow you to overwrite existing environment variables.
68+
The ``Dotenv::overload()`` method was introduced in Symfony 4.2.
6369

6470
You should never store a ``.env`` file in your code repository as it might
6571
contain sensitive information; create a ``.env.dist`` file with sensible

0 commit comments

Comments
 (0)