gamesshop/src/php/index.dev.php

22 lines
569 B
PHP
Raw Normal View History

2024-06-30 12:41:33 +00:00
<?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);