-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
18 lines (16 loc) · 808 Bytes
/
index.php
File metadata and controls
18 lines (16 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php declare(strict_types = 1);
require_once(__DIR__ . '/bootstrap.php');
/* Create a logger without using the container so in case container fails, we can log it */
$logger = new \Kernolab\Service\Logger();
try {
$container = new \Kernolab\Service\Container();
/** @var \Kernolab\Routing\Router $router */
$router = $container->get(\Kernolab\Routing\Router::class);
$router->route($_SERVER['REQUEST_URI'], $_SERVER['REQUEST_METHOD']);
} catch (\Kernolab\Exception\ContainerException $e) {
$logger->log(\Kernolab\Service\Logger::SEVERITY_ERROR, $e->getMessage());
} catch (ReflectionException $e) {
$logger->log(\Kernolab\Service\Logger::SEVERITY_ERROR, $e->getMessage());
} catch (JsonException $e) {
$logger->log(\Kernolab\Service\Logger::SEVERITY_ERROR, $e->getMessage());
}