PHP Classes

Easy Debug: Handle errors and measure PHP execution time

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStar 58%Total: 697 All time: 4,705 This week: 455Up
Version License PHP version Categories
easy-debug 1.0Free for non-comm...5.0PHP 5, Time and Date, Debug
Description 

Author

This class can be used to handle errors and measure PHP execution time.

It provides an error handler that is called when a PHP error occurs. The handler can display the names of functions and arguments that were called where the error occurred.

The class can also measure the time different PHP script sections take to execute.

Picture of adrien gibrat
Name: adrien gibrat <contact>
Classes: 5 packages by
Country: France France
Age: 45
All time rank: 23216 in France France
Week rank: 206 Up8 in France France Up
Innovation award
Innovation award
Nominee: 2x

Details

Easy to use: Just include the class file and it automatically replace the default error handler! You can turn the display of error infos off & on at runtine, using debug::$on = false; debug::$on = true; You can use it anytime in you code ;) To use the chrono: debug::chrono(); // set the timer debug::chrono('your message'); // display your message & time elapsed since last chrono call debug::chrono(true); // display a table with all messages & times You can also use several chrono at the same time by passing chrono name as second argument: debug::chrono( null, 'chrono1' ); // set the timer of chrono 1 usleep( 5000 ); debug::chrono( null, 'chrono2' ); // set the timer of chrono 2 debug::chrono( 'your message 1', 'chrono1' ); // display your message & time elapsed since last chrono 1 call usleep( 5000 ); debug::chrono( 'your message 2', 'chrono2' ); // display your message & time elapsed since last chrono 2 call debug::chrono( true, 'chrono1' ); // display a table with all messages & times of chrono 1 debug::chrono( true, 'chrono2' ); // display a table with all messages & times of chrono 2 Error display template: ---------------------------------------------------------------------- [Error Type]: [Full Error message] in [path and filename] on line xxx Stack trace: #0 [path and filename](xxx): [code where error occured] #1 [path and filename](xxx): [Function call backtrace] #2 [path and filename](xxx): [Function call backtrace] #3 {main} Context: $var1 = [value]; $var2 = [value]; ... Chrono display example: ---------------------------------------------------------------------- -> message 1: x.xxxs -> message 2: x.xxxs -> message n: x.xxxs chrono [name] ------------------------------------------------------- unit - action duration ------------------------------------------------------- 1 - message 1 x.xxxs x.xx - message 2 x.xxxs x.xx - message n x.xxxs

  Files folder image Files (2)  
File Role Description
Plain text file debug.php Class The Class
Accessible without login Plain text file Readme Doc. Instructions, how the use the class

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:697
This week:0
All time:4,705
This week:455Up
 User Ratings  
 
 All time
Utility:83%StarStarStarStarStar
Consistency:83%StarStarStarStarStar
Documentation:83%StarStarStarStarStar
Examples:-
Tests:-
Videos:-
Overall:58%StarStarStar
Rank:1472