Principle:
1. In the process of execution, record the variables you want to track and the call stacks and the parameters of each function call in the appropriate place.
The information is recorded in a certain format to the file, a variable row, the specific data format see the code, here is not detailed.
2. Now that you have all the information (including the call stack and parameters) every time you log a variable, the program reads the entire file into analysis when you access it through the browser.
Display all your debugging information on the page, and it will be dynamically Ajax refreshed and kept synchronized with your debugging.
Draw a picture, it's much clearer.
BackTrace is the call stack information, not reflected in the diagram, is the dynamic Ajax refresh.
Function:
A few more pictures of this machine are illustrated below:
1. include file, debug variable (above is program, below is apache_request_headers () debug output)
A list of call stacks for a function of a 2.drupal system
3. Call parameters of a function in the stack
Postscript:
Program basically implemented debugging, tracking the function of PHP variables, but also with the call stack and call parameters to view the function.
Now Echo,print_r,var_dump and other system functions, if not necessary, I have very little to debug output, basically with this will be able to get what you want.
Particularly complex systems such as Drupal can clearly understand how the program is executed.
Description
The program is written in PhP4, in php4.4.8, 5.2.5 on the test, the theory is to support PHP4, PHP5.
Linux, Windows, Ie6-7, Firefox has also been tested, but still do not dare to ensure that in your environment does not make mistakes, if so, please amend yourself.
Please do not allow the log file to exceed 5M size, the browser may crash.
Download Address http://www.jb51.net/codes/20851.html