Skip to content

Commit 53b9cee

Browse files
committed
minor #16416 Update configuration.rst and deployment.rst for dotenv:dump command (mertingen)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- Update configuration.rst and deployment.rst for dotenv:dump command It changes from "composer dump-env prod" to "php bin/console dotenv:dump prod" Commits ------- 6da9f16 Update configuration.rst and deployment.rst for dotenv:dump command
2 parents cab866a + 6da9f16 commit 53b9cee

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

configuration.rst

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

829-
To improve performance, you can optionally run the ``dump-env`` command (available
830-
in :ref:`Symfony Flex <symfony-flex>` 1.2 or later):
829+
To improve performance, you can optionally run the ``dotenv:dump`` command (available
830+
in :ref:`Symfony Flex <symfony-flex>` 1.2 or later). The command is not registered by default.
831+
In order to enable it, you must add it to their services.yaml file:
832+
833+
.. code-block:: yaml
834+
835+
services:
836+
Symfony\Component\Dotenv\Command\DotenvDumpCommand:
837+
- '%kernel.project_dir%/.env'
838+
- '%kernel.environment%'
839+
840+
On PHP >= 8, the two arguments can be removed when autoconfiguration is enabled (which is the default):
841+
842+
.. code-block:: yaml
843+
844+
services:
845+
Symfony\Component\Dotenv\Command\DotenvDumpCommand: ~
846+
847+
Running command:
831848

832849
.. code-block:: terminal
833850
834851
# parses ALL .env files and dumps their final values to .env.local.php
835-
$ composer dump-env prod
852+
$ php bin/console dotenv:dump prod
836853
837854
After running this command, Symfony will load the ``.env.local.php`` file to
838855
get the environment variables and will not spend time parsing the ``.env`` files.

deployment.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ most natural in your hosting environment.
154154

155155
.. code-block:: terminal
156156
157-
$ composer dump-env prod
157+
$ php bin/console dotenv:dump prod
158158
159-
The generated file will contain all the configuration stored in ``.env``. If you
159+
The generated file will contain all the configurations stored in ``.env``. If you
160160
want to rely only on environment variables, generate one without any values using:
161161

162162
.. code-block:: terminal
163163
164-
$ composer dump-env prod --empty
164+
$ php bin/console dotenv:dump prod --empty
165165
166166
C) Install/Update your Vendors
167167
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)