From f2f9cfaf28508f66c1e948e7d1a9bf6b0c637d9d Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 1 Jan 2024 21:01:47 +0100 Subject: Work around possible loop and use Lib/Config in init --- Zotlabs/Lib/Config.php | 2 -- boot.php | 4 ++-- include/system_unavailable.php | 7 +++++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Zotlabs/Lib/Config.php b/Zotlabs/Lib/Config.php index 5e735be34..933f4bff3 100644 --- a/Zotlabs/Lib/Config.php +++ b/Zotlabs/Lib/Config.php @@ -51,8 +51,6 @@ class Config { } App::$config[$family]['config_loaded'] = true; } - - } } diff --git a/boot.php b/boot.php index 50c880113..9d9eb99c4 100644 --- a/boot.php +++ b/boot.php @@ -680,8 +680,8 @@ function sys_boot() { * Load configs from db. Overwrite configs from .htconfig.php */ - load_config('system'); - load_config('feature'); + Config::Load('system'); + Config::Load('feature'); App::$session = new Zotlabs\Web\Session(); App::$session->init(); diff --git a/include/system_unavailable.php b/include/system_unavailable.php index 4e0e6717b..e927bc633 100644 --- a/include/system_unavailable.php +++ b/include/system_unavailable.php @@ -3,7 +3,10 @@ require_once("include/network.php"); function system_down() { -http_status(503, 'Service Unavailable'); +// Set $skiplog to true here. Otherwise we will run into a loop +// when system_unavailable() -> system_down() is called from Zotlabs\Lib\Config::Load() +// but the DB is not available. +http_status(503, 'Service Unavailable', true); echo <<< EOT System Unavailable @@ -12,4 +15,4 @@ Apologies but this site is unavailable at the moment. Please try again later. EOT; -} \ No newline at end of file +} -- cgit v1.2.3