Skip to content

Commit 115a567

Browse files
committed
minor #7224 Mentioned %env(...)% variables in Best Practices book (javiereguiluz)
This PR was merged into the 3.2 branch. Discussion ---------- Mentioned %env(...)% variables in Best Practices book Commits ------- 91096ec Mentioned %env(...)% variables in Best Practices book
2 parents 41daca8 + 91096ec commit 115a567

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

best_practices/configuration.rst

+14-2
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,20 @@ Moving Sensitive Options Outside of Symfony Entirely
175175

176176
When dealing with sensitive options, like database credentials, we also recommend
177177
that you store them outside the Symfony project and make them available
178-
through environment variables. Learn how to do it in the following article:
179-
:doc:`/configuration/external_parameters`.
178+
through environment variables:
179+
180+
.. code-block:: yaml
181+
182+
# app/config/config.yml
183+
doctrine:
184+
dbal:
185+
# ...
186+
password: "%env(DB_PASSWORD)%"
187+
188+
.. versionadded:: 3.2
189+
Support for runtime environment variables via the ``%env(...)%`` syntax was
190+
added in Symfony 3.2. Prior to version 3.2, you needed to use the
191+
:doc:`special SYMFONY__ variables </configuration/external_parameters>`.
180192

181193
.. _`feature toggles`: https://en.wikipedia.org/wiki/Feature_toggle
182194
.. _`constant() function`: http://twig.sensiolabs.org/doc/functions/constant.html

0 commit comments

Comments
 (0)