diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2017-11-01 14:47:09 +0100 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2017-11-01 16:12:01 +0100 |
commit | ad948bdd3201e922b626a736b0122533bdd37cae (patch) | |
tree | 9011a160f3d6f9cae37fc02836e7d6e8c25242ca /includes | |
parent | e727b367cc77452b58bc2d9360bcde97b7572288 (diff) |
Added RequestServiceProvider and SessionServiceProvider
Diffstat (limited to 'includes')
-rw-r--r-- | includes/engelsystem.php | 34 |
1 files changed, 9 insertions, 25 deletions
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. @@ -15,6 +11,12 @@ require_once __DIR__ . '/autoload.php'; /** + * Include legacy code + */ +require __DIR__ . '/includes.php'; + + +/** * Initialize and bootstrap the application */ $app = new Application(realpath(__DIR__ . DIRECTORY_SEPARATOR . '..')); @@ -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(); |