Skip to content

Commit e60ec9b

Browse files
committed
Merge branch '4.3' into 4.4
* 4.3: [Configuration] Simplified how default env vars are defined
2 parents e4799a2 + 1ce3b45 commit e60ec9b

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

configuration.rst

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -488,33 +488,12 @@ This example shows how to configure the database connection using an env var:
488488
The next step is to define the value of those env vars in your shell, your web
489489
server, etc. This is explained in the following sections, but to protect your
490490
application from undefined env vars, you can give them a default value using the
491-
``parameters`` key:
491+
``.env`` file:
492492

493-
.. configuration-block::
494-
495-
.. code-block:: yaml
496-
497-
# config/services.yaml
498-
parameters:
499-
env(DATABASE_URL): 'sqlite:///%kernel.project_dir%/var/data.db'
500-
501-
.. code-block:: xml
502-
503-
<!-- config/services.xml -->
504-
<?xml version="1.0" encoding="UTF-8" ?>
505-
<container xmlns="http://symfony.com/schema/dic/services"
506-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
507-
xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">
508-
509-
<parameters>
510-
<parameter key="env(DATABASE_URL)">sqlite:///%kernel.project_dir%/var/data.db</parameter>
511-
</parameters>
512-
</container>
513-
514-
.. code-block:: php
493+
.. code-block:: bash
515494
516-
// config/services.php
517-
$container->setParameter('env(DATABASE_URL)', 'sqlite:///%kernel.project_dir%/var/data.db');
495+
# .env
496+
DATABASE_URL=sqlite:///%kernel.project_dir%/var/data.db
518497
519498
.. seealso::
520499

0 commit comments

Comments
 (0)