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,957 All time: 2,007 This week: 176Up
Version License PHP version Categories
errormanager 1.1GNU Lesser Genera...5.0PHP 5, Logging
Description 

Author

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: 37
All time rank: 8022 in Estonia Estonia
Week rank: 312 Up2 in Estonia Estonia Equal

  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  
 0%1
Total:1,957
This week:0
All time:2,007
This week:176Up
 User Ratings  
 
 All time
Utility:75%StarStarStarStar
Consistency:70%StarStarStarStar
Documentation:-
Examples:75%StarStarStarStar
Tests:-
Videos:-
Overall:52%StarStarStar
Rank:2399