Principle:
1. During the execution of the program, record the variables you want to trace, the call stacks, and the parameters of each function call in the appropriate place,
This information is recorded in a certain format to the file, a variable line, the specific data format please see the code, here is not detailed.
2. Now that you have all the information (including the call stack and parameters) every time the variable is recorded, when you access the program through the browser, the program will read the entire file analysis,
All of your debugging information is displayed on the page, and it will be dynamically Ajax refreshed to keep you in sync with your debugs.
Draw a picture, it's much clearer.
BackTrace is the call stack information, not reflected in the diagram, is the Ajax dynamic refresh.
Function:
A few more copies of the machine are illustrated below:
1. Include the file, debug the variable (above is the program, the following is the debug output of Apache_request_headers ())
A list of call stacks for a function of 2.drupal system
3. Call parameters for a function in the stack
Postscript:
The program basically implements debugging, tracking PHP variable function, also comes with the call stack and call parameter view function.
Now echo,print_r,var_dump, such as system functions, if not necessary, I have rarely used to debug the output, basically with this can get what you want.
In particular, a complex system such as Drupal can clearly know how the program is executed.
Description
The program is written in PhP4, in php4.4.8, 5.2.5 tested, theoretically support PHP4, PHP5.
Linux, window, Ie6-7, Firefox has been tested, but still do not guarantee that in your environment is not wrong, if so, please fix it yourself.
Please do not let the log file exceed 5M size, the browser may crash.
Download Address http://www.jb51.net/codes/20851.html
http://www.bkjia.com/PHPjc/320486.html www.bkjia.com true http://www.bkjia.com/PHPjc/320486.html techarticle principle: 1. In the process of program execution, record the variables you want to track and the parameters of the call stack and each function call in the corresponding place, record the information in a certain format to the file, a ...