PHP Classes
Icontem

File: example.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Fabrizio Parrella  >  bib_errors  >  example.php  
File: example.php
Role: Example script
Content type: text/plain
Description: example script
Class: bib_errors
Log and process errors of PHP scripts
 

Contents

Class file image Download
<?php
/*
no change in the configuration is required
I suggest only that you change

     $_cfg['error_log']

by writing
 
if(!isset($_cfg['error_log']))        $_cfg['error_log']        = $_SERVER['DOCUMENT_ROOT'].'/error.log';        //file log

to avoid to intercept other sites errors.

the parameters that you can change are:

$_cfg['admin_email']    //this address will receive the email (default is the server_admin)
$_cfg['code']           //a code that you assign to the website (default is the server_name)
$_cfg['show_errors']    //if show the errors on the page or not (default from php.ini)
$_cfg['log_errors']     //if you want or not log the errors (this will overwrite php.ini- default from php.ini)
$_cfg['error_log']      //where the logfile is (this will overwrite php.ini - default from php.ini)
$_cfg['email_errors']   //if you want to receive an email for each error
*/
error_reporting(E_ALL); //if PHP5, use E_STRICT
require_once dirname(__FILE__).'/_class_bib_errors.php';

//here your script, with errors and more :-)
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products