Use firephp to debug php projects and firephp to debug php

Source: Internet
Author: User

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 () ;}?>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.