Add a note about having PHP files in recipes and copying PHP files from the package

This commit is contained in:
Fabien Potencier
2022-12-30 10:30:05 +01:00
parent 0b2fc1d5cb
commit e78497b620
+11 -1
View File
@@ -150,6 +150,13 @@ Copies files or directories from the Composer package contents to the Symfony
application. It's defined as an associative array where the key is the original
file/directory and the value is the target file/directory.
.. caution::
Copying files from the package should be avoided, except for some very
specific use cases. Copying PHP files under the project's ``src/``
directory is almost always a bad idea; consider adding a command in your
bundle that is able to generate such PHP files instead.
This example copies the ``bin/check.php`` script of the package into the binary
directory of the application:
@@ -202,9 +209,12 @@ files and directories:
"copy-from-recipe": {
"config/": "%CONFIG_DIR%/",
"src/": "%SRC_DIR%/"
}
Avoid storing PHP files that should land under the ``src/`` directory; consider
adding a command in your bundle that is able to generate such PHP files
instead.
``env`` Configurator
~~~~~~~~~~~~~~~~~~~~