1
- Symfony Flex Recipes
2
- ====================
1
+ Symfony Recipes
2
+ ===============
3
3
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.
8
6
9
- Creating Flex Recipes
10
- ---------------------
7
+ Creating Recipes
8
+ ----------------
11
9
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
14
12
repositories, outside of your Composer package repository. They must follow the
15
13
``vendor/package/version/ `` directory structure, where ``version `` is the
16
14
minimum version supported by the recipe.
@@ -81,12 +79,12 @@ Configurators
81
79
Recipes define the different tasks executed when installing a dependency, such
82
80
as running commands, copying files or adding new environment variables. Recipes
83
81
only 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
85
83
unconfiguring the dependencies.
86
84
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 ``.
90
88
91
89
``bundles `` Configurator
92
90
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -106,7 +104,7 @@ enabled. The supported environments are ``dev``, ``prod``, ``test`` and ``all``
106
104
}
107
105
}
108
106
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:
110
108
111
109
.. code-block :: php
112
110
@@ -151,7 +149,7 @@ section of your ``composer.json`` file:
151
149
}
152
150
}
153
151
154
- Now you can use ``%MY_SPECIAL_DIR% `` in your Symfony Flex recipes.
152
+ Now you can use ``%MY_SPECIAL_DIR% `` in your recipes.
155
153
156
154
``copy-from-recipe `` Configurator
157
155
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -183,7 +181,7 @@ files stored in the root of the Symfony project:
183
181
}
184
182
}
185
183
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 ``
187
185
and ``.env.dist `` files:
188
186
189
187
.. code-block :: bash
@@ -193,17 +191,17 @@ and ``.env.dist`` files:
193
191
APP_DEBUG=1
194
192
# ##< your-recipe-name-here ###
195
193
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.
199
197
200
198
``makefile `` Configurator
201
199
~~~~~~~~~~~~~~~~~~~~~~~~~
202
200
203
201
Adds new tasks to the ``Makefile `` file stored in the root of the Symfony
204
202
project. Unlike other configurators, there is no specific entry in the manifest
205
203
file. 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).
207
205
208
206
Similar to the ``env `` configurator, the contents are copied into the ``Makefile ``
209
207
file 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
233
231
~~~~~~~~~~~~~~~~~~~~~~~~~~
234
232
235
233
Adds 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):
238
236
239
237
.. code-block :: json
240
238
@@ -258,8 +256,8 @@ Displays contents in the command console after the package has been installed.
258
256
Avoid outputting meaningless information and use it only when you need to show
259
257
help messages or the next step actions.
260
258
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
263
261
colors `_ are supported too:
264
262
265
263
.. code-block :: text
0 commit comments