Integrating FirePHP

7 0
6
Viewed: 21 141 times
Version: Unknown (update)
Category: Tutorials
    Written by: ricardograna ricardograna
    Updated by: ricardograna ricardograna
    Created: Oct 5, 2010
    Updated: 15 years ago

    You are viewing revision #2 of this wiki article.
    This version may not be up to date with the latest version.
    You may want to view the differences to the latest version.

    next (#3) »

    • Install Firebug plugin for Firefox from here.

    • Install FirePHP plugin for Firefox from here.

    • Download FirePHP package from here.

    • Extract 'FirePHPCoreXXX/lib/FirePHPCore' compressed folder to '/path/to/protected/components/FirePHPCore' folder.

    • At /path/to/index.php, after the line
    require_once($yii);
        ~~~
    
        Add the following code:
        ~~~
       [php]
        if (YII_DEBUG){
            Yii::import("application.components.FirePHPCore.fb", true);
        }
        ~~~
    
        So, you will have
    
        ~~~
        [php]
        require_once($yii);
        if (YII_DEBUG){
            Yii::import("application.components.FirePHPCore.fb", true);
        }
        Yii::createWebApplication($config)->run();
        ~~~
    
    That's it! Now you can display your variables on FirePHP with a simple 'fb' command inside your PHP code:
    

    [php] fb($my_variable); ~~~

    To view the results, open Firebug at 'console' tab and run your PHP file.