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