示例#1
0
 /**
  * Amon Error handler
  *
  * @param  int    $severity the severity code
  * @param  string $message  the error message
  * @param  string $filepath the path to the file throwing the error
  * @param  int    $line     the line number of the error
  * @return bool   whether to continue with execution
  */
 public static function error_handler($severity, $message, $filepath, $line)
 {
     switch ($severity) {
         case E_NOTICE:
         case E_USER_NOTICE:
             $e = new Amon_Php_Notice($message, $severity, $filepath, $line);
             break;
         case E_WARNING:
         case E_USER_WARNING:
             $e = new Amon_Php_Warning($message, $severity, $filepath, $line);
             break;
         case E_STRICT:
             $e = new Amon_Php_Strict($message, $severity, $filepath, $line);
             break;
         case E_PARSE:
             $e = new Amon_Php_Parse($message, $severity, $filepath, $line);
             break;
         default:
             $e = new Amon_Php_Error($message, $severity, $filepath, $line);
     }
     self::handle_exception($e);
     return parent::error_handler($severity, $message, $filepath, $line);
 }