Match plugin-optional more strictly
parent
b781031413
commit
d35cb21749
|
@ -50,7 +50,7 @@ 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->getPluginManager()->arePluginsDisabled('local')) {
|
||||
$this->getPluginManager()->isPluginAllowed($package->getName(), false, $package->getExtra()['plugin-optional'] ?? false);
|
||||
$this->getPluginManager()->isPluginAllowed($package->getName(), false, true === ($package->getExtra()['plugin-optional'] ?? false));
|
||||
}
|
||||
|
||||
return parent::prepare($type, $package, $prevPackage);
|
||||
|
|
|
@ -187,7 +187,7 @@ class PluginManager
|
|||
}
|
||||
}
|
||||
|
||||
if (!$this->isPluginAllowed($package->getName(), $isGlobalPlugin, (bool) ($package->getExtra()['plugin-optional'] ?? false))) {
|
||||
if (!$this->isPluginAllowed($package->getName(), $isGlobalPlugin, true === ($package->getExtra()['plugin-optional'] ?? false))) {
|
||||
$this->io->writeError('Skipped loading "'.$package->getName() . '" '.($isGlobalPlugin || $this->runningInGlobalDir ? '(installed globally) ' : '').'as it is not in config.allow-plugins', true, IOInterface::DEBUG);
|
||||
|
||||
return;
|
||||
|
@ -370,7 +370,7 @@ class PluginManager
|
|||
|
||||
if ($sourcePackage === null) {
|
||||
trigger_error('Calling PluginManager::addPlugin without $sourcePackage is deprecated, if you are using this please get in touch with us to explain the use case', E_USER_DEPRECATED);
|
||||
} elseif (!$this->isPluginAllowed($sourcePackage->getName(), $isGlobalPlugin, (bool) ($sourcePackage->getExtra()['plugin-optional'] ?? false))) {
|
||||
} elseif (!$this->isPluginAllowed($sourcePackage->getName(), $isGlobalPlugin, true === ($sourcePackage->getExtra()['plugin-optional'] ?? false))) {
|
||||
$this->io->writeError('Skipped loading "'.get_class($plugin).' from '.$sourcePackage->getName() . '" '.($isGlobalPlugin || $this->runningInGlobalDir ? '(installed globally) ' : '').' as it is not in config.allow-plugins', true, IOInterface::DEBUG);
|
||||
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue