Skip to content

Commit

Permalink
调整了debug里的接口顺序;
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowsoft committed Dec 6, 2024
1 parent 61b998d commit 77c00a1
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions zb_system/function/c_system_debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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;
Expand Down Expand Up @@ -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(
Expand All @@ -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());
Expand Down Expand Up @@ -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);

Expand All @@ -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());
Expand Down

0 comments on commit 77c00a1

Please sign in to comment.