diff --git a/configuration.rst b/configuration.rst index cd2a920f05b..0335ea6edb2 100644 --- a/configuration.rst +++ b/configuration.rst @@ -605,51 +605,42 @@ The values of these options are resolved at runtime (only once per request, to not impact performance) so you can change the application behavior without having to clear the cache. -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 - + + http://symfony.com/schema/dic/symfony + 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 $containerConfigurator) { - $containerConfigurator->extension('doctrine', [ - 'dbal' => [ - // by convention the env var names are always uppercase - 'url' => env('DATABASE_URL')->resolve(), - // or - 'url' => '%env(resolve:DATABASE_URL)%', - ], + $container->extension('framework', [ + 'secret' => '%env(APP_SECRET)%', ]); };