/[drupal]/contributions/modules/civicrm_error/civicrm_error.module
ViewVC logotype

Diff of /contributions/modules/civicrm_error/civicrm_error.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.3, Mon Jul 23 22:03:20 2007 UTC revision 1.1.2.4, Wed Jul 25 22:21:58 2007 UTC
# Line 1  Line 1 
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
# Line 16  function civicrm_error_handler($civicrm_ Line 16  function civicrm_error_handler($civicrm_
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    
# Line 80  function _civicrm_error_check_length($it Line 80  function _civicrm_error_check_length($it
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  }  }

Legend:
Removed from v.1.1.2.3  
changed lines
  Added in v.1.1.2.4

  ViewVC Help
Powered by ViewVC 1.1.2