-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
30 lines (22 loc) · 744 Bytes
/
index.php
File metadata and controls
30 lines (22 loc) · 744 Bytes
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
<?php
// error_reporting(E_ERROR | E_PARSE);
$_SERVER['SCRIPT_NAME'] = basename(__FILE__);
$url = parse_url($_SERVER['REQUEST_URI'])['path'];
$file = __DIR__ . $url;
if (is_file($file)) {
return false;
}
use DI\ContainerBuilder;
use Slim\Factory\AppFactory;
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/config/includes.php';
$containerBuilder = new ContainerBuilder();
$containerBuilder->addDefinitions([]);
AppFactory::setContainer($containerBuilder->build());
$app = AppFactory::create();
$middlewares = require __DIR__ . '/config/middlewares.php';
$middlewares($app);
$routes = require __DIR__ . '/config/routes.php';
$routes($app, $url);
$exceptions = require __DIR__ . '/config/exceptions.php';
$exceptions($app);