blob: 368039a790829bcf3d09a7954e6840ddd7f78d50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<?php
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Slim\App;
use Slim\Factory\AppFactory;
use Studip\Middleware\AuthenticationMiddleware;
use Studip\Middleware\DispatchPluginMiddleware;
use Studip\Middleware\HandleAccessDeniedMiddleware;
use Studip\Middleware\SeminarOpenMiddleware;
use Studip\Middleware\SessionMiddleware;
use Studip\Middleware\TrailingSlash;
require '../lib/bootstrap.php';
// prepare environment
URLHelper::setBaseUrl($GLOBALS['ABSOLUTE_URI_STUDIP']);
// 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'] . 'plugins.php');
$app->add(DispatchPluginMiddleware::class);
$app->add(HandleAccessDeniedMiddleware::class);
$app->add(SeminarOpenMiddleware::class);
$app->add(AuthenticationMiddleware::class);
$app->add(SessionMiddleware::class);
$app->add(TrailingSlash::class);
auth()->setNobody(true);
NotificationCenter::postNotification('SLIM_BEFORE_RUN', $app);
$app->run();
NotificationCenter::postNotification('SLIM_AFTER_RUN', $app);
|