PHP Classes
elePHPant
Icontem

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    
Last Updated Ratings Unique User Downloads Download Rankings
2016-06-18 (4 months ago) RSS 2.0 feedStarStarStar 57%Total: 1,881 This week: 1All time: 2,033 This week: 1,047Up
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

  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,881
This week:1
All time:2,033
This week:1,047Up
 User Ratings  
 
 All time
Utility:83%StarStarStarStarStar
Consistency:75%StarStarStarStar
Documentation:-
Examples:83%StarStarStarStarStar
Tests:-
Videos:-
Overall:57%StarStarStar
Rank:1418