bootstrapping: only web should depend on forms
This fixes the problem that CLI scripts or other applications without an application directory would badly fail because of missing web forms. refs #6411
This commit is contained in:
parent
76a9e67e35
commit
602b448505
|
@ -301,7 +301,6 @@ abstract class ApplicationBootstrap
|
|||
|
||||
$this->loader = new Loader();
|
||||
$this->loader->registerNamespace('Icinga', $this->libDir. '/Icinga');
|
||||
$this->loader->registerNamespace('Icinga\\Form', $this->appDir. '/forms');
|
||||
$this->loader->register();
|
||||
|
||||
return $this;
|
||||
|
|
|
@ -124,6 +124,7 @@ class Web extends ApplicationBootstrap
|
|||
->setupInternationalization()
|
||||
->setupRequest()
|
||||
->setupZendMvc()
|
||||
->setupFormNamespace()
|
||||
->setupModuleManager()
|
||||
->loadEnabledModules()
|
||||
->setupRoute()
|
||||
|
@ -359,5 +360,19 @@ class Web extends ApplicationBootstrap
|
|||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup an autoloader namespace for Icinga\Form
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
private function setupFormNamespace()
|
||||
{
|
||||
$this->getLoader()->registerNamespace(
|
||||
'Icinga\\Form',
|
||||
$this->getApplicationDir('forms')
|
||||
);
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
|
Loading…
Reference in New Issue