aboutsummaryrefslogtreecommitdiff
path: root/public/dispatch.php
diff options
context:
space:
mode:
authorAndré Noack <noack@data-quest.de>2024-12-12 14:52:00 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2024-12-12 14:52:00 +0000
commit940d2aaa8638b4e0c764579cb3977e7be527c81f (patch)
tree79bd2d7f02359e1bb24931b33513e082f8404a91 /public/dispatch.php
parent3a2a88172ccbe97aaecf4ea32b97cd07b92dcb11 (diff)
StEP 1552 closes #1552
Closes #1552 Merge request studip/studip!1137
Diffstat (limited to 'public/dispatch.php')
-rw-r--r--public/dispatch.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/public/dispatch.php b/public/dispatch.php
index 77c5933..8bc346d 100644
--- a/public/dispatch.php
+++ b/public/dispatch.php
@@ -1,8 +1,6 @@
<?php
-# Lifter002: TODO
-# Lifter007: TODO
-# Lifter003: TODO
-# Lifter010: TODO
+use Slim\App;
+use Slim\Factory\AppFactory;
/*
* index.php - <short-description>
@@ -21,5 +19,17 @@ require '../lib/bootstrap.php';
// prepare environment
URLHelper::setBaseUrl($GLOBALS['ABSOLUTE_URI_STUDIP']);
-$dispatcher = app(\Trails\Dispatcher::class);
-$dispatcher->dispatch(Request::pathInfo());
+// Build PHP_DI Container
+$container = app();
+
+// Instantiate the app
+AppFactory::setContainer($container);
+$app = AppFactory::create();
+$container->set(App::class, $app);
+$app->setBasePath($GLOBALS['CANONICAL_RELATIVE_PATH_STUDIP'] . 'dispatch.php');
+
+$studip_dispatcher = app(\Trails\Dispatcher::class);
+$route_callable = $studip_dispatcher->getRouteCallable(Request::pathInfo());
+$app->any(Request::pathInfo(), $route_callable);
+NotificationCenter::postNotification('SLIM_BEFORE_RUN', $app);
+$app->run();