2023-01-06 22:20:13 +00:00
|
|
|
<?php
|
|
|
|
namespace Hanyuu;
|
|
|
|
|
|
|
|
require_once __DIR__ . '/../hanyuu.php';
|
|
|
|
|
2023-10-20 21:38:13 +00:00
|
|
|
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();
|