oatmeal/public/index.php

22 lines
422 B
PHP
Raw Normal View History

<?php
namespace Oatmeal;
require_once __DIR__ . '/../oatmeal.php';
set_exception_handler(function(\Throwable $ex) {
http_response_code(500);
ob_clean();
if(OAT_DEBUG) {
header('Content-Type: text/plain; charset=utf-8');
echo (string)$ex;
exit;
}
header('Content-Type: text/html; charset=utf-8');
echo '<!doctype html><h1>Error 500';
exit;
});
$oatmeal->dispatch();