Skip to content

Commit 4934f61

Browse files
authored
Update configuration.rst for dotenv command
It explains how can they register dotenv command and run it properly
1 parent 9f427b9 commit 4934f61

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

configuration.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,24 @@ the easiest way to define env vars is by deploying a ``.env.local`` file to your
773773
production server(s) with your production values.
774774

775775
To improve performance, you can optionally run the ``dotenv:dump`` command (available
776-
in :ref:`Symfony Flex <symfony-flex>` 1.2 or later):
776+
in :ref:`Symfony Flex <symfony-flex>` 1.2 or later). The command is not registered by default.
777+
In order to enable it, you must add it to their services.yaml file:
778+
779+
.. code-block:: yaml
780+
781+
services:
782+
Symfony\Component\Dotenv\Command\DotenvDumpCommand:
783+
- '%kernel.project_dir%/.env'
784+
- '%kernel.environment%'
785+
786+
On PHP >= 8, the two arguments can be removed when autoconfiguration is enabled (which is the default):
787+
788+
.. code-block:: yaml
789+
790+
services:
791+
Symfony\Component\Dotenv\Command\DotenvDumpCommand: ~
792+
793+
Running command:
777794

778795
.. code-block:: terminal
779796

0 commit comments

Comments
 (0)