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();
|
||||
|
||||
/**
|
||||
* Whether we loaded all enabled modules
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
private $loadedAllEnabledModules = false;
|
||||
|
||||
/**
|
||||
* Create a new instance of the module manager
|
||||
*
|
||||
|
@ -177,12 +184,28 @@ class Manager
|
|||
*/
|
||||
public function loadEnabledModules()
|
||||
{
|
||||
foreach ($this->listEnabledModules() as $name) {
|
||||
$this->loadModule($name);
|
||||
if (! $this->loadedAllEnabledModules) {
|
||||
foreach ($this->listEnabledModules() as $name) {
|
||||
$this->loadModule($name);
|
||||
}
|
||||
|
||||
$this->loadedAllEnabledModules = true;
|
||||
}
|
||||
|
||||
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
|
||||
*
|
||||
|
@ -245,6 +268,8 @@ class Manager
|
|||
);
|
||||
}
|
||||
|
||||
$this->loadedAllEnabledModules = false;
|
||||
|
||||
if (file_exists($link) && is_link($link)) {
|
||||
return $this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue