File tree 1 file changed +6
-10
lines changed
1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -954,15 +954,7 @@ path is part of the options you can set in your ``composer.json`` file:
954
954
}
955
955
}
956
956
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
966
958
``bootstrap.php `` file or any other file of your application::
967
959
968
960
use Symfony\Component\Dotenv\Dotenv;
@@ -975,9 +967,13 @@ the local and environment-specific files (e.g. ``.*.local`` and
975
967
:ref: `how to override environment variables <configuration-multiple-env-files >`
976
968
to learn more about this.
977
969
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
+
978
973
.. versionadded :: 7.1
979
974
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.
981
977
982
978
.. _configuration-secrets :
983
979
You can’t perform that action at this time.
0 commit comments