PHP Classes

File: public/warning-handler.php

Recommend this page to a friend!
  Classes of Fabrice Fesch  >  Melis PHP CMS Skeleton  >  public/warning-handler.php  >  Download  
File: public/warning-handler.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Melis PHP CMS Skeleton
Setup the Melis CMS application on a given domain
Author: By
Last change:
Date: 1 year 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);

For more information send a message to info at phpclasses dot org.