diff --git a/configuration.rst b/configuration.rst index 358fb903de2..e7e44eb9111 100644 --- a/configuration.rst +++ b/configuration.rst @@ -485,48 +485,42 @@ 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(resolve: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/symfony/symfony-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)%', + 'secret' => '%env(APP_SECRET)%', ], ]); };