From 9581c06f0d0e7dc1f3a221e9ef3076349319f385 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Tue, 30 Jul 2019 17:23:55 +0200 Subject: [PATCH] [Configuration] Simplified how default env vars are defined --- configuration.rst | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/configuration.rst b/configuration.rst index b2d9decda7d..18e90c9ed0b 100644 --- a/configuration.rst +++ b/configuration.rst @@ -407,33 +407,12 @@ This example shows how to configure the database connection using an env var: The next step is to define the value of those env vars in your shell, your web server, etc. This is explained in the following sections, but to protect your application from undefined env vars, you can give them a default value using the -``parameters`` key: +``.env`` file: -.. configuration-block:: - - .. code-block:: yaml - - # config/services.yaml - parameters: - env(DATABASE_URL): 'sqlite:///%kernel.project_dir%/var/data.db' - - .. code-block:: xml - - - - - - - sqlite:///%kernel.project_dir%/var/data.db - - - - .. code-block:: php +.. code-block:: bash - // config/services.php - $container->setParameter('env(DATABASE_URL)', 'sqlite:///%kernel.project_dir%/var/data.db'); + # .env + DATABASE_URL=sqlite:///%kernel.project_dir%/var/data.db .. seealso::