Updated Index version.
This commit is contained in:
parent
f2233c5390
commit
6c7568e261
50 changed files with 483 additions and 457 deletions
public
|
@ -9,21 +9,22 @@ require_once __DIR__ . '/../misuzu.php';
|
|||
if(!isset($msz) || !($msz instanceof \Misuzu\MisuzuContext))
|
||||
die('Misuzu is not initialised.');
|
||||
|
||||
set_exception_handler(function(\Throwable $ex) {
|
||||
\Sentry\captureException($ex);
|
||||
if(class_exists(\Whoops\Run::class))
|
||||
(function($whoops) {
|
||||
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
|
||||
$whoops->register();
|
||||
})(new \Whoops\Run);
|
||||
else
|
||||
set_exception_handler(function(\Throwable $ex) {
|
||||
\Sentry\captureException($ex);
|
||||
|
||||
http_response_code(500);
|
||||
ob_clean();
|
||||
http_response_code(500);
|
||||
ob_clean();
|
||||
|
||||
if(MSZ_DEBUG) {
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
echo (string)$ex;
|
||||
} else {
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
echo file_get_contents(MSZ_TEMPLATES . '/500.html');
|
||||
}
|
||||
exit;
|
||||
});
|
||||
exit;
|
||||
});
|
||||
|
||||
// The whole wall of shit before the router setup and dispatch should be worked away
|
||||
// Lockdown things should be middleware when there's no more legacy files
|
||||
|
@ -129,8 +130,8 @@ CSRF::init(
|
|||
$router = $msz->createRouting($request);
|
||||
$msz->startTemplating();
|
||||
|
||||
if(in_array('main', $env->getArray(sprintf('domain:%s', $request->getHeaderLine('Host'))))) {
|
||||
$mszRequestPath = substr($request->getPath(), 1);
|
||||
if(in_array('main', $msz->env->getArray(sprintf('domain:%s', $request->getHeaderLine('Host'))))) {
|
||||
$mszRequestPath = substr($request->path, 1);
|
||||
$mszLegacyPathPrefix = MSZ_PUBLIC . '-legacy/';
|
||||
$mszLegacyPath = $mszLegacyPathPrefix . $mszRequestPath;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue