PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Fabrizio Parrella   bib_errors   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example script
Class: bib_errors
Log and process errors of PHP scripts
Author: By
Last change: adapted to the new class
Date: 17 years ago
Size: 1,052 bytes
 

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 :-)
?>