1
0
Fork 0

Add alternative to custom installers (#10149)

Taken from composer/installers readme
pull/10158/head
Rodrigo 2021-10-13 23:48:58 +03:00 committed by GitHub
parent bced747ed3
commit 131d6ade5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -13,6 +13,16 @@ library.
In these cases you could consider creating a Custom Installer to handle your In these cases you could consider creating a Custom Installer to handle your
specific logic. specific logic.
## Alternative to custom installers with Composer 2.1+
As of Composer 2.1, the `Composer\InstalledVersions` class has a
[`getInstalledPackagesByType`](https://getcomposer.org/doc/07-runtime.md#knowing-which-packages-of-a-given-type-are-installed)
method which can let you figure out at runtime which plugins/modules/extensions are installed.
It is highly recommended to use that instead of building new custom
installers if you are building a new application. This has the advantage of leaving
all vendor code in the vendor directory, and not requiring custom installer code.
## Calling a Custom Installer ## Calling a Custom Installer
Suppose that your project already has a Custom Installer for specific modules Suppose that your project already has a Custom Installer for specific modules