/[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, Fri Jul 20 15:44:34 2007 UTC revision 1.1.2.1, Mon Jul 23 18:11:49 2007 UTC
# Line 1  Line 1 
1  <?php  <?php
2    
3  // $Id$  // $Id: civicrm_error.module,v 1.1 2007/07/20 15:44:34 dalin Exp $
4    
5  /**  /**
6   *  Custom error function   *  Custom error function
# Line 17  function civicrm_error_handler() { Line 17  function civicrm_error_handler() {
17    // error details    // error details
18    if (function_exists('error_get_last')) {    if (function_exists('error_get_last')) {
19      $output .= "\n\n***ERROR***\n";      $output .= "\n\n***ERROR***\n";
20      $output .= print_r(error_get_last(), true);      $output .= _civicrm_error_parse_array(error_get_last());
21      }
22      elseif ($php_errormsg) {
23        $output .= "\n\n***ERROR***\n";
24        $output .= _civicrm_error_parse_array($php_errormsg);
25    }    }
26    
27    // user info    // user info
# Line 26  function civicrm_error_handler() { Line 30  function civicrm_error_handler() {
30    $output .= _civicrm_error_parse_array($user);    $output .= _civicrm_error_parse_array($user);
31    
32    // $_SERVER    // $_SERVER
   global $_SERVER;  
33    $output .= "\n\n***SERVER***\n";    $output .= "\n\n***SERVER***\n";
34    $output .= _civicrm_error_parse_array($_SERVER);    $output .= _civicrm_error_parse_array($_SERVER);
35    
36      // $_REQUEST
37      $output .= "\n\n***REQUEST***\n";
38      $output .= _civicrm_error_parse_array($_REQUEST);
39    
40    // backtrace    // backtrace
41    $backtrace = debug_backtrace();    $backtrace = debug_backtrace();
42    $output .= "\n\n***BACKTRACE***\n";    $output .= "\n\n***BACKTRACE***\n";
# Line 41  function civicrm_error_handler() { Line 48  function civicrm_error_handler() {
48    // send email    // send email
49    $subject = 'CiviCRM error at '. $site;    $subject = 'CiviCRM error at '. $site;
50    $to = variable_get('civicrm_error_to', variable_get("site_mail", ini_get("sendmail_from")));    $to = variable_get('civicrm_error_to', variable_get("site_mail", ini_get("sendmail_from")));
51      print_r($output);
52      die;
53    drupal_mail('civicrm_error', $to, $subject, $output);    drupal_mail('civicrm_error', $to, $subject, $output);
54    
55  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

  ViewVC Help
Powered by ViewVC 1.1.2