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