Skip to content

Commit 47abf43

Browse files
committed
Merge branch '5.4' into 6.2
* 5.4: Tweak Simplify configuration env var example
2 parents 63199ec + 48e1028 commit 47abf43

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

configuration.rst

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -578,51 +578,44 @@ The values of these options are resolved at runtime (only once per request, to
578578
not impact performance) so you can change the application behavior without having
579579
to clear the cache.
580580

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

583583
.. configuration-block::
584584

585585
.. code-block:: yaml
586586
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)%'
592591
# ...
593592
594593
.. code-block:: xml
595594
596-
<!-- config/packages/doctrine.xml -->
595+
<!-- config/packages/framework.xml -->
597596
<?xml version="1.0" encoding="UTF-8" ?>
598597
<container xmlns="http://symfony.com/schema/dic/services"
599598
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"
601600
xsi:schemaLocation="http://symfony.com/schema/dic/services
602601
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">
605604
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)%"/>
610607
611608
</container>
612609
613610
.. code-block:: php
614611
615-
// config/packages/doctrine.php
612+
// config/packages/framework.php
616613
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
617614
618615
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)%',
626619
]);
627620
};
628621

0 commit comments

Comments
 (0)