hanyuu/public/index.php

29 lines
642 B
PHP

<?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();