2024-06-30 12:41:33 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
use GamesShop\ContainerHandler;
|
2024-06-30 20:29:50 +00:00
|
|
|
use GamesShop\DoctrineManager;
|
2024-06-30 12:41:33 +00:00
|
|
|
use GamesShop\Environment\EnvironmentHandler;
|
|
|
|
use GamesShop\Routing\Router;
|
|
|
|
use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
|
2024-06-30 20:29:50 +00:00
|
|
|
use Whoops\Handler\HandlerInterface;
|
2024-06-30 12:41:33 +00:00
|
|
|
use Whoops\Handler\PrettyPageHandler;
|
|
|
|
use Whoops\Run;
|
|
|
|
|
2024-06-30 20:29:50 +00:00
|
|
|
require_once __DIR__ . '/../src/php/bootstrap.php';
|
2024-06-30 12:41:33 +00:00
|
|
|
|
|
|
|
$whoops = new Run();
|
2024-06-30 20:29:50 +00:00
|
|
|
$prettyPageHandler = new PrettyPageHandler();
|
|
|
|
$whoops->pushHandler($prettyPageHandler);
|
2024-06-30 12:41:33 +00:00
|
|
|
$whoops->register();
|
|
|
|
|
2024-06-30 20:29:50 +00:00
|
|
|
ContainerHandler::getInstance()->addShared(HandlerInterface::class, $prettyPageHandler);
|
|
|
|
|
2024-06-30 12:41:33 +00:00
|
|
|
$router = ContainerHandler::getInstance()->get(Router::class);
|
|
|
|
$result = $router->route();
|
|
|
|
|
|
|
|
(new SapiEmitter)->emit($result);
|