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