engelsystem/public/index.php

24 lines
536 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
2018-08-07 03:18:22 +02:00
use Engelsystem\Application;
use Engelsystem\Middleware\Dispatcher;
use Psr\Http\Message\ServerRequestInterface;
2017-11-01 12:35:45 +01:00
2024-04-06 16:14:30 +02:00
// Include app bootstrapping
2017-11-01 12:35:45 +01:00
require_once realpath(__DIR__ . '/../includes/engelsystem.php');
2011-06-01 14:30:29 +02:00
2018-08-07 03:18:22 +02:00
/** @var Application $app */
$app = app();
2013-12-09 17:10:07 +01:00
2018-08-07 03:18:22 +02:00
/** @var ServerRequestInterface $request */
$request = $app->get('psr7.request');
2018-08-12 00:08:52 +02:00
$middleware = $app->getMiddleware();
2017-01-03 03:22:48 +01:00
2018-08-12 00:08:52 +02:00
$dispatcher = new Dispatcher($middleware);
2018-08-07 03:18:22 +02:00
$dispatcher->setContainer($app);
2024-04-06 16:14:30 +02:00
// Handle the request
2018-08-07 03:18:22 +02:00
$dispatcher->handle($request);