22 lines
569 B
PHP
22 lines
569 B
PHP
|
<?php
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
use GamesShop\ContainerHandler;
|
||
|
use GamesShop\Environment\EnvironmentHandler;
|
||
|
use GamesShop\Routing\Router;
|
||
|
use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
|
||
|
use Whoops\Handler\PrettyPageHandler;
|
||
|
use Whoops\Run;
|
||
|
|
||
|
require_once __DIR__ . '/../vendor/autoload.php';
|
||
|
|
||
|
ContainerHandler::get(EnvironmentHandler::class)->load();
|
||
|
|
||
|
$whoops = new Run();
|
||
|
$whoops->pushHandler(new PrettyPageHandler);
|
||
|
$whoops->register();
|
||
|
|
||
|
$router = ContainerHandler::getInstance()->get(Router::class);
|
||
|
$result = $router->route();
|
||
|
|
||
|
(new SapiEmitter)->emit($result);
|