Documentación GVHIDRA 3.1.5
Referencia de la Clase gvHidraErrorHandlers

Métodos públicos estáticos

static error_handler ($number, $string, $file, $line, $context)
static error_alert ()
static errorText ($code)

Métodos privados estáticos

static log ($type, $msg, $debug=true)

Atributos privados estáticos

static $error_list
static $str_fmt = 'PHP %s: %s in %s on line %d'

Descripción detallada

Clase con mtodos estticos

Definición en la línea 60 del archivo gvHidraErrorHandlers.php.


Documentación de las funciones miembro

static error_alert ( ) [static]

Mtodo invocado al final de cada peticion para detectar si se ha acabado con error

Definición en la línea 127 del archivo gvHidraErrorHandlers.php.

        {
                $e = error_get_last();
                if (!is_null($e))
                        if ($e['type'] != E_STRICT and $e['type'] != E_NOTICE)
                                self::log(ERROR, sprintf(self::$str_fmt, self::errorText($e['type']), $e['message'], $e['file'], $e['line']));
        }
static error_handler ( number,
string,
file,
line,
context 
) [static]

Manejador de errores, usado en set_error_handler Si el error es uno que para la ejecucin, lo convierte en Excepcion El resto los envia al debug o al log del apache

Definición en la línea 95 del archivo gvHidraErrorHandlers.php.

        {
            // Determine if this error is one of the enabled ones in php config (php.ini, .htaccess, etc)
            $error_is_enabled = (bool)($number & ini_get('error_reporting') );
           
            // -- FATAL ERROR
            // throw an Error Exception, to be handled by whatever Exception handling logic is available in this context
            if( in_array($number, array(E_USER_ERROR, E_RECOVERABLE_ERROR)) && $error_is_enabled ) {
                throw new ErrorException($string, 0, $number, $file, $line);
            }
           
            // -- NON-FATAL ERROR/WARNING/NOTICE
            // Log the error if it's enabled, otherwise just ignore it
            elseif( $error_is_enabled ) {
                        self::log(WARNING, sprintf(self::$str_fmt, self::errorText($number), $string, $file, $line), ($number!=E_STRICT));
                return false; // Make sure this ends up in $php_errormsg, if appropriate

                // otros
            } else {
                        if (!in_array($number, array(E_STRICT, E_NOTICE, E_WARNING)) or 
                            (SHOW_DEPRECATED and 
                             (SHOW_COMPILED or strpos($file,'/templates_c/')===false) and
                             (SHOW_gvHIDRA  or strpos($file,'/igep/')===false))
                           )
                        self::log(NOTICE, sprintf(self::$str_fmt, self::errorText($number), $string, $file, $line), ($number!=E_STRICT));
                    return false;
            }
        }
static errorText ( code) [static]

Traduce el codigo de error al nombre de la constante en texto Devuelve UNKNOWN si no existe

Definición en la línea 139 del archivo gvHidraErrorHandlers.php.

        {
                if (array_key_exists($code, self::$error_list))
                        return self::$error_list[$code];
                return 'UNKNOWN ('.$code.')';
        }
static log ( type,
msg,
debug = true 
) [static, private]

Metodo para enviar mensaje a IgepDebug o a log de apache, segun el punto donde ocurra Para que funcione IgepDebug, ha de hacerse incluido ya la clase ComponentesMap, la ultima de include_class.php Adems el codigo del propio IgepDebug tiene errores E_STRICT y E_NOTICE (dificiles de solucionar porque son del PEAR), por lo que no podemos registrarlos en l.

Definición en la línea 152 del archivo gvHidraErrorHandlers.php.

        {
                if ($debug and class_exists('ComponentesMap'))
                        IgepDebug::setDebug($type, $msg);
                else
                        error_log($msg, 0);
        }

Documentación de los campos

$error_list [static, private]
Valor inicial:
 array(
                E_ERROR => 'E_ERROR',
                E_WARNING => 'E_WARNING',
                E_PARSE => 'E_PARSE',
                E_NOTICE => 'E_NOTICE',
                E_CORE_ERROR => 'E_CORE_ERROR',
                E_CORE_WARNING => 'E_CORE_WARNING',
                E_COMPILE_ERROR => 'E_COMPILE_ERROR',
                E_COMPILE_WARNING => 'E_COMPILE_WARNING',
                E_USER_ERROR => 'E_USER_ERROR',
                E_USER_WARNING => 'E_USER_WARNING',
                E_USER_NOTICE => 'E_USER_NOTICE',
                E_STRICT => 'E_STRICT',
                E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',



                E_ALL => 'E_ALL',
                )

Lista de tipos de errores posibles

Definición en la línea 65 del archivo gvHidraErrorHandlers.php.

$str_fmt = 'PHP %s: %s in %s on line %d' [static, private]

Formato usado para mostrar errores

Definición en la línea 88 del archivo gvHidraErrorHandlers.php.


La documentación para esta clase fue generada a partir del siguiente fichero: