Moved 503 check higher up into the startup process.
Since it no longer depends on Twig we don't have to initialise that, removing further points of failure.
This commit is contained in:
parent
e19c5a68ba
commit
737be27198
1 changed files with 9 additions and 9 deletions
18
misuzu.php
18
misuzu.php
|
@ -138,6 +138,15 @@ if(!mb_check_encoding()) {
|
|||
|
||||
ob_start();
|
||||
|
||||
if(file_exists(MSZ_ROOT . '/.migrating')) {
|
||||
http_response_code(503);
|
||||
if(!isset($_GET['_check'])) {
|
||||
header('Content-Type: text/html; charset-utf-8');
|
||||
echo file_get_contents(MSZ_ROOT . '/templates/503.html');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!is_readable(MSZ_STORAGE) || !is_writable(MSZ_STORAGE)) {
|
||||
echo 'Cannot access storage directory.';
|
||||
exit;
|
||||
|
@ -161,15 +170,6 @@ Template::set('globals', [
|
|||
|
||||
Template::addPath(MSZ_ROOT . '/templates');
|
||||
|
||||
if(file_exists(MSZ_ROOT . '/.migrating')) {
|
||||
http_response_code(503);
|
||||
if(!isset($_GET['_check'])) {
|
||||
header('Content-Type: text/html; charset-utf-8');
|
||||
echo file_get_contents(MSZ_ROOT . '/templates/503.html');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
if(isset($_COOKIE['msz_uid']) && isset($_COOKIE['msz_sid'])) {
|
||||
$authToken = (new AuthToken)
|
||||
->setUserId(filter_input(INPUT_COOKIE, 'msz_uid', FILTER_SANITIZE_NUMBER_INT) ?? 0)
|
||||
|
|
Loading…
Reference in a new issue