Skip to content

Commit 41c4ce5

Browse files
[Dotenv] Fix SYMFONY_DOTENV_PATH purpose
1 parent 437307b commit 41c4ce5

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

configuration.rst

+6-10
Original file line numberDiff line numberDiff line change
@@ -954,15 +954,7 @@ path is part of the options you can set in your ``composer.json`` file:
954954
}
955955
}
956956
957-
You can also set the ``SYMFONY_DOTENV_PATH`` environment variable at system
958-
level (e.g. in your web server configuration or in your Dockerfile):
959-
960-
.. code-block:: bash
961-
962-
# .env (or .env.local)
963-
SYMFONY_DOTENV_PATH=my/custom/path/to/.env
964-
965-
Finally, you can directly invoke the ``Dotenv`` class in your
957+
As an alternate option, you can directly invoke the ``Dotenv`` class in your
966958
``bootstrap.php`` file or any other file of your application::
967959

968960
use Symfony\Component\Dotenv\Dotenv;
@@ -975,9 +967,13 @@ the local and environment-specific files (e.g. ``.*.local`` and
975967
:ref:`how to override environment variables <configuration-multiple-env-files>`
976968
to learn more about this.
977969

970+
If you need to know the path to the ``.env`` file that Symfony is using, you can
971+
read the ``SYMFONY_DOTENV_PATH`` environment variable in your application.
972+
978973
.. versionadded:: 7.1
979974

980-
The ``SYMFONY_DOTENV_PATH`` environment variable was introduced in Symfony 7.1.
975+
The ``SYMFONY_DOTENV_PATH`` environment variable was introduced in Symfony
976+
7.1.
981977

982978
.. _configuration-secrets:
983979

0 commit comments

Comments
 (0)