From 91096ece6753b447872d4cf8c17a77edd0ce8558 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 5 Dec 2016 13:19:40 +0100 Subject: [PATCH] Mentioned %env(...)% variables in Best Practices book --- best_practices/configuration.rst | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/best_practices/configuration.rst b/best_practices/configuration.rst index 3fcb46bf586..f080d47bc86 100644 --- a/best_practices/configuration.rst +++ b/best_practices/configuration.rst @@ -175,8 +175,20 @@ Moving Sensitive Options Outside of Symfony Entirely When dealing with sensitive options, like database credentials, we also recommend that you store them outside the Symfony project and make them available -through environment variables. Learn how to do it in the following article: -:doc:`/configuration/external_parameters`. +through environment variables: + +.. code-block:: yaml + + # app/config/config.yml + doctrine: + dbal: + # ... + password: "%env(DB_PASSWORD)%" + +.. versionadded:: 3.2 + Support for runtime environment variables via the ``%env(...)%`` syntax was + added in Symfony 3.2. Prior to version 3.2, you needed to use the + :doc:`special SYMFONY__ variables `. .. _`feature toggles`: https://en.wikipedia.org/wiki/Feature_toggle .. _`constant() function`: http://twig.sensiolabs.org/doc/functions/constant.html