Skip to content

Commit

Permalink
Check active plugins using dedicated method on CLI (required for CLI …
Browse files Browse the repository at this point in the history
…install)
  • Loading branch information
cedric-anne committed May 9, 2019
1 parent ee1ad9c commit a90a82a
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions inc/autoload.function.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,19 +283,9 @@ function glpi_autoload($classname) {
$dir = GLPI_ROOT . "/plugins/$plugname/inc/";
$item = str_replace('\\', '/', strtolower($plug['class']));
// Is the plugin active?
// Command line usage of GLPI : need to do a real check plugin activation
if (isCommandLine()) {
$plugin = new Plugin();
if (count($plugin->find(['directory' => $plugname, 'state' => Plugin::ACTIVATED])) == 0) {
// Plugin does not exists or not activated
return false;
}
} else {
// Standard use of GLPI
if (!Plugin::isPluginLoaded($plugname)) {
// Plugin not activated
return false;
}
if (!Plugin::isPluginLoaded($plugname)) {
// Plugin not activated
return false;
}
} else {
$item = strtolower($classname);
Expand Down

0 comments on commit a90a82a

Please sign in to comment.