Web\Session: implement lazy loading

fixes #7055
This commit is contained in:
Thomas Gelf 2014-09-02 13:23:15 +02:00
parent e75de8cf60
commit 62c0f0be03
2 changed files with 1 additions and 23 deletions

View File

@ -13,8 +13,6 @@ use Icinga\Logger\Logger;
use Icinga\Web\Request;
use Icinga\Web\Response;
use Icinga\Web\View;
use Icinga\Web\Session\Session as BaseSession;
use Icinga\Web\Session;
use Icinga\User;
use Icinga\Util\Translator;
use Icinga\Util\DateTimeFactory;
@ -59,13 +57,6 @@ class Web extends ApplicationBootstrap
*/
private $request;
/**
* Session object
*
* @var BaseSession
*/
private $session;
/**
* User object
*
@ -92,7 +83,6 @@ class Web extends ApplicationBootstrap
->setupErrorHandling()
->loadConfig()
->setupResourceFactory()
->setupSession()
->setupUser()
->setupTimezone()
->setupLogger()
@ -172,7 +162,6 @@ class Web extends ApplicationBootstrap
$this->setupFrontController();
$this->setupViewRenderer();
return $this;
}
@ -192,17 +181,6 @@ class Web extends ApplicationBootstrap
return $this;
}
/**
* Initialize a session provider
*
* @return self
*/
private function setupSession()
{
$this->session = Session::create();
return $this;
}
/**
* Inject dependencies into request
*

View File

@ -47,7 +47,7 @@ class Session
public static function getSession()
{
if (self::$session === null) {
throw new ProgrammingError('No session created yet');
self::create();
}
return self::$session;