Beispiel #1
0
 /**
  * PEAR error handler
  *
  * @param object $error PEAR Error object
  *
  * @return void
  * @ignore
  */
 public static function onPearError(PEAR_Error $error)
 {
     $trace = debug_backtrace();
     array_shift($trace);
     array_shift($trace);
     array_shift($trace);
     $options['file'] = $trace[0]['file'];
     $options['line'] = $trace[0]['line'];
     $options['trace'] = $trace;
     $options['package'] = self::PACKAGE_PEAR;
     $debugInfo = $error->getDebugInfo();
     $userInfo = $error->getUserInfo();
     $trace = $error->getBackTrace();
     $info = array('Error Type' => $error->getType(), 'Debug Info' => $error->getUserInfo());
     if ($debugInfo !== $userInfo) {
         $info['User Info'] = $userInfo;
     }
     if (self::$_config[self::CONFIG_DEBUG] === true) {
         self::error('PEAR Error', $error->getCode() . ' ' . $error->getMessage(), $info, $options);
     } else {
         error_log('PEAR Error' . $error->getCode() . ' ' . $error->getMessage() . " in file[{$options['file']}] on line [{$options['line']}", 0);
     }
 }