PHP Classes

File: public/warning-handler.php

Recommend this page to a friend!
  Classes of Fabrice Fesch   Melis PHP Platform Skeleton   public/warning-handler.php   Download  
File: public/warning-handler.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Melis PHP Platform Skeleton
Setup a site to run using the Melis platform
Author: By
Last change:
Date: 4 years ago
Size: 602 bytes
 

Contents

Class file image Download
<?php
/**
 * Custom warning handler
 *
 * @param integer $code
 * @param string $description
 * @param string $file
 * @param interger $line
 * @return boolean
 */
function _melisHandleWarning($code, $description, $file = null, $line = null)
{
    if (
error_reporting() === 0) {
        return
false;
    }

   
$data = array(
       
'code' => $code,
       
'description' => $description,
       
'file' => $file,
       
'line' => $line,
    );

   
$_SESSION['melis_php_warnings'][] = $data;

    return
true;
}

//calling custom warning handler
set_error_handler("_melisHandleWarning", E_WARNING);