parent
a630a96e01
commit
3e04122e34
|
@ -11,6 +11,5 @@ set_include_path(
|
|||
);
|
||||
|
||||
require_once 'Icinga/Application/Cli.php';
|
||||
date_default_timezone_set('UTC');
|
||||
$app = Cli::start(dirname(__FILE__) . '/../config/')->dispatch();
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ namespace Icinga\Application;
|
|||
use \DateTimeZone;
|
||||
use \Exception;
|
||||
use \Icinga\Application\Modules\Manager as ModuleManager;
|
||||
use \Icinga\Application\Config;
|
||||
use \Icinga\Exception\ConfigurationError;
|
||||
use \Icinga\Util\DateTimeFactory;
|
||||
use \Icinga\Util\Translator;
|
||||
|
@ -124,7 +123,7 @@ abstract class ApplicationBootstrap
|
|||
*/
|
||||
protected function __construct($configDir)
|
||||
{
|
||||
$this->libDir = realpath(__DIR__. '/../..');
|
||||
$this->libDir = realpath(__DIR__ . '/../..');
|
||||
|
||||
if (!defined('ICINGA_LIBDIR')) {
|
||||
define('ICINGA_LIBDIR', $this->libDir);
|
||||
|
@ -257,9 +256,7 @@ abstract class ApplicationBootstrap
|
|||
*/
|
||||
public static function start($configDir)
|
||||
{
|
||||
$class = get_called_class();
|
||||
/** @var ApplicationBootstrap $obj */
|
||||
$application = new $class($configDir);
|
||||
$application = new static($configDir);
|
||||
$application->bootstrap();
|
||||
|
||||
if (Logger::hasErrorsOccurred()) {
|
||||
|
@ -302,7 +299,7 @@ abstract class ApplicationBootstrap
|
|||
*/
|
||||
public function setupAutoloader()
|
||||
{
|
||||
require $this->libDir. '/Icinga/Application/Loader.php';
|
||||
require $this->libDir . '/Icinga/Application/Loader.php';
|
||||
|
||||
$this->loader = new Loader();
|
||||
$this->loader->registerNamespace('Icinga', $this->libDir. '/Icinga');
|
||||
|
@ -368,11 +365,11 @@ abstract class ApplicationBootstrap
|
|||
}
|
||||
|
||||
/**
|
||||
* Load Configuration
|
||||
* Load configuration
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
protected function setupConfig()
|
||||
protected function loadConfig()
|
||||
{
|
||||
Config::$configDir = $this->configDir;
|
||||
$this->config = Config::app();
|
||||
|
|
|
@ -61,7 +61,9 @@ class Cli extends ApplicationBootstrap
|
|||
protected function bootstrap()
|
||||
{
|
||||
$this->assertRunningOnCli();
|
||||
$this->setupConfig()
|
||||
$this
|
||||
->loadConfig()
|
||||
->setupTimezone()
|
||||
->setupInternationalization()
|
||||
->parseBasicParams()
|
||||
->fixLoggingConfig()
|
||||
|
|
|
@ -54,9 +54,10 @@ class EmbeddedWeb extends ApplicationBootstrap
|
|||
*/
|
||||
protected function bootstrap()
|
||||
{
|
||||
return $this->setupConfig()
|
||||
->setupErrorHandling()
|
||||
return $this
|
||||
->loadConfig()
|
||||
->setupTimezone()
|
||||
->setupErrorHandling()
|
||||
->setupModules();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,18 +29,17 @@
|
|||
|
||||
namespace Icinga\Application;
|
||||
|
||||
use Icinga\Protocol\Ldap\Exception;
|
||||
use \Zend_Config;
|
||||
use \Zend_Log;
|
||||
use \Zend_Log_Filter_Priority;
|
||||
use \Zend_Log_Writer_Abstract;
|
||||
use \Zend_Log_Exception;
|
||||
use \Icinga\Exception\ConfigurationError;
|
||||
use Icinga\Exception\ConfigurationError;
|
||||
|
||||
/**
|
||||
* Singleton logger
|
||||
* Zend_Log wrapper
|
||||
*/
|
||||
final class Logger
|
||||
class Logger
|
||||
{
|
||||
/**
|
||||
* Default log type
|
||||
|
|
|
@ -116,13 +116,14 @@ class Web extends ApplicationBootstrap
|
|||
*/
|
||||
protected function bootstrap()
|
||||
{
|
||||
return $this->setupConfig()
|
||||
->setupErrorHandling()
|
||||
->setupResourceFactory()
|
||||
return $this
|
||||
->loadConfig()
|
||||
->setupSession()
|
||||
->setupUser()
|
||||
->setupInternationalization()
|
||||
->setupTimezone()
|
||||
->setupErrorHandling()
|
||||
->setupResourceFactory()
|
||||
->setupInternationalization()
|
||||
->setupRequest()
|
||||
->setupZendMvc()
|
||||
->setupModuleManager()
|
||||
|
|
|
@ -2,13 +2,6 @@
|
|||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
/*
|
||||
* Set timezone before bootstrapping the application and therefore before calling `setupTimezone()` because in case an
|
||||
* error occurred whilst, the logger calls date/time functions which would generate a warning if the php.ini lacks a
|
||||
* valid timezone.
|
||||
*/
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
require_once dirname(__FILE__). '/../library/Icinga/Application/Web.php';
|
||||
|
||||
use Icinga\Application\Web;
|
||||
|
|
Loading…
Reference in New Issue