Integrating FirePHP

You are viewing revision #3 of this wiki article.
This is the latest version of this article.
You may want to see the changes made in this revision.

« previous (#2)

  • 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 (in 1.0.x version)

    ~~~
    [php]
    require_once($yii);
    if (YII_DEBUG){
        Yii::import("application.components.FirePHPCore.fb", true);
    }
    Yii::createWebApplication($config)->run();
    ~~~

    (1.1.x version)
    ~~~
    [php]
    $app = Yii::createWebApplication($config); 
    if (YII_DEBUG){
        Yii::import("application.components.FirePHPCore.fb", true); 
    } 
    $app->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.

7 0
6 followers
Viewed: 18 369 times
Version: Unknown (update)
Category: Tutorials
Tags:
Written by: ricardograna
Last updated by: ricardograna
Created on: Oct 5, 2010
Last updated: 14 years ago
Update Article

Revisions

View all history