Extension Key: cc_debug
Copyright 2000-2002, René Fritz, <r.fritz@colorcube.de>
This document is published under the Open Content License
available from http://www.opencontent.org/opl.shtml
The content of this document is related to TYPO3
- a GNU/GPL CMS/Framework available from www.typo3.com
The CCDebug extension provides extended functionality for PHP debugging inside of TYPO3.
The well known debug() function of TYPO3 prints all types of variables on top of a generated HTML page. This extension do similar but in a better way.
This works only on TYPO3 3.6 without patching the core. Read install instructions!
The main functionality is written by Dan Allen and is called errorReporter (see http://www.mojavelinux.com/cooker/demos/errorReporter/ ). The errorReporter code is adapted to TYPO3 into this extension. I made also some changes and small enhancements.
The main change to the functionality of errorReporter is the use of Luite van Zelst <luite@aegee.org> variable dump function which I like better than the original PHP code printer.
Ok, what in the end do CCDebug?In contrast to debug() which prints all output immediately, CCDebug collects all debug messages and opens a separate window for output. Also a small bomb in the upper right corner of the original page indicates errors. A click on the bomb icon opens the debug window. The bomb is a layer and will not destroy your page layout.
Let's have a look what Dan Allen wrote about errorReporter:
“The error reporter is meant to sit on top of your application. PHP throws errors and you usually just see the PHP warning messages at the top of the page, catch the line and reload. But when you are doing more intricate applications, this is often not a convenient way to debug. Usually errors are thrown inside of functions which take large arrays and the error might be a little undefined index error.
When this script is initialized, it begins trapping all the non-fatal errors which occur on the page. When the page is finished loading, the Reporter object iterates over all of the captured errors and performs the specified reports based on the error level. This example demonstrates the 'console' report, which is a secondary window which can be opened to view the errors, source code and context at the time the error was thrown. (optional reports include email, file, system, browser and stdout, each to be used in the appropriate environment).
Each error report can take a minimum level onto which to act. This can be nice for a "live" system to send e-mail reports when a critical error occurs.”
In the CCDebug extension I deactivated the error handler which means that error messages from PHP are not piped into the debug window. I found it not very useful because PHP stops normally with a fatal error which will not be piped into the debug window for some reason and all the notices like 'Undefined index: ...' are boring :-)Anyway you can reactivate this feature by yourself.
The code also provide to output into a file, mail, ..., but haven't tried that yet.