1- Symfony Flex Recipes
2- ====================
1+ Symfony Recipes
2+ ===============
33
4- `Symfony Flex `_ is the new way to manage dependencies in Symfony applications.
5- One of its main features is the automatic installation, configuration and
6- removal of dependencies. This automation is possible thanks to the **Symfony Flex
7- Recipes **.
4+ Symfony recipes allow the automation of Composer packages configuration via the
5+ `Symfony Flex `_ Composer plugin.
86
9- Creating Flex Recipes
10- ---------------------
7+ Creating Recipes
8+ ----------------
119
12- Symfony Flex recipes consist of a ``manifest.json `` config file and, optionally,
13- any number of files and directories. Recipes must be stored on their own
10+ Symfony recipes consist of a ``manifest.json `` config file and, optionally, any
11+ number of files and directories. Recipes must be stored on their own
1412repositories, outside of your Composer package repository. They must follow the
1513``vendor/package/version/ `` directory structure, where ``version `` is the
1614minimum version supported by the recipe.
@@ -81,12 +79,12 @@ Configurators
8179Recipes define the different tasks executed when installing a dependency, such
8280as running commands, copying files or adding new environment variables. Recipes
8381only contain the tasks needed to install and configure the dependency because
84- Symfony Flex is smart enough to reverse those tasks when uninstalling and
82+ Symfony is smart enough to reverse those tasks when uninstalling and
8583unconfiguring the dependencies.
8684
87- Symfony Flex provides eight types of tasks, which are called **configurators **:
88- ``copy-from-recipe ``, ``copy-from-package ``, ``bundles ``, ``env ``, `` makefile ``,
89- ``composer-scripts ``, ``gitignore ``, and ``post-install-output ``.
85+ There are eight types of tasks, which are called **configurators **:
86+ ``copy-from-recipe ``, ``copy-from-package ``, ``bundles ``, ``env ``,
87+ ``makefile ``, `` composer-scripts ``, ``gitignore ``, and ``post-install-output ``.
9088
9189``bundles `` Configurator
9290~~~~~~~~~~~~~~~~~~~~~~~~
@@ -106,7 +104,7 @@ enabled. The supported environments are ``dev``, ``prod``, ``test`` and ``all``
106104 }
107105 }
108106
109- The previous recipe is transformed by Symfony Flex into the following PHP code:
107+ The previous recipe is transformed into the following PHP code:
110108
111109.. code-block :: php
112110
@@ -151,7 +149,7 @@ section of your ``composer.json`` file:
151149 }
152150 }
153151
154- Now you can use ``%MY_SPECIAL_DIR% `` in your Symfony Flex recipes.
152+ Now you can use ``%MY_SPECIAL_DIR% `` in your recipes.
155153
156154``copy-from-recipe `` Configurator
157155~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -183,7 +181,7 @@ files stored in the root of the Symfony project:
183181 }
184182 }
185183
186- Symfony Flex turns that recipe into the following content appended to the ``.env ``
184+ This recipe is converted into the following content appended to the ``.env ``
187185and ``.env.dist `` files:
188186
189187.. code-block :: bash
@@ -193,17 +191,17 @@ and ``.env.dist`` files:
193191 APP_DEBUG=1
194192 # ##< your-recipe-name-here ###
195193
196- The ``###> your-recipe-name-here ### `` section separators are needed by
197- Symfony Flex to detect the contents added by this dependency in case you
198- uninstall it later. Don't remove or modify these separators.
194+ The ``###> your-recipe-name-here ### `` section separators are needed by Symfony
195+ to detect the contents added by this dependency in case you uninstall it later.
196+ Don't remove or modify these separators.
199197
200198``makefile `` Configurator
201199~~~~~~~~~~~~~~~~~~~~~~~~~
202200
203201Adds new tasks to the ``Makefile `` file stored in the root of the Symfony
204202project. Unlike other configurators, there is no specific entry in the manifest
205203file. Define tasks by creating a ``Makefile `` file at the root of the recipe
206- directory (Symfony Flex adds a ``PHP_EOL `` character after each line).
204+ directory (a ``PHP_EOL `` character is added after each line).
207205
208206Similar to the ``env `` configurator, the contents are copied into the ``Makefile ``
209207file and wrapped with section separators (``###> your-recipe-name-here ### ``)
@@ -233,8 +231,8 @@ script (``php-script`` for PHP scripts, ``script`` for any shell script and
233231~~~~~~~~~~~~~~~~~~~~~~~~~~
234232
235233Adds patterns to the ``.gitignore `` file of the Symfony project. Define those
236- patterns as a simple array of strings (Symfony Flex adds a ``PHP_EOL `` character
237- after each line):
234+ patterns as a simple array of strings (a ``PHP_EOL `` character is added after
235+ each line):
238236
239237.. code-block :: json
240238
@@ -258,8 +256,8 @@ Displays contents in the command console after the package has been installed.
258256Avoid outputting meaningless information and use it only when you need to show
259257help messages or the next step actions.
260258
261- The contents must be defined in a file named ``post-install.txt `` (Symfony Flex
262- adds a ``PHP_EOL `` character after each line). `Symfony Console styles and
259+ The contents must be defined in a file named ``post-install.txt `` (a
260+ ``PHP_EOL `` character is added after each line). `Symfony Console styles and
263261colors `_ are supported too:
264262
265263.. code-block :: text
0 commit comments