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:
Thomas Gelf 2014-06-04 22:46:16 +00:00
parent 76a9e67e35
commit 602b448505
2 changed files with 15 additions and 1 deletions

View File

@ -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;

View File

@ -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