您所在的位置:小祥子 » 编程 » PHP » 正文

firePHP 小试

时间:2015-05-11 编辑:韩某人 来源:本站整理

环境:

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);

JSeBFkngPHNoqgvEQSpB3Dz9pKouRq4gCCIBfzr20VR12vgwoULFEEQSimlcGt+SRRaC0HqAnxTWBJ1owbQWgjCgW/vLIn6Zw2gtRCEA/PFu6KMGkBrIQgH7pTuivqqBtBaCMKBhdKyqLVqLY0QXXyuE6JJbrIBTSBrGCiWl0XdrAEJ1tKJAgAK0dkj1WcwayqwMuIxvkUrNqESogAoqqqINa0QlqcJnSjVHI1sCKC0uCzqXzUgJWvpRGWDVVMrD1u7FENTq7WWVdas3p39VjxshTiQDQuUF5dF3aqBRlnLTFOOpBFsLeuACtbUiUp0nSigamySx7ISa8I8XNWsf4OawKyFMGBxaVnU1zUgyVoKv3FWIbo4ooUME2QtO9tVynuaqmoaURSFEGLOPdnB9iNN9cz/hCZ4OcxaiAXcvbssahVay5m1RKuBMLYrWkt8q8I0USeqohJdUxWFaC7PqFam9BzpcC/3IloLMYG7y1TUNzXQmAmhrz1qy1pUU0HVqE4Uhei0QtYKthafq+KEEDGB5WUq6nYNNOoKoWtdw5+y50JeE2Zzgesg5kwh+XjXWmKWrNiEouA1QsQEXM9XmbUQZK3ittZ8DaC1EISD1kIQKbitVagBtBaCcNzWulMDaC0E4dTZWgiCmLitVayBC5i1EMQCrYUgUnBbq1QDaC0E4bitVa4BtBaCcNBaCCIFt7UWawCthSAct7WWagCthSAct7Xu1oAMa1XeEgNBVjVuay3XgJyshbdAIWuSNWgt581UVLyfyudeKV5a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6CeIvRqAKgJg0tmeTtug/B65wbQ3I/Mp45fPjSli2VPjKefuCB/Kuvht4FMmQbqfIaD7W+Jf2LTjOvvDIciRTvu080VQlgJBLJv/RS6OePQklSI76eW5qezu3fn2ltHXv44ey2bZnW1rFYbGFqKvSTR6HkCW8qQaGkCK2FQkkR7o2BIFKo+45OCIJQSun/Ax6L76OHUV84AAAAAElFTkSuQmCC" border="0" onload="return imgzoom(this,600);"/>

<?php
/**
 * 
 * @authors hanguang (hg0728@qq.com)
 * @date    2015-05-08 13:34:10
 * @version 1.0
 */
("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::);
fb('Info message' ,FirePHP::INFO);
fb('Warn message' ,FirePHP::WARN);
fb('Error message',FirePHP::ERROR);
 
fb('Message with label','Label',FirePHP::);
 
fb(array('key1'=>'val1',
         'key2'=>array(array('v1','v2'),'v3')),
   'TestArray',FirePHP::);
 
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

关键词:PHP