hanyuu/public/index.php

30 lines
642 B
PHP
Raw Normal View History

2023-01-06 22:20:13 +00:00
<?php
namespace Hanyuu;
require_once __DIR__ . '/../hanyuu.php';
set_exception_handler(function(\Throwable $ex) {
http_response_code(500);
ob_clean();
if(HAU_DEBUG) {
header('Content-Type: text/plain; charset=utf-8');
echo (string)$ex;
exit;
}
header('Content-Type: text/html; charset=utf-8');
//echo file_get_contents(HAU_DIR_PUBLIC . '/error-500.html');
echo '500';
exit;
});
if(file_exists(HAU_ROOT . '/.migrating')) {
http_response_code(503);
//echo file_get_contents(HAU_DIR_PUBLIC . '/error-503.html');
echo '503';
exit;
}
$hau->createRouting()->dispatch();