From 77c00a1bf030150b698361a014a9569ea547f21e Mon Sep 17 00:00:00 2001 From: rainbowsoft Date: Fri, 6 Dec 2024 16:53:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=86debug=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=E9=A1=BA=E5=BA=8F;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zb_system/function/c_system_debug.php | 60 +++++++++++++-------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/zb_system/function/c_system_debug.php b/zb_system/function/c_system_debug.php index b391773a..310dd0c8 100644 --- a/zb_system/function/c_system_debug.php +++ b/zb_system/function/c_system_debug.php @@ -140,6 +140,17 @@ function Debug_Error_Handler($errno, $errstr, $errfile, $errline) $fpreturn = $fpname('Error', array($errno, $errstr, $errfile, $errline)); } + $zec = new ZbpErrorControl(); + $zee = $zec->ParseError($errno, $errstr, $errfile, $errline); + + foreach ($GLOBALS['hooks']['Filter_Plugin_Debug_Handler_ZEE'] as $fpname => &$fpsignal) { + $fpsignal = PLUGIN_EXITSIGNAL_NONE; + $fpreturn = $fpname($zee, 'Error'); + if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) { + return $fpreturn; + } + } + if (ZbpErrorControl::$islogerror == true) { $err = ZbpErrorControl::$errarray[$errno]; Logs(var_export(array($err, $errno, $errstr, $errfile, $errline), true), 'ERROR'); @@ -157,17 +168,6 @@ function Debug_Error_Handler($errno, $errstr, $errfile, $errline) return true; } - $zec = new ZbpErrorControl(); - $zee = $zec->ParseError($errno, $errstr, $errfile, $errline); - - foreach ($GLOBALS['hooks']['Filter_Plugin_Debug_Handler_ZEE'] as $fpname => &$fpsignal) { - $fpsignal = PLUGIN_EXITSIGNAL_NONE; - $fpreturn = $fpname($zee, 'Error'); - if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) { - return $fpreturn; - } - } - //这是Filter_Plugin_Zbp_ShowError接口的替代品,无须改动插件函数的参数 foreach ($GLOBALS['hooks']['Filter_Plugin_Debug_Handler_Common'] as $fpname => &$fpsignal) { $fpsignal = PLUGIN_EXITSIGNAL_NONE; @@ -210,6 +210,17 @@ function Debug_Exception_Handler($exception) $fpreturn = $fpname('Exception', $exception); } + $zec = new ZbpErrorControl(); + $zee = $zec->ParseException($exception); + + foreach ($GLOBALS['hooks']['Filter_Plugin_Debug_Handler_ZEE'] as $fpname => &$fpsignal) { + $fpsignal = PLUGIN_EXITSIGNAL_NONE; + $fpreturn = $fpname($zee, 'Exception'); + if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) { + return $fpreturn; + } + } + if (ZbpErrorControl::$islogerror) { Logs( var_export( @@ -223,17 +234,6 @@ function Debug_Exception_Handler($exception) ); } - $zec = new ZbpErrorControl(); - $zee = $zec->ParseException($exception); - - foreach ($GLOBALS['hooks']['Filter_Plugin_Debug_Handler_ZEE'] as $fpname => &$fpsignal) { - $fpsignal = PLUGIN_EXITSIGNAL_NONE; - $fpreturn = $fpname($zee, 'Exception'); - if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) { - return $fpreturn; - } - } - foreach ($GLOBALS['hooks']['Filter_Plugin_Debug_Handler_Common'] as $fpname => &$fpsignal) { $fpsignal = PLUGIN_EXITSIGNAL_NONE; $fpreturn = $fpname($zee->getCode(), $zee->getMessage(), $zee->getFile(), $zee->getLine(), $zee->getMoreInfo(), $zee->getHttpCode()); @@ -274,14 +274,6 @@ function Debug_Shutdown_Handler() $fpreturn = $fpname('Shutdown', $error); } - if (ZbpErrorControl::$islogerror) { - Logs(var_export(array('Fatal', $error['type'], $error['message'], $error['file'], $error['line']), true), 'FATAL'); - } - - if (Debug_IgnoreError($error['type'])) { - return true; - } - $zec = new ZbpErrorControl(); $zee = $zec->ParseFatal($error); @@ -293,6 +285,14 @@ function Debug_Shutdown_Handler() } } + if (ZbpErrorControl::$islogerror) { + Logs(var_export(array('Fatal', $error['type'], $error['message'], $error['file'], $error['line']), true), 'FATAL'); + } + + if (Debug_IgnoreError($error['type'])) { + return true; + } + foreach ($GLOBALS['hooks']['Filter_Plugin_Debug_Handler_Common'] as $fpname => &$fpsignal) { $fpsignal = PLUGIN_EXITSIGNAL_NONE; $fpreturn = $fpname($zee->getCode(), $zee->getMessage(), $zee->getFile(), $zee->getLine(), $zee->getMoreInfo(), $zee->getHttpCode());