·您现在的位置: 云翼网络 >> 文章中心 >> 网站建设 >> 网站建设开发 >> php网站开发 >> firePHP 小试

firePHP 小试

作者:佚名      php网站开发编辑:admin      更新时间:2022-07-23
firephp 小试

环境:

Firefox 浏览器

firebug

1.安装firephp 直接在Firefox 附加组件中搜索frephp 然后安装,重启浏览器。

2.下载FirePHPcore libariry http://www.firephp.org/HQ/Install.htm

3.引入

require_once('FirePHP/fb.php');//引入

fb('Hello World'); /* Defaults to FirePHP::LOG */fb('Log message' ,FirePHP::LOG);fb('Info message' ,FirePHP::INFO);fb('Warn message' ,FirePHP::WARN);fb('Error message',FirePHP::ERROR);

<?php/** *  * @authors hanguang ([email protected]) * @date    2015-05-08 13:34:10 * @version 1.0 */header("Content-type:text/html;charset=utf-8");require_once('FirePHP/FirePHP.class.php');$firephp = FirePHP::getInstance(true);$firephp->setEnabled(true);//false 不显示,true 显示require_once('FirePHP/fb.php');echo 'FirePHP测试';fb('Hello World'); /* Defaults to FirePHP::LOG */ fb('Log message'  ,FirePHP::LOG);fb('Info message' ,FirePHP::INFO);fb('Warn message' ,FirePHP::WARN);fb('Error message',FirePHP::ERROR); fb('Message with label','Label',FirePHP::LOG); fb(array('key1'=>'val1',         'key2'=>array(array('v1','v2'),'v3')),   'TestArray',FirePHP::LOG); function test($Arg1) { throw new Exception('Test Exception');}try { test(array('Hello'=>'World'));} catch(Exception $e) { /* Log exception including stack trace & variables */ fb($e);} fb(array('2 SQL queries took 0.06 seconds',array(   array('SQL Statement','Time','Result'),   array('SELECT * FROM Foo','0.02',array('row1','row2')),   array('SELECT * FROM Bar','0.04',array('row1','row2')) )),FirePHP::TABLE);     ?>

具体api可看http://www.firephp.org/HQ/Use.htm