Skip to content

Commit e4799d5

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: Update configuration.rst and deployment.rst for dotenv:dump command
2 parents d1dc850 + 5954eb2 commit e4799d5

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

configuration.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -835,13 +835,33 @@ In production, the ``.env`` files are also parsed and loaded on each request. So
835835
the easiest way to define env vars is by creating a ``.env.local`` file on your
836836
production server(s) with your production values.
837837

838-
To improve performance, you can optionally run the ``dump-env`` command (available
839-
in :ref:`Symfony Flex <symfony-flex>` 1.2 or later):
838+
To improve performance, you can optionally run the ``dotenv:dump`` command (available
839+
in :ref:`Symfony Flex <symfony-flex>` 1.2 or later). The command is not registered
840+
by default, so you must register first in your services:
841+
842+
.. code-block:: yaml
843+
844+
# config/services.yaml
845+
services:
846+
Symfony\Component\Dotenv\Command\DotenvDumpCommand:
847+
- '%kernel.project_dir%/.env'
848+
- '%kernel.environment%'
849+
850+
In PHP >= 8, you can remove the the two arguments when autoconfiguration is enabled
851+
(which is the default):
852+
853+
.. code-block:: yaml
854+
855+
# config/services.yaml
856+
services:
857+
Symfony\Component\Dotenv\Command\DotenvDumpCommand: ~
858+
859+
Then, run the command:
840860

841861
.. code-block:: terminal
842862
843863
# parses ALL .env files and dumps their final values to .env.local.php
844-
$ composer dump-env prod
864+
$ APP_ENV=prod APP_DEBUG=0 php bin/console dotenv:dump
845865
846866
After running this command, Symfony will load the ``.env.local.php`` file to
847867
get the environment variables and will not spend time parsing the ``.env`` files.

deployment.rst

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,8 @@ most natural in your hosting environment.
163163
164164
$ composer dump-env prod --empty
165165
166-
If ``composer`` is not installed on your server, you can generate this optimized
167-
file with a command provided by Symfony itself, which you must register in
168-
your application before using it:
169-
170-
.. code-block:: yaml
171-
172-
# config/services.yaml
173-
services:
174-
Symfony\Component\Dotenv\Command\DotenvDumpCommand: ~
175-
176-
.. code-block:: terminal
177-
178-
$ APP_ENV=prod APP_DEBUG=0 php bin/console dotenv:dump
166+
If you don't have Composer installed on the production server, use instead
167+
:ref:`the dotenv:dump Symfony command <configuration-env-var-in-prod>`.
179168

180169
C) Install/Update your Vendors
181170
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy