49 function error_handler($errno, $errstr, $errfile, $errline, $errcontext) {
50 if (!(error_reporting() & $errno)) {
54 $exit = ($errno === E_USER_ERROR);
56 $message =
'PHP error '.$errno.
' "'.$errstr.
'" 57 line '.$errline.
' in "'.$errfile.
'" 61 '.print_r($errcontext,
true).
'debug_backtrace: 62 '.print_r(debug_backtrace(),
true);
82 require
'OPiQuotations/.private/db_login.inc';
84 return (empty($db_password)
86 : preg_replace(
'/'.preg_quote($db_password,
'/').
'/',
'****',
87 preg_replace(
'/\[password\]\s*=>\s*\S+/i',
'[password] => ****', $s)));
105 if (!is_string($message) ) {
106 $message =
'This error message wasn\'t a string! 107 '.print_r($message,
true);
110 $dt = new \DateTime();
112 $message =
'*************************************** 113 *** '.$dt->format(
'r').
' *** 114 *************************************** 128 error_log($message, 3, realpath(realpath(dirname(__FILE__).DIRECTORY_SEPARATOR.
'..'.DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.LOG_FILE));
130 require_once
'OPiQuotations/.private/log_email.inc';
132 if (!empty($log_email)) {
133 error_log($message, 1, $log_email);
to_log($message)
Append $message in LOG_FILE.
error_handler($errno, $errstr, $errfile, $errline, $errcontext)
Error handler function.
const LOG_FILE
Filename of errors log file.
hide_password($s)
If $s contains an element '[password] => ...' then hides the password value.