Skip to content

Commit cbbae8a

Browse files
committed
Merge branch '4.4'
* 4.4: [Dotenv] Added a note about the order of env vars
2 parents 9d464c0 + 07c50d0 commit cbbae8a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/dotenv.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ Use environment variables in values by prefixing variables with ``$``:
137137
DB_USER=root
138138
DB_PASS=${DB_USER}pass # Include the user as a password prefix
139139
140+
.. note::
141+
142+
The order is important when some env var depends on the value of other env
143+
vars. In the above example, ``DB_PASS`` must be defined after ``DB_USER``.
144+
Moreover, if you define multiple ``.env`` files and put ``DB_PASS`` first,
145+
its value will depend on the ``DB_USER`` value defined in other files
146+
instead of the value defined in this file.
147+
140148
Embed commands via ``$()`` (not supported on Windows):
141149

142150
.. code-block:: terminal

0 commit comments

Comments
 (0)