mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
bootstrapping: play nice with duplicate modules
A module loaded manually could also exist in the list of enabled modules if a configuration is given and a module with the same name has been enabled. This used to confuse documentation.
This commit is contained in:
parent
bdcec5a253
commit
4202e34d13
@ -182,16 +182,15 @@ class Loader
|
|||||||
if ($params === null) {
|
if ($params === null) {
|
||||||
$params = $this->app->getParams();
|
$params = $this->app->getParams();
|
||||||
}
|
}
|
||||||
$first = $params->shift();
|
|
||||||
if (! $first) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->moduleName === null) {
|
if ($this->moduleName === null) {
|
||||||
|
$first = $params->shift();
|
||||||
|
if (! $first) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$found = $this->resolveName($first);
|
$found = $this->resolveName($first);
|
||||||
} else {
|
} else {
|
||||||
$found = $this->moduleName;
|
$found = $this->moduleName;
|
||||||
$params->unshift($first);
|
|
||||||
}
|
}
|
||||||
if (! $found) {
|
if (! $found) {
|
||||||
$msg = "There is no such module or command: '$first'";
|
$msg = "There is no such module or command: '$first'";
|
||||||
@ -431,11 +430,10 @@ class Loader
|
|||||||
{
|
{
|
||||||
if ($this->modules === null) {
|
if ($this->modules === null) {
|
||||||
$this->modules = array();
|
$this->modules = array();
|
||||||
$this->modules = array_merge(
|
$this->modules = array_unique(array_merge(
|
||||||
$this->app->getModuleManager()->listEnabledModules(),
|
$this->app->getModuleManager()->listEnabledModules(),
|
||||||
$this->app->getModuleManager()->listLoadedModules()
|
$this->app->getModuleManager()->listLoadedModules()
|
||||||
);
|
));
|
||||||
sort($this->modules);
|
|
||||||
}
|
}
|
||||||
return $this->modules;
|
return $this->modules;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user