Allow to get permissions and restrictions from unloaded modules
refs #9644
This commit is contained in:
parent
444fdadf13
commit
519d025de5
|
@ -113,6 +113,13 @@ class Module
|
|||
*/
|
||||
private $triedToLaunchConfigScript = false;
|
||||
|
||||
/**
|
||||
* Whether the module's namespace has been registered on our autoloader
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $registeredAutoloader = false;
|
||||
|
||||
/**
|
||||
* Whether this module has been registered
|
||||
*
|
||||
|
@ -855,6 +862,10 @@ class Module
|
|||
*/
|
||||
protected function registerAutoloader()
|
||||
{
|
||||
if ($this->registeredAutoloader) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$moduleName = ucfirst($this->getName());
|
||||
|
||||
$moduleLibraryDir = $this->getLibDir(). '/'. $moduleName;
|
||||
|
@ -867,6 +878,8 @@ class Module
|
|||
$this->app->getLoader()->registerNamespace('Icinga\\Module\\' . $moduleName. '\\Forms', $moduleFormDir);
|
||||
}
|
||||
|
||||
$this->registeredAutoloader = true;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -1011,7 +1024,7 @@ class Module
|
|||
*/
|
||||
protected function launchConfigScript()
|
||||
{
|
||||
if ($this->triedToLaunchConfigScript || !$this->registered) {
|
||||
if ($this->triedToLaunchConfigScript) {
|
||||
return;
|
||||
}
|
||||
$this->triedToLaunchConfigScript = true;
|
||||
|
@ -1019,6 +1032,7 @@ class Module
|
|||
|| ! is_readable($this->configScript)) {
|
||||
return;
|
||||
}
|
||||
$this->registerAutoloader();
|
||||
include($this->configScript);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue