1
0
Fork 0

Add plugin-modifies-downloads to docs, refs #9339

pull/9348/head
Jordi Boggiano 2020-10-25 22:06:49 +01:00
parent 0cca80f8af
commit 3dfbd9e9e9
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 21 additions and 0 deletions

View File

@ -302,6 +302,27 @@ As of Composer 2, due to the fact that DownloaderInterface can sometimes return
and have been split up in more steps than they used to, we provide a [SyncHelper][11] and have been split up in more steps than they used to, we provide a [SyncHelper][11]
to make downloading and installing packages easier. to make downloading and installing packages easier.
## Plugin Extra Attributes
A few special plugin capabilities can be unlocked using extra attributes in the plugin's composer.json.
### class
[See above](#plugin-package) for an explanation of the class attribute and how it works.
### plugin-modifies-downloads
Some special plugins need to update package download URLs before they get downloaded.
As of Composer 2.0, all packages are downloaded before they get installed. This means
on the first installation, your plugin is not yet installed when the download occurs,
and it does not get a chance to update the URLs on time.
Specifying `{"extra": {"plugin-modifies-downloads": true}}` in your composer.json will
hint to Composer that the plugin should be installed on its own before proceeding with
the rest of the package installs. This slightly slows down installations however so do
not use it in plugins which do not absolutely require it.
[1]: ../04-schema.md#type [1]: ../04-schema.md#type
[2]: ../04-schema.md#extra [2]: ../04-schema.md#extra
[3]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/PluginInterface.php [3]: https://github.com/composer/composer/blob/master/src/Composer/Plugin/PluginInterface.php