File tree 1 file changed +4
-25
lines changed 1 file changed +4
-25
lines changed Original file line number Diff line number Diff line change @@ -407,33 +407,12 @@ This example shows how to configure the database connection using an env var:
407
407
The next step is to define the value of those env vars in your shell, your web
408
408
server, etc. This is explained in the following sections, but to protect your
409
409
application from undefined env vars, you can give them a default value using the
410
- ``parameters `` key :
410
+ ``.env `` file :
411
411
412
- .. configuration-block ::
413
-
414
- .. code-block :: yaml
415
-
416
- # config/services.yaml
417
- parameters :
418
- env(DATABASE_URL) : ' sqlite:///%kernel.project_dir%/var/data.db'
419
-
420
- .. code-block :: xml
421
-
422
- <!-- config/services.xml -->
423
- <?xml version =" 1.0" encoding =" UTF-8" ?>
424
- <container xmlns =" http://symfony.com/schema/dic/services"
425
- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
426
- xsi : schemaLocation =" http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd" >
427
-
428
- <parameters >
429
- <parameter key =" env(DATABASE_URL)" >sqlite:///%kernel.project_dir%/var/data.db</parameter >
430
- </parameters >
431
- </container >
432
-
433
- .. code-block :: php
412
+ .. code-block :: bash
434
413
435
- // config/services.php
436
- $container->setParameter('env( DATABASE_URL)', ' sqlite:///%kernel.project_dir%/var/data.db');
414
+ # .env (or .env.local)
415
+ DATABASE_URL= sqlite:///%kernel.project_dir%/var/data.db
437
416
438
417
.. seealso ::
439
418
You can’t perform that action at this time.
0 commit comments