diff --git a/library/Icinga/Application/ApplicationBootstrap.php b/library/Icinga/Application/ApplicationBootstrap.php index 02b9e13cf..64485841e 100755 --- a/library/Icinga/Application/ApplicationBootstrap.php +++ b/library/Icinga/Application/ApplicationBootstrap.php @@ -337,14 +337,23 @@ abstract class ApplicationBootstrap } /** - * Setup module loader and all enabled modules + * Setup module manager * * @return self */ - protected function setupModules() + protected function setupModuleManager() { $this->moduleManager = new ModuleManager($this, $this->configDir . '/enabledModules'); + return $this; + } + /** + * Load all enabled modules + * + * @return self + */ + protected function loadEnabledModules() + { try { $this->moduleManager->loadEnabledModules(); } catch (Exception $e) { diff --git a/library/Icinga/Application/Cli.php b/library/Icinga/Application/Cli.php index 665c313a3..d73980675 100644 --- a/library/Icinga/Application/Cli.php +++ b/library/Icinga/Application/Cli.php @@ -67,7 +67,7 @@ class Cli extends ApplicationBootstrap ->fixLoggingConfig() ->setupErrorHandling() ->setupResourceFactory() - ->setupModules() + ->setupModuleManager() ; } @@ -93,34 +93,6 @@ class Cli extends ApplicationBootstrap return $this->cliLoader; } - /** - * Setup module loader - * - * TODO: This can be removed once broken bootstrapping has been fixed - * Loading the module manager and enabling all modules have former - * been two different tasks. CLI does NOT enable any module by default. - * - * @return self - */ - protected function setupModules() - { - $this->moduleManager = new ModuleManager($this, $this->getConfigDir('enabledModules')); - return $this; - } - - /** - * Getter for module manager - * - * TODO: This can also be removed once fixed. Making everything private - * made this duplication necessary - * - * @return ModuleManager - */ - public function getModuleManager() - { - return $this->moduleManager; - } - protected function parseBasicParams() { $this->params = Params::parse(); diff --git a/library/Icinga/Application/Web.php b/library/Icinga/Application/Web.php index 756316af8..6ea8ab359 100644 --- a/library/Icinga/Application/Web.php +++ b/library/Icinga/Application/Web.php @@ -110,7 +110,8 @@ class Web extends ApplicationBootstrap ->setupRequest() ->setupZendMvc() ->setupTranslation() - ->setupModules() + ->setupModuleManager() + ->loadEnabledModules() ->setupRoute() ->setupPagination(); }