PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Nitesh Apte   Error Logging   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: usage
Class: Error Logging
Handle PHP fatal and non-fatal execution errors
Author: By
Last change: Detailed example.
Date: 9 years ago
Size: 588 bytes
 

Contents

Class file image Download
<?php
define
("DIRECT_ACCESS", TRUE);
// set the include path
set_include_path(get_include_path().PATH_SEPARATOR."lib/whereever your Errorlogging file is");
//example
set_include_path(get_include_path().PATH_SEPARATOR."lib/errorlogging");


/**
 * autoload method for dynamically loading classes.
 *
 * @param object $object Name of Class
 * @return none
 */
function __autoload($object) {
    require_once(
"class.{$object}.php");
}

$errorHandler = ErrorHandler::getInstance();
$errorHandler->enableHandler();

include_once
'definitions.php'; // this will display error.