PHP Classes

Simple error handling class: Intercept and log PHP execution errors

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 52%Total: 1,958 All time: 2,008 This week: 571Up
Version License PHP version Categories
errormanager 1.1GNU Lesser Genera...5.0PHP 5, Logging


This class can be use to intercept and log PHP execution errors.

It can enable PHP execution error logging setting the file that logs error messages.

The class provides an error handler function that outputs a stack back-trace with the functions, arguments, file and lines of where an error occurs, as well the values of super-global variables $_GET, $_POST and $_FILES, and also the IP address of the current user accessing the site.

The class may also enable of disable the output of error messages to Web pages and change the error reporting level.

When used together with my Mysql class (or any other mysql class that calls trigger_error when there was mysql_error) it can effectively log all mysql errors with the complete stacktrace what you can inspect from the logfile later on.
Plus you can identify sql injections when someone's queries keep failing with error messages.

You can also specify error codes that exit the script execution plus your own callback function that will be called before exiting (good to display some nice error page to users before exiting script execution).

Picture of Indrek Altpere
Name: Indrek Altpere <contact>
Classes: 3 packages by
Country: Estonia Estonia
Age: 38
All time rank: 8022 in Estonia Estonia
Week rank: 258 Up1 in Estonia Estonia Up

  Files folder image Files  
File Role Description
Accessible without login Plain text file ErrorManager.php Class Main class file
Accessible without login Plain text file test.php Example testing example

 Version Control Reuses Unique User Downloads Download Rankings  
This week:0
All time:2,008
This week:571Up
 User Ratings  
 All time