Multiple installations paths for all Bootstrappers
No longer instantiating moduleManager twice, now the CLI is also able to benefit from multiple module installation paths. Modules lists are now sorted.
This commit is contained in:
parent
db22945f1e
commit
e0af544c14
|
@ -343,7 +343,11 @@ abstract class ApplicationBootstrap
|
|||
*/
|
||||
protected function setupModuleManager()
|
||||
{
|
||||
$this->moduleManager = new ModuleManager($this, $this->configDir . '/enabledModules');
|
||||
$this->moduleManager = new ModuleManager(
|
||||
$this,
|
||||
$this->configDir . '/enabledModules',
|
||||
explode(':', $this->config->global->get('modulePath', ICINGA_APPDIR . '/../modules'))
|
||||
);
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -354,11 +358,6 @@ abstract class ApplicationBootstrap
|
|||
*/
|
||||
protected function loadEnabledModules()
|
||||
{
|
||||
$this->moduleManager = new ModuleManager(
|
||||
$this,
|
||||
$this->config->global->get('moduleFolder', $this->getConfigDir() . '/enabledModules'),
|
||||
explode(':', $this->config->global->get('modulePath', ICINGA_APPDIR . '/../modules'))
|
||||
);
|
||||
try {
|
||||
$this->moduleManager->loadEnabledModules();
|
||||
} catch (Exception $e) {
|
||||
|
|
|
@ -181,6 +181,7 @@ class Manager
|
|||
}
|
||||
|
||||
$this->enabledDirs[$file] = $dir;
|
||||
ksort($this->enabledDirs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -520,7 +521,7 @@ class Manager
|
|||
continue;
|
||||
}
|
||||
if (is_dir($basedir . '/' . $name)) {
|
||||
if (!array_key_exists($name, $this->installedBaseDirs)) {
|
||||
if (! array_key_exists($name, $this->installedBaseDirs)) {
|
||||
$this->installedBaseDirs[$name] = $basedir . '/' . $name;
|
||||
} else {
|
||||
Logger::warn(
|
||||
|
@ -532,6 +533,7 @@ class Manager
|
|||
}
|
||||
}
|
||||
}
|
||||
ksort($this->installedBaseDirs);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue