debugging PHP projects with firephp

Source: Internet
Author: User

A period of time before writing a project a base class of more than 5,000 lines, debugging up simply vomiting blood.

Poor thinking is changed, finally found on the internet a good way to debug PHP project. Thank the predecessors for their dedication!



Client:

1. The Firebug is installed.
firebug:https://addons.mozilla.org/zh-cn/firefox/addon/1843
2. Install the firephp plugin.
firephp:https://addons.mozilla.org/zh-cn/firefox/addon/6149


Server-side files: Http://www.firephp.org/DownloadR ... y-firephpcore-0.2.1
A. Introduce code

1 require_once (' firephpcore/fb.php '); It is recommended that you introduce this file. The file directory is self-arranged. Installation using the Pear method is also introduced.
Example:

<?phpinclude_once (' firephp/fb.php '); Fb::log (' Hello world! '); General record Fb::group (' Test group A '); Record grouping//The following are information records Fb::log (' Plain message ') in different categories or types; 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 ();//information as table output $table[] = Array (' col 1 Heading ', ' Col 2 Heading ', ' Col 2 Heading '); $table [] = Array (' Row 1 Co L 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 in exception handling ($m    Essage, $code) {parent::__construct ($message, $code);    Public Function log () {Fb::log ($this->getmessage ()); }}try{echo ' MoXie ';   throw new MyException (' Some description ', 1);} catch (MyException $e) {$e->log ();}? >



debugging PHP projects with firephp

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.