首页 > 编程 > PHP > 正文

firePHP 小试

2019-11-15 02:13: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 (hg0728@QQ.com) * @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


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表