Skip to content

Commit 07c50d0

Browse files
committed
Merge branch '4.3' into 4.4
* 4.3: [Dotenv] Added a note about the order of env vars
2 parents e60ec9b + 0dcf0cb commit 07c50d0

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
@@ -141,6 +141,14 @@ Use environment variables in values by prefixing variables with ``$``:
141141
DB_USER=root
142142
DB_PASS=${DB_USER}pass # Include the user as a password prefix
143143
144+
.. note::
145+
146+
The order is important when some env var depends on the value of other env
147+
vars. In the above example, ``DB_PASS`` must be defined after ``DB_USER``.
148+
Moreover, if you define multiple ``.env`` files and put ``DB_PASS`` first,
149+
its value will depend on the ``DB_USER`` value defined in other files
150+
instead of the value defined in this file.
151+
144152
Embed commands via ``$()`` (not supported on Windows):
145153

146154
.. code-block:: terminal

0 commit comments

Comments
 (0)