PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of V. Yanson  >  RS Error  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example usage
Class: RS Error
Handle errors by logging or displaying messages
Author: By
Last change:
Date: 8 years ago
Size: 445 bytes
 

Contents

Class file image Download
<?php

include_once('class.error.php');

// app error handling
function errorHandler($code, $msg, $file, $line)
{
  
$err = new iowacore2_error($code, $msg, $file, $line);
  
$err->writeToLog(); // log error
  
$err->displayError(); // show error
}
set_error_handler('errorHandler', ERROR_LEVEL);

// PEAR error handling
$error = new iowacore2_error();
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(&$error, 'errorCallback'));