| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
// $Id: civicrm_error.module,v 1.1.2.2 2007/07/23 18:13:52 dalin Exp $ |
// $Id: civicrm_error.module,v 1.1.2.3 2007/07/23 22:03:20 dalin Exp $ |
| 4 |
|
|
| 5 |
/** |
/** |
| 6 |
* Custom error function |
* Custom error function |
| 16 |
|
|
| 17 |
// civicrm error details |
// civicrm error details |
| 18 |
if ($civicrm_error) { |
if ($civicrm_error) { |
| 19 |
$output .= "\n\n***CIVICRM ERROR***\n"; |
$output .= "\n\n\n\n***CIVICRM ERROR***\n"; |
| 20 |
$output .= _civicrm_error_parse_array($civicrm_error); |
$output .= _civicrm_error_parse_array($civicrm_error); |
| 21 |
} |
} |
| 22 |
|
|
| 23 |
// php error details |
// php error details |
| 24 |
if (function_exists('error_get_last')) { |
if (function_exists('error_get_last')) { |
| 25 |
$output .= "\n\n***PHP ERROR***\n"; |
$output .= "\n\n\n\n\n***PHP ERROR***\n"; |
| 26 |
$output .= _civicrm_error_parse_array(error_get_last()); |
$output .= _civicrm_error_parse_array(error_get_last()); |
| 27 |
} |
} |
| 28 |
elseif ($php_errormsg) { |
elseif ($php_errormsg) { |
| 29 |
$output .= "\n\n***PHP ERROR***\n"; |
$output .= "\n\n\n\n\n***PHP ERROR***\n"; |
| 30 |
$output .= _civicrm_error_parse_array($php_errormsg); |
$output .= _civicrm_error_parse_array($php_errormsg); |
| 31 |
} |
} |
| 32 |
|
|
| 33 |
// user info |
// user info |
| 34 |
global $user; |
global $user; |
| 35 |
$output .= "\n\n***USER***\n"; |
$output .= "\n\n\n\n\n***USER***\n"; |
| 36 |
$output .= _civicrm_error_parse_array($user); |
$output .= _civicrm_error_parse_array($user); |
| 37 |
|
|
| 38 |
// $_SERVER |
// $_SERVER |
| 39 |
$output .= "\n\n***SERVER***\n"; |
$output .= "\n\n\n\n\n***SERVER***\n"; |
| 40 |
$output .= _civicrm_error_parse_array($_SERVER); |
$output .= _civicrm_error_parse_array($_SERVER); |
| 41 |
|
|
| 42 |
// $_REQUEST |
// $_REQUEST |
| 43 |
$output .= "\n\n***REQUEST***\n"; |
$output .= "\n\n\n\n\n***REQUEST***\n"; |
| 44 |
$output .= _civicrm_error_parse_array($_REQUEST); |
$output .= _civicrm_error_parse_array($_REQUEST); |
| 45 |
|
|
| 46 |
// backtrace |
// backtrace |
| 47 |
$backtrace = debug_backtrace(); |
$backtrace = debug_backtrace(); |
| 48 |
$output .= "\n\n***BACKTRACE***\n"; |
$output .= "\n\n\n\n\n***BACKTRACE***\n"; |
| 49 |
foreach ($backtrace as $call) { |
foreach ($backtrace as $call) { |
| 50 |
$output .= "**next call**\n"; |
$output .= "\n\n**next call**\n"; |
| 51 |
$output .= _civicrm_error_parse_array($call); |
$output .= _civicrm_error_parse_array($call); |
| 52 |
} |
} |
| 53 |
|
|
| 80 |
return ' '; |
return ' '; |
| 81 |
} |
} |
| 82 |
if (strlen($item) > 2000) { |
if (strlen($item) > 2000) { |
| 83 |
$item = substr($item, 0, 2000) .'...'; |
$item = substr($item, 0, 4000) .'...'; |
| 84 |
} |
} |
| 85 |
return $item; |
return $item; |
| 86 |
} |
} |