@@ -95,8 +95,10 @@ Symfony is smart enough to reverse those tasks when uninstalling and
95
95
unconfiguring the dependencies.
96
96
97
97
There are several types of tasks, which are called **configurators **:
98
- ``copy-from-recipe ``, ``copy-from-package ``, ``bundles ``, ``env ``, ``container ``
99
- ``composer-scripts ``, ``gitignore ``, and ``post-install-output ``.
98
+ ``bundles ``, ``container ``, ``copy-from-recipe ``, ``copy-from-package ``, ``env ``,
99
+ ``dotenv ``, ``makefile ``, ``composer-scripts ``, ``composer-commands ``,
100
+ ``gitignore ``, ``dockerfile ``, ``docker-compose ``, ``add-lines ``,
101
+ and ``post-install-output ``.
100
102
101
103
``bundles `` Configurator
102
104
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -246,6 +248,43 @@ Don't remove or modify these separators.
246
248
Use ``%generate(secret)% `` as the value of any environment variable to
247
249
replace it with a cryptographically secure random value of 16 bytes.
248
250
251
+ ``dotenv `` Configurator
252
+ ~~~~~~~~~~~~~~~~~~~~~~~
253
+
254
+ Very similar to the ``env `` configurator but allows targeting a specific dotenv
255
+ file instead of just ``.env ``.
256
+
257
+ .. code-block :: json
258
+
259
+ {
260
+ "dotenv" : {
261
+ "local" : {
262
+ "SOME_VAR" : " value"
263
+ }
264
+ }
265
+ }
266
+
267
+ This recipe is converted into the following content appended to the
268
+ ``.env.local `` file:
269
+
270
+ .. code-block :: bash
271
+
272
+ # ##> your-recipe-name-here ###
273
+ SOME_VAR=value
274
+ # ##< your-recipe-name-here ###
275
+
276
+ ``makefile `` Configurator
277
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
278
+
279
+ Adds new tasks to the ``Makefile `` file stored in the root of the Symfony
280
+ project. Unlike other configurators, there is no specific entry in the manifest
281
+ file. Define tasks by creating a ``Makefile `` file at the root of the recipe
282
+ directory (a ``PHP_EOL `` character is added after each line).
283
+
284
+ Similar to the ``env `` configurator, the contents are copied into the ``Makefile ``
285
+ file and wrapped with section separators (``###> your-recipe-name-here ### ``)
286
+ that must not be removed or modified.
287
+
249
288
``composer-scripts `` Configurator
250
289
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
251
290
@@ -266,6 +305,54 @@ script (``php-script`` for PHP scripts, ``script`` for any shell script and
266
305
}
267
306
}
268
307
308
+ ``composer-commands `` Configurator
309
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310
+
311
+ Registers scripts in the ``scripts `` section of the ``composer.json `` file
312
+ to execute them manually when running ``composer run the-command ``:
313
+
314
+ .. code-block :: json
315
+
316
+ {
317
+ "composer-commands" : {
318
+ "test" : " bin/phpunit"
319
+ }
320
+ }
321
+
322
+ See the `Composer documentation `_ for more information about the
323
+ ``scripts `` section of the ``composer.json `` file.
324
+
325
+ ``dockerfile `` Configurator
326
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
327
+
328
+ Adds command lines to the ``Dockerfile ``:
329
+
330
+ .. code-block :: json
331
+
332
+ {
333
+ "dockerfile" : [
334
+ " RUN install-php-extensions pdo_pgsql"
335
+ ]
336
+ }
337
+
338
+ ``docker-compose `` Configurator
339
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
340
+
341
+ Adds lines to the main entries of docker compose files:
342
+
343
+ .. code-block :: json
344
+
345
+ {
346
+ "docker-compose" : {
347
+ "compose.yml" : {
348
+ "services" : [
349
+ " database:" ,
350
+ " image: postgres:${POSTGRES_VERSION:-16}-alpine" ,
351
+ ]
352
+ }
353
+ }
354
+ }
355
+
269
356
``gitignore `` Configurator
270
357
~~~~~~~~~~~~~~~~~~~~~~~~~~
271
358
@@ -418,3 +505,4 @@ one used by ``symfony/framework-bundle``:
418
505
.. _`contrib repository` : https://github.com/symfony/recipes-contrib
419
506
.. _`Symfony Console styles and colors` : https://symfony.com/doc/current/console/coloring.html
420
507
.. _`RECIPES.md` : https://github.com/symfony/recipes/blob/flex/main/RECIPES.md
508
+ .. _`Composer documentation` : https://getcomposer.org/doc/articles/scripts.md#defining-scripts
0 commit comments