Introducing The Debugger & Logger Component
The goal of this class is to ease the process of debugging php scripts. The class uses a floating panel at the top right of the page. There are also a couple of features that can fix security issues with the php default error handler. All class properties and methods are static because it's required to let them work on script shutdown when FATAL error occurs. Click here to show the interface!
- Show globals vars ($GLOBALS, $_POST, $_GET, $_COOKIE ...)
- Show php version and loaded extensions
- Replace php built in error handler
- Log sql queries
- Monitor code and sql queries execution time
- Inspect variables for changes
- Function calls tracing
- Code coverage analysis to check which lines of script where executed
- Dump of all types of variable
- File inspector with code highlighter to view source code
- Send messages to js console(Chrome only), for ajax scripts
The class works right out of the box by calling the static method load().
Download PtcDebug.php from the repository and add the following 4 lines of code at the very start of your script or application:
- $_GET['debug']=true; // turn on the debug
- //$_GET['debug_off']=true; // turn off debug
For a complete list of options and more examples see the user guide.