@@ -485,48 +485,44 @@ You can reference environment variables using the special syntax
485
485
``%env(ENV_VAR_NAME)% ``. The values of these options are resolved at runtime
486
486
(only once per request, to not impact performance).
487
487
488
- This example shows how you could configure the database connection using an env var:
488
+ This example shows how you could configure the application secret using an env var:
489
489
490
490
.. configuration-block ::
491
491
492
492
.. code-block :: yaml
493
493
494
- # config/packages/doctrine.yaml
495
- doctrine :
496
- dbal :
497
- # by convention the env var names are always uppercase
498
- url : ' %env(DATABASE_URL)%'
494
+ # config/packages/framework.yaml
495
+ framework :
496
+ # by convention the env var names are always uppercase
497
+ secret : ' %env(APP_SECRET)%'
499
498
# ...
500
499
501
500
.. code-block :: xml
502
501
503
- <!-- config/packages/doctrine .xml -->
502
+ <!-- config/packages/framework .xml -->
504
503
<?xml version =" 1.0" encoding =" UTF-8" ?>
505
504
<container xmlns =" http://symfony.com/schema/dic/services"
506
505
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
507
- xmlns : doctrine =" http://symfony.com/schema/dic/doctrine"
508
506
xsi : schemaLocation =" http://symfony.com/schema/dic/services
509
- https://symfony.com/schema/dic/services/services-1.0.xsd
510
- http://symfony.com/schema/dic/doctrine
511
- https://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd" >
507
+ https://symfony.com/schema/dic/services/services-1.0.xsd>
512
508
513
- <doctrine : config >
509
+ <framework :config>
514
510
<!-- by convention the env var names are always uppercase -->
515
- <doctrine : dbal url =" %env(resolve:DATABASE_URL )%" />
516
- </doctrine : config >
511
+ <framework:secret url=" %env(APP_SECRET )%" />
512
+ </framework :config>
517
513
518
514
</container>
519
515
520
516
.. code-block:: php
521
517
522
- // config/packages/doctrine .php
518
+ // config/packages/framework .php
523
519
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
524
520
525
521
return static function (ContainerConfigurator $container) {
526
- $container->extension('doctrine ', [
527
- 'dbal ' => [
522
+ $container->extension('framework ', [
523
+ 'secret ' => [
528
524
// by convention the env var names are always uppercase
529
- 'url' => '%env(resolve:DATABASE_URL )%',
525
+ 'url' => '%env(APP_SECRET )%',
530
526
],
531
527
]);
532
528
};
0 commit comments