Moved constants out of misuzu.php.

This commit is contained in:
flash 2025-02-09 20:44:10 +00:00
parent 1d54d41f6b
commit 4110cd5190
16 changed files with 77 additions and 50 deletions
public

View file

@ -29,17 +29,17 @@ else
// 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
$request = \Index\Http\HttpRequest::fromRequest();
ob_start();
if(is_file(MSZ_ROOT . '/.migrating')) {
if(is_file($msz->dbCtx->getMigrateLockPath())) {
http_response_code(503);
header('Content-Type: text/html; charset=utf-8');
header('X-Accel-Redirect: /error-503.html');
exit;
}
$request = \Index\Http\HttpRequest::fromRequest();
$tokenPacker = $msz->authCtx->createAuthTokenPacker();
if(filter_has_var(INPUT_COOKIE, 'msz_auth'))
@ -130,7 +130,7 @@ $msz->startTemplating();
if(in_array('main', $msz->env->getArray(sprintf('domain:%s', $request->getHeaderLine('Host'))))) {
$mszRequestPath = substr($request->path, 1);
$mszLegacyPathPrefix = MSZ_PUBLIC . '-legacy/';
$mszLegacyPathPrefix = Misuzu::PATH_PUBLIC_LEGACY . '/';
$mszLegacyPath = $mszLegacyPathPrefix . $mszRequestPath;
if(str_starts_with($mszLegacyPath, $mszLegacyPathPrefix)) {