From e78497b620f6e4d1eb6a983cb354bc042ead7211 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Dec 2022 10:30:05 +0100 Subject: [PATCH] Add a note about having PHP files in recipes and copying PHP files from the package --- README.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 6dccb29e..ab9249e8 100644 --- a/README.rst +++ b/README.rst @@ -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 ~~~~~~~~~~~~~~~~~~~~