mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 14:54:24 +02:00
Modules/Manager: did we load all enabled modules?
This commit is contained in:
parent
f9a0e7dec6
commit
a1832e1424
@ -73,6 +73,13 @@ class Manager
|
|||||||
*/
|
*/
|
||||||
private $modulePaths = array();
|
private $modulePaths = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether we loaded all enabled modules
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
private $loadedAllEnabledModules = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance of the module manager
|
* Create a new instance of the module manager
|
||||||
*
|
*
|
||||||
@ -177,12 +184,28 @@ class Manager
|
|||||||
*/
|
*/
|
||||||
public function loadEnabledModules()
|
public function loadEnabledModules()
|
||||||
{
|
{
|
||||||
foreach ($this->listEnabledModules() as $name) {
|
if (! $this->loadedAllEnabledModules) {
|
||||||
$this->loadModule($name);
|
foreach ($this->listEnabledModules() as $name) {
|
||||||
|
$this->loadModule($name);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->loadedAllEnabledModules = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether we loaded all enabled modules
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function loadedAllEnabledModules()
|
||||||
|
{
|
||||||
|
return $this->loadedAllEnabledModules;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Try to load the module and register it in the application
|
* Try to load the module and register it in the application
|
||||||
*
|
*
|
||||||
@ -245,6 +268,8 @@ class Manager
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->loadedAllEnabledModules = false;
|
||||||
|
|
||||||
if (file_exists($link) && is_link($link)) {
|
if (file_exists($link) && is_link($link)) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user