From bf235eba5646f2a21510d0769492ca45a5584830 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 15 Mar 2022 12:24:35 +0100 Subject: [PATCH] Add note about plugin autoloading, refs #10587 --- doc/articles/plugins.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/articles/plugins.md b/doc/articles/plugins.md index e3df2cf95..fc017e688 100644 --- a/doc/articles/plugins.md +++ b/doc/articles/plugins.md @@ -323,6 +323,13 @@ hint to Composer that the plugin should be installed on its own before proceedin the rest of the package downloads. This slightly slows down the overall installation process however, so do not use it in plugins which do not absolutely require it. +## Plugin Autoloading + +Due to plugins being loaded by Composer at runtime, and to ensure that plugins which +depend on other packages can function correctly, a runtime autoloader is created whenever +a plugin is loaded. That autoloader is only configured to load with the plugin dependencies, +so you may not have access to all the packages which are installed. + [1]: ../04-schema.md#type [2]: ../04-schema.md#extra [3]: https://github.com/composer/composer/blob/main/src/Composer/Plugin/PluginInterface.php