@@ -578,51 +578,44 @@ The values of these options are resolved at runtime (only once per request, to
578
578
not impact performance) so you can change the application behavior without having
579
579
to clear the cache.
580
580
581
- This example shows how you could configure the database connection using an env var:
581
+ This example shows how you could configure the application secret using an env var:
582
582
583
583
.. configuration-block ::
584
584
585
585
.. code-block :: yaml
586
586
587
- # config/packages/doctrine.yaml
588
- doctrine :
589
- dbal :
590
- # by convention the env var names are always uppercase
591
- url : ' %env(resolve:DATABASE_URL)%'
587
+ # config/packages/framework.yaml
588
+ framework :
589
+ # by convention the env var names are always uppercase
590
+ secret : ' %env(APP_SECRET)%'
592
591
# ...
593
592
594
593
.. code-block :: xml
595
594
596
- <!-- config/packages/doctrine .xml -->
595
+ <!-- config/packages/framework .xml -->
597
596
<?xml version =" 1.0" encoding =" UTF-8" ?>
598
597
<container xmlns =" http://symfony.com/schema/dic/services"
599
598
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
600
- xmlns : doctrine =" http://symfony.com/schema/dic/doctrine "
599
+ xmlns : framework =" http://symfony.com/schema/dic/framework "
601
600
xsi : schemaLocation =" http://symfony.com/schema/dic/services
602
601
https://symfony.com/schema/dic/services/services-1.0.xsd
603
- http://symfony.com/schema/dic/doctrine
604
- https://symfony.com/schema/dic/doctrine/doctrine -1.0.xsd" >
602
+ http://symfony.com/schema/dic/symfony
603
+ https://symfony.com/schema/dic/symfony/symfony -1.0.xsd" >
605
604
606
- <doctrine : config >
607
- <!-- by convention the env var names are always uppercase -->
608
- <doctrine : dbal url =" %env(resolve:DATABASE_URL)%" />
609
- </doctrine : config >
605
+ <!-- by convention the env var names are always uppercase -->
606
+ <framework : config secret =" %env(APP_SECRET)%" />
610
607
611
608
</container >
612
609
613
610
.. code-block :: php
614
611
615
- // config/packages/doctrine .php
612
+ // config/packages/framework .php
616
613
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
617
614
618
615
return static function (ContainerConfigurator $containerConfigurator) {
619
- $containerConfigurator->extension('doctrine', [
620
- 'dbal' => [
621
- // by convention the env var names are always uppercase
622
- 'url' => env('DATABASE_URL')->resolve(),
623
- // or
624
- 'url' => '%env(resolve:DATABASE_URL)%',
625
- ],
616
+ $container->extension('framework', [
617
+ // by convention the env var names are always uppercase
618
+ 'secret' => '%env(APP_SECRET)%',
626
619
]);
627
620
};
628
621
0 commit comments