From 441939ff695219cf3fd7c3719d14950567c01ffb Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Mon, 7 Mar 2022 14:26:06 +0100 Subject: [PATCH 1/4] Update configuration.rst --- configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration.rst b/configuration.rst index 358fb903de2..fe0e8dbd050 100644 --- a/configuration.rst +++ b/configuration.rst @@ -495,7 +495,7 @@ This example shows how you could configure the database connection using an env doctrine: dbal: # by convention the env var names are always uppercase - url: '%env(resolve:DATABASE_URL)%' + url: '%env(DATABASE_URL)%' # ... .. code-block:: xml From 4f927269b36e61b1623dce256a8bc9f2cb5fa00c Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Fri, 22 Apr 2022 16:03:05 +0200 Subject: [PATCH 2/4] Reword with simpler example --- configuration.rst | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/configuration.rst b/configuration.rst index fe0e8dbd050..be972006d5d 100644 --- a/configuration.rst +++ b/configuration.rst @@ -485,48 +485,44 @@ You can reference environment variables using the special syntax ``%env(ENV_VAR_NAME)%``. The values of these options are resolved at runtime (only once per request, to not impact performance). -This example shows how you could configure the database connection using an env var: +This example shows how you could configure the application secret using an env var: .. configuration-block:: .. code-block:: yaml - # config/packages/doctrine.yaml - doctrine: - dbal: - # by convention the env var names are always uppercase - url: '%env(DATABASE_URL)%' + # config/packages/framework.yaml + framework: + # by convention the env var names are always uppercase + secret: '%env(APP_SECRET)%' # ... .. code-block:: xml - + + https://symfony.com/schema/dic/services/services-1.0.xsd> - + - - + + .. code-block:: php - // config/packages/doctrine.php + // config/packages/framework.php namespace Symfony\Component\DependencyInjection\Loader\Configurator; return static function (ContainerConfigurator $container) { - $container->extension('doctrine', [ - 'dbal' => [ + $container->extension('framework', [ + 'secret' => [ // by convention the env var names are always uppercase - 'url' => '%env(resolve:DATABASE_URL)%', + 'url' => '%env(APP_SECRET)%', ], ]); }; From 97f3c76ccc58bf2107e106181977138fc440ae0d Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Wed, 9 Nov 2022 16:03:59 +0100 Subject: [PATCH 3/4] reviews --- configuration.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/configuration.rst b/configuration.rst index be972006d5d..ef18c1fa09e 100644 --- a/configuration.rst +++ b/configuration.rst @@ -506,10 +506,7 @@ This example shows how you could configure the application secret using an env v xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd> - - - - + @@ -522,7 +519,7 @@ This example shows how you could configure the application secret using an env v $container->extension('framework', [ 'secret' => [ // by convention the env var names are always uppercase - 'url' => '%env(APP_SECRET)%', + 'secret' => '%env(APP_SECRET)%', ], ]); }; From d9e9b15fc6a2a301442093280bd7c3e1f8f3484c Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Wed, 9 Nov 2022 16:06:16 +0100 Subject: [PATCH 4/4] reviews --- configuration.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configuration.rst b/configuration.rst index ef18c1fa09e..e7e44eb9111 100644 --- a/configuration.rst +++ b/configuration.rst @@ -503,8 +503,9 @@ This example shows how you could configure the application secret using an env v + https://symfony.com/schema/dic/symfony/symfony-1.0.xsd>