Use firephp to debug php projects and firephp to debug php
Some time ago, I was writing a project with over 5000 lines of a base class, and debugging was just vomiting blood.
Poor things changed. Finally, I found a good way to debug the PHP project on the Internet. Thank you for your contributions!
Client:
1. Installed Firebug.
Firebug: https://addons.mozilla.org/zh-CN/firefox/addon/1843
2. Install the FirePHP plug-in.
FirePHP: https://addons.mozilla.org/zh-CN/firefox/addon/6149
Server files: http://www.firephp.org/DownloadR... y-FirePHPCore-0.2.1
A. Introduce code
1 require_once ('firephpcore/fb. php'); // we recommend that you introduce this file. File directory. This is also the case with pear installation.
Example:
<? Phpinclude_once ('firephp/fb. php'); FB: log ('Hello World! '); // General record FB: group ('test Group A'); // record group // you can record the information in different categories or types as follows :: log ('plain message'); FB: info ('info message'); FB: warn ('warn' Message); FB :: error ('error message'); FB: log ('message', 'optional label'); FB: groupEnd (); FB :: group ('test Group B '); FB: log ('Hello World B'); FB: log ('plain message'); FB :: info ('info message'); FB: warn ('warn' Message); FB: error ('error message'); FB: log ('message ', 'optional Label '); FB: groupEnd (); // output the information as a table $ table [] = array ('col 1 heading', 'col 2 heading ', 'col 2 heading'); $ table [] = array ('row 1 Col 1', 'row 1 Col 2', 'row 1 Col 2 '); $ table [] = array ('row 2 Col 1', 'row 2 Col 2'); $ table [] = array ('row 3 Col 1 ', 'row 3 Col 2'); FB: table ('table label', $ Table ); // use FirePHPclass MyException extends Exception {public function _ construct ($ message, $ code) {parent: _ in Exception Handling ::_ _ Construct ($ message, $ code);} public function log () {FB: log ($ this-> getMessage () ;}try {echo 'moxie '; throw new MyException ('some description', 1);} catch (MyException $ e) {$ e-> log () ;}?>