From 57b47301eda6d6defc3461ba45758f90114e410f Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 14 Feb 2023 11:48:42 +0100 Subject: [PATCH] Added optional plugin check in PluginInstaller (#11326) --- src/Composer/Installer/PluginInstaller.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Composer/Installer/PluginInstaller.php b/src/Composer/Installer/PluginInstaller.php index af9dd2d89..bb8789cc9 100644 --- a/src/Composer/Installer/PluginInstaller.php +++ b/src/Composer/Installer/PluginInstaller.php @@ -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 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);