Heim >Backend-Entwicklung >PHP-Tutorial >利用firephp调试php项目

利用firephp调试php项目

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:42:36817Durchsuche

前段时间在写一个项目一个基类5000多行,调试起来简直吐血。

穷则思思则变呀,最后在网上找到了一个调试PHP项目的好方法。感谢前辈的奉献!



客户端:

1.安装了Firebug。
Firebug:https://addons.mozilla.org/zh-CN/firefox/addon/1843
2.安装FirePHP插件。
FirePHP:https://addons.mozilla.org/zh-CN/firefox/addon/6149


服务器端文件下载地址: http://www.firephp.org/DownloadR ... y-FirePHPCore-0.2.1
  a、引入代码

1 require_once('FirePHPCore/fb.php'); // 建议引入此文件即可。文件目录自行安排。使用pear方式安装也是这样引入。
范例:

<?phpinclude_once ('FirePHP/fb.php');FB::log('Hello World !'); // 常规记录FB::group('Test Group A'); // 记录分组// 以下为按照不同类别或者类型进行信息记录FB::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();// 将信息作为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);// 在异常处理中使用FirePHPclass MyException extends Exception{    public function  __construct($message, $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();}?>
效果图



Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:PHP 类与对象 全解析( 二)Nächster Artikel:phpcms怎么深入学?