diff --git a/components/dotenv.rst b/components/dotenv.rst index fae35a5b5f2..daa0a197441 100644 --- a/components/dotenv.rst +++ b/components/dotenv.rst @@ -58,9 +58,14 @@ Access the value with ``getenv()`` in your code:: $dbUser = getenv('DB_USER'); // you can also use ``$_ENV`` or ``$_SERVER`` -.. note:: +The ``load()`` method never overwrites existing environment variables. Use the +``overload()`` method if you need to overwrite them:: + + // ... + $dotenv->overload(__DIR__.'/.env'); - Symfony Dotenv never overwrites existing environment variables. +.. versionadded:: 4.2 + The ``Dotenv::overload()`` method was introduced in Symfony 4.2. You should never store a ``.env`` file in your code repository as it might contain sensitive information; create a ``.env.dist`` file with sensible pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy