@@ -605,51 +605,43 @@ 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 :
614
+ # config/packages/framework .yaml
615
+ framework :
616
616
dbal :
617
617
# by convention the env var names are always uppercase
618
- url : ' %env(resolve:DATABASE_URL )%'
618
+ secret : ' %env(APP_SECRET )%'
619
619
# ...
620
620
621
621
.. code-block :: xml
622
622
623
- <!-- config/packages/doctrine .xml -->
623
+ <!-- config/packages/framework .xml -->
624
624
<?xml version =" 1.0" encoding =" UTF-8" ?>
625
625
<container xmlns =" http://symfony.com/schema/dic/services"
626
626
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
627
- xmlns : doctrine =" http://symfony.com/schema/dic/doctrine "
627
+ xmlns : framework =" http://symfony.com/schema/dic/framework "
628
628
xsi : schemaLocation =" http://symfony.com/schema/dic/services
629
629
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" >
630
+ http://symfony.com/schema/dic/symfony
631
+ https://symfony.com/schema/dic/symfony/symfony -1.0.xsd" >
632
632
633
- <doctrine : config >
634
- <!-- by convention the env var names are always uppercase -->
635
- <doctrine : dbal url =" %env(resolve:DATABASE_URL)%" />
636
- </doctrine : config >
633
+ <framework : config secret =" %env(APP_SECRET)%" />
637
634
638
635
</container >
639
636
640
637
.. code-block :: php
641
638
642
- // config/packages/doctrine .php
639
+ // config/packages/framework .php
643
640
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
644
641
645
642
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
- ],
643
+ $container->extension('framework', [
644
+ 'secret' => '%env(APP_SECRET)%',
653
645
]);
654
646
};
655
647
0 commit comments