@@ -605,51 +605,42 @@ The values of these options are resolved at runtime (only once per request, to
605
605
not impact performance) so you can change the application behavior without having
606
606
to clear the cache.
607
607
608
- This example shows how you could configure the database connection using an env var:
608
+ This example shows how you could configure the application secret using an env var:
609
609
610
610
.. configuration-block ::
611
611
612
612
.. code-block :: yaml
613
613
614
- # config/packages/doctrine.yaml
615
- doctrine :
616
- dbal :
617
- # by convention the env var names are always uppercase
618
- url : ' %env(resolve:DATABASE_URL)%'
614
+ # config/packages/framework.yaml
615
+ framework :
616
+ # by convention the env var names are always uppercase
617
+ secret : ' %env(APP_SECRET)%'
619
618
# ...
620
619
621
620
.. code-block :: xml
622
621
623
- <!-- config/packages/doctrine .xml -->
622
+ <!-- config/packages/framework .xml -->
624
623
<?xml version =" 1.0" encoding =" UTF-8" ?>
625
624
<container xmlns =" http://symfony.com/schema/dic/services"
626
625
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
627
- xmlns : doctrine =" http://symfony.com/schema/dic/doctrine "
626
+ xmlns : framework =" http://symfony.com/schema/dic/framework "
628
627
xsi : schemaLocation =" http://symfony.com/schema/dic/services
629
628
https://symfony.com/schema/dic/services/services-1.0.xsd
630
- http://symfony.com/schema/dic/doctrine
631
- https://symfony.com/schema/dic/doctrine/doctrine -1.0.xsd" >
629
+ http://symfony.com/schema/dic/symfony
630
+ https://symfony.com/schema/dic/symfony/symfony -1.0.xsd" >
632
631
633
- <doctrine : config >
634
- <!-- by convention the env var names are always uppercase -->
635
- <doctrine : dbal url =" %env(resolve:DATABASE_URL)%" />
636
- </doctrine : config >
632
+ <framework : config secret =" %env(APP_SECRET)%" />
637
633
638
634
</container >
639
635
640
636
.. code-block :: php
641
637
642
- // config/packages/doctrine .php
638
+ // config/packages/framework .php
643
639
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
644
640
645
641
return static function (ContainerConfigurator $containerConfigurator) {
646
- $containerConfigurator->extension('doctrine', [
647
- 'dbal' => [
648
- // by convention the env var names are always uppercase
649
- 'url' => env('DATABASE_URL')->resolve(),
650
- // or
651
- 'url' => '%env(resolve:DATABASE_URL)%',
652
- ],
642
+ $container->extension('framework', [
643
+ 'secret' => '%env(APP_SECRET)%',
653
644
]);
654
645
};
655
646
0 commit comments