Skip to content

Commit 91096ec

Browse files
committed
Mentioned %env(...)% variables in Best Practices book
1 parent f415141 commit 91096ec

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

best_practices/configuration.rst

Lines changed: 14 additions & 2 deletions
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)