8000 Various fixes · symfony/symfony-docs@c164e73 · GitHub
[go: up one dir, main page]

Skip to content

Commit c164e73

Browse files
Toflarwouterj
authored andcommitted
Various fixes
1 parent 2b1e8f2 commit c164e73

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

components/dotenv.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The ``load()`` method never overwrites existing environment variables. Use the
6262
// ...
6363
$dotenv->overload(__DIR__.'/.env');
6464

65-
As you're working with the ``Dotenv`` component you'll notice that you might want
65+
As you're working with the Dotenv component you'll notice that you might want
6666
to have different files depending on the environment you're working in. Typically
6767
this happens for local development or Continuous Integration where you might
6868
want to have different files for your ``test`` and ``dev`` environments.
@@ -74,18 +74,19 @@ You can use ``Dotenv::loadEnv()`` to ease this process::
7474
$dotenv = new Dotenv();
7575
$dotenv->loadEnv(__DIR__.'/.env');
7676

77-
The ``Dotenv`` component will then look for the correct ``.env`` file to load
78-
in the following order::
77+
The Dotenv component will then look for the correct ``.env`` file to load
78+
in the following order whereas the files loaded later override the variables
79+
defined in previously loaded files::
7980

80-
1. If ``.env`` exists, it is loaded first. In case there's no ``.env`` file but a
81+
#. If ``.env`` exists, it is loaded first. In case there's no ``.env`` file but a
8182
``.env.dist``, this one will be loaded instead.
82-
2. If one of the previously mentioned files contains the ``APP_ENV`` variable, the
83+
#. If one of the previously mentioned files contains the ``APP_ENV`` variable, the
8384
variable is populated and used to load environment-specific files hereafter. If
8485
``APP_ENV`` is not defined in either of the previously mentioned files, ``dev`` is
8586
assumed for ``APP_ENV`` and populated by default.
86-
3. If there's a ``.env.$env.local`` file, this one is loaded. Otherwise, it falls
87+
#. If there's a ``.env.$env.local`` file, this one is loaded. Otherwise, it falls
8788
back to ``.env.$env``.
88-
4. If there's a ``.env.local`` it's loaded last.
89+
#. If there's a ``.env.local`` it's loaded last.
8990

9091
This might look complicated at first glance but it gives you the opportunity to commit
9192
multiple environment-specific files that can then be adjusted to your local environment
@@ -100,7 +101,7 @@ configuration settings for your environments, each of them can be adjusted by us
100101

101102
You can adjust the variable defining the environment, default environment and test
102103
environments by passing them as additional arguments to ``Dotenv::loadEnv()``
103-
(see :method:`Symfony\Component\Dotenv::loadEnv` for details).
104+
(see :method:`Symfony\\Component\\Dotenv::loadEnv` for details).
104105

105106
.. versionadded:: 4.2
106107
The ``Dotenv::loadEnv()`` method was introduced in Symfony 4.2.

0 commit comments

Comments
 (0)
0