Enable PicoDeprecated if no plugins are loaded
This commit is contained in:
parent
ccac8dd4d3
commit
2a43b21bae
@ -69,14 +69,23 @@ class PicoDeprecated extends AbstractPicoPlugin
|
|||||||
*/
|
*/
|
||||||
public function onPluginsLoaded(&$plugins)
|
public function onPluginsLoaded(&$plugins)
|
||||||
{
|
{
|
||||||
foreach ($plugins as $plugin) {
|
if (!empty($plugins)) {
|
||||||
if (!is_a($plugin, 'PicoPluginInterface')) {
|
foreach ($plugins as $plugin) {
|
||||||
// the plugin doesn't implement PicoPluginInterface; it uses deprecated events
|
if (!is_a($plugin, 'PicoPluginInterface')) {
|
||||||
// enable PicoDeprecated if it hasn't be explicitly enabled/disabled yet
|
// the plugin doesn't implement PicoPluginInterface; it uses deprecated events
|
||||||
if (!$this->isStatusChanged()) {
|
// enable PicoDeprecated if it hasn't be explicitly enabled/disabled yet
|
||||||
$this->setEnabled(true, true, true);
|
if (!$this->isStatusChanged()) {
|
||||||
|
$this->setEnabled(true, true, true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
|
} else {
|
||||||
|
// no plugins were found, so it actually isn't necessary to call deprecated events
|
||||||
|
// anyway, this plugin also ensures compatibility apart from events used by old plugins,
|
||||||
|
// so enable PicoDeprecated if it hasn't be explicitly enabled/disabled yet
|
||||||
|
if (!$this->isStatusChanged()) {
|
||||||
|
$this->setEnabled(true, true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user