mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 11:44:10 +09:00
Convert paths in error message relative to RX_BASEDIR
This commit is contained in:
parent
7c4fc37dd3
commit
283a1a73bc
1 changed files with 11 additions and 2 deletions
|
|
@ -141,6 +141,15 @@ class Debug
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Rewrite the error message with relative paths.
|
||||||
|
$message = str_replace(array(
|
||||||
|
' called in ' . RX_BASEDIR,
|
||||||
|
' defined in ' . RX_BASEDIR,
|
||||||
|
), array(
|
||||||
|
' called in ',
|
||||||
|
' defined in ',
|
||||||
|
), $errstr);
|
||||||
|
|
||||||
// Get the backtrace.
|
// Get the backtrace.
|
||||||
$backtrace_args = defined('\DEBUG_BACKTRACE_IGNORE_ARGS') ? \DEBUG_BACKTRACE_IGNORE_ARGS : 0;
|
$backtrace_args = defined('\DEBUG_BACKTRACE_IGNORE_ARGS') ? \DEBUG_BACKTRACE_IGNORE_ARGS : 0;
|
||||||
$backtrace = debug_backtrace($backtrace_args);
|
$backtrace = debug_backtrace($backtrace_args);
|
||||||
|
|
@ -149,7 +158,7 @@ class Debug
|
||||||
self::$_errors[] = $errinfo = (object)array(
|
self::$_errors[] = $errinfo = (object)array(
|
||||||
'type' => self::getErrorType($errno),
|
'type' => self::getErrorType($errno),
|
||||||
'time' => microtime(true),
|
'time' => microtime(true),
|
||||||
'message' => $errstr,
|
'message' => $message,
|
||||||
'file' => $errfile,
|
'file' => $errfile,
|
||||||
'line' => $errline,
|
'line' => $errline,
|
||||||
'backtrace' => $backtrace,
|
'backtrace' => $backtrace,
|
||||||
|
|
@ -157,7 +166,7 @@ class Debug
|
||||||
|
|
||||||
// Add the entry to the error log.
|
// Add the entry to the error log.
|
||||||
$log_entry = str_replace("\0", '', sprintf('PHP %s: %s in %s on line %d',
|
$log_entry = str_replace("\0", '', sprintf('PHP %s: %s in %s on line %d',
|
||||||
$errinfo->type, $errinfo->message, $errinfo->file, intval($errinfo->line)));
|
$errinfo->type, $errstr, $errfile, intval($errline)));
|
||||||
error_log($log_entry);
|
error_log($log_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue