1
0
Fork 0

Added optional plugin check in PluginInstaller (#11326)

pull/11464/head
Nicolas Grekas 2023-02-14 11:48:42 +01:00 committed by GitHub
parent 5e5aaf7ada
commit 57b47301ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -54,7 +54,8 @@ class PluginInstaller extends LibraryInstaller
{ {
// fail install process early if it is going to fail due to a plugin not being allowed // fail install process early if it is going to fail due to a plugin not being allowed
if (($type === 'install' || $type === 'update') && !$this->composer->getPluginManager()->arePluginsDisabled('local')) { if (($type === 'install' || $type === 'update') && !$this->composer->getPluginManager()->arePluginsDisabled('local')) {
$this->composer->getPluginManager()->isPluginAllowed($package->getName(), false); $extra = $package->getExtra();
$this->composer->getPluginManager()->isPluginAllowed($package->getName(), false, isset($extra['plugin-optional']) && true === $extra['plugin-optional']);
} }
return parent::prepare($type, $package, $prevPackage); return parent::prepare($type, $package, $prevPackage);