From ad948bdd3201e922b626a736b0122533bdd37cae Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Wed, 1 Nov 2017 14:47:09 +0100 Subject: Added RequestServiceProvider and SessionServiceProvider --- includes/engelsystem.php | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) (limited to 'includes') diff --git a/includes/engelsystem.php b/includes/engelsystem.php index f9535847..97076895 100644 --- a/includes/engelsystem.php +++ b/includes/engelsystem.php @@ -3,10 +3,6 @@ use Engelsystem\Application; use Engelsystem\Config\Config; use Engelsystem\Exceptions\Handler as ExceptionHandler; -use Engelsystem\Http\Request; -use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; -use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; /** * This file includes all needed functions, connects to the db etc. @@ -14,6 +10,12 @@ use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; require_once __DIR__ . '/autoload.php'; +/** + * Include legacy code + */ +require __DIR__ . '/includes.php'; + + /** * Initialize and bootstrap the application */ @@ -48,30 +50,12 @@ if ($app->get('config')->get('maintenance')) { /** - * Initialize Request - * - * @var Request $request + * Init translations */ -$request = Request::createFromGlobals(); -$app->instance('request', $request); - - -/** - * Include legacy code - */ -require __DIR__ . '/includes.php'; +gettext_init(); /** - * Init application + * Init authorization */ -$sessionStorage = (PHP_SAPI != 'cli' ? new NativeSessionStorage(['cookie_httponly' => true]) : new MockArraySessionStorage()); -$session = new Session($sessionStorage); -$app->instance('session', $session); -$session->start(); -$request->setSession($session); - - -gettext_init(); - load_auth(); -- cgit v1.2.3-54-g00ecf