Skip to content

Commit f23e20a

Browse files
committed
Merge branch '6.2' into 6.3
* 6.2: Tweak Simplify configuration env var example
2 parents 992b0a3 + 47abf43 commit f23e20a

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
@@ -589,51 +589,44 @@ The values of these options are resolved at runtime (only once per request, to
589589
not impact performance) so you can change the application behavior without having
590590
to clear the cache.
591591

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

594594
.. configuration-block::
595595

596596
.. code-block:: yaml
597597
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)%'
603602
# ...
604603
605604
.. code-block:: xml
606605
607-
<!-- config/packages/doctrine.xml -->
606+
<!-- config/packages/framework.xml -->
608607
<?xml version="1.0" encoding="UTF-8" ?>
609608
<container xmlns="http://symfony.com/schema/dic/services"
610609
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"
612611
xsi:schemaLocation="http://symfony.com/schema/dic/services
613612
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">
616615
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)%"/>
621618
622619
</container>
623620
624621
.. code-block:: php
625622
626-
// config/packages/doctrine.php
623+
// config/packages/framework.php
627624
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
628625
629626
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)%',
637630
]);
638631
};
639632

0 commit comments

Comments
 (0)