Skip to content

Commit 4f92726

Browse files
committed
Reword with simpler example
1 parent 441939f commit 4f92726

File tree

1 file changed

+14
-18
lines changed

1 file changed

+14
-18
lines changed

configuration.rst

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -485,48 +485,44 @@ You can reference environment variables using the special syntax
485485
``%env(ENV_VAR_NAME)%``. The values of these options are resolved at runtime
486486
(only once per request, to not impact performance).
487487

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:
489489

490490
.. configuration-block::
491491

492492
.. code-block:: yaml
493493
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)%'
499498
# ...
500499
501500
.. code-block:: xml
502501
503-
<!-- config/packages/doctrine.xml -->
502+
<!-- config/packages/framework.xml -->
504503
<?xml version="1.0" encoding="UTF-8" ?>
505504
<container xmlns="http://symfony.com/schema/dic/services"
506505
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
507-
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
508506
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>
512508
513-
<doctrine:config>
509+
<framework:config>
514510
<!-- 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>
517513
518514
</container>
519515
520516
.. code-block:: php
521517
522-
// config/packages/doctrine.php
518+
// config/packages/framework.php
523519
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
524520
525521
return static function (ContainerConfigurator $container) {
526-
$container->extension('doctrine', [
527-
'dbal' => [
522+
$container->extension('framework', [
523+
'secret' => [
528524
// by convention the env var names are always uppercase
529-
'url' => '%env(resolve:DATABASE_URL)%',
525+
'url' => '%env(APP_SECRET)%',
530526
],
531527
]);
532528
};

0 commit comments

Comments
 (0)