zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    PHP四种界定符
    设计模式 单例模式与工厂模式
    PHP include与require的区别
    面向对象 static abstract interface 等知识点
    gogland golang 颜色&字体 colors&font 配置文件
    什么是游戏中的帧同步
    kcp协议详解
    kcp流模式与消息模式对比
    kcp源码走读
    kcp结构体字段含义
  • 原文地址:https://www.cnblogs.com/ahhg/p/4493767.html
Copyright © 2011-2022 走看看