From 364d1123537462dafe06cc23df16b386379d21bf Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Wed, 13 Nov 2024 11:30:16 +0900 Subject: [PATCH] fix: Fixed problem with debugger not setting up properly --- html/modules/legacy/class/Legacy_Debugger.class.php | 2 +- .../modules/legacy/kernel/Legacy_Controller.class.php | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/html/modules/legacy/class/Legacy_Debugger.class.php b/html/modules/legacy/class/Legacy_Debugger.class.php index d00a79d2f..779968044 100644 --- a/html/modules/legacy/class/Legacy_Debugger.class.php +++ b/html/modules/legacy/class/Legacy_Debugger.class.php @@ -27,7 +27,7 @@ class Legacy_DebuggerManager * @param $instance * @param $debug_mode */ - public function createInstance(&$instance, $debug_mode) + public static function createInstance(&$instance, $debug_mode) { if (is_object($instance)) { return; diff --git a/html/modules/legacy/kernel/Legacy_Controller.class.php b/html/modules/legacy/kernel/Legacy_Controller.class.php index cc442916c..2808bfaf7 100644 --- a/html/modules/legacy/kernel/Legacy_Controller.class.php +++ b/html/modules/legacy/kernel/Legacy_Controller.class.php @@ -95,6 +95,11 @@ class Legacy_Controller extends XCube_Controller */ public $mSetupDebugger = null; + /** + * @var Legacy_AbstractDebugger + */ + public $mDebugger; + /** * @public * @var XCube_Delegate @@ -107,8 +112,6 @@ class Legacy_Controller extends XCube_Controller * @var XoopsLogger */ public $mLogger = null; - //@todo added - //public $mDebugger = null; public function __construct() { @@ -771,7 +774,9 @@ public function _setupScript() */ public function _setupDebugger() { - error_reporting(0); + // Commented out because suppressing errors here will not result in an error if the debugger setup fails. + // If the debugger setup succeeds, error_reporting is set to the value corresponding to the debug mode. + // error_reporting(0); $debug_mode = $this->mRoot->mContext->mXoopsConfig['debug_mode']; if (defined('XC_FORCE_DEBUG_PHP')) {