function _fp_map_php_error_code

7.x misc.inc _fp_map_php_error_code($code)
6.x misc.inc _fp_map_php_error_code($code)
5.x misc.inc _fp_map_php_error_code($code)
  • Map an error code into an Error word

*

Parameters

int $code Error code to map:

  • @return array Array of error word, and log location.
1 call to _fp_map_php_error_code()
_fp_error_handler in includes/misc.inc
This is our custom error handler, which will intercept PHP warnings, notices, etc, and let us display them, log them, etc.

File

includes/misc.inc, line 557
This file contains misc functions for FlightPath

Code

function _fp_map_php_error_code($code) {
  $error = '';
  switch ($code) {
    case E_PARSE:
    case E_ERROR:
    case E_CORE_ERROR:
    case E_COMPILE_ERROR:
    case E_USER_ERROR:
      $error = 'Fatal Error';
      break;
    case E_WARNING:
    case E_USER_WARNING:
    case E_COMPILE_WARNING:
    case E_RECOVERABLE_ERROR:
      $error = 'Warning';
      break;
    case E_NOTICE:
    case E_USER_NOTICE:
      $error = 'Notice';
      break;
    case E_STRICT:
      $error = 'Strict';
      break;
    case E_DEPRECATED:
    case E_USER_DEPRECATED:
      $error = 'Deprecated';

      break;
    default :
      break;
  }

  return $error;
}