sfFirePHPPlugin - 1.1.14

FirePHP Symfony Plugin

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to the Plugins Home


Forgot your password?
Create an account



advanced search
Information Readme Releases Changelog Contribute
Show source

sfFirePHP plugin


This plugin integrates FirePHP into symfony.

According to the firephp web site

FirePHP enables you to print to your Firebug Console using a simple PHP function call. What makes FirePHP different? All data is sent via a set of X-FirePHP-Data response headers. This means that the debugging data will not interfere with the content on your page. Thus FirePHP is ideally suited for AJAX development.


php symfony plugin:install sfFirePHPPlugin

Upgrade plugins

php symfony plugin:upgrade -r=1.1.11 sfFirePHPPlugin


php symfony plugin:uninstall sfFirePHPPlugin


Client Side:

  • Firefox - Only Works with the Firefox browser :)
  • Firebug - Of course you need firebug.
  • FirePHP - Also install the firephp extension for firefox.


You can check a FirePHP Tutorial here:

After you have Firefox installed, with the firebug and firephp extensions, you will need to install the sfFirePHPPlugin.

Then inside a template you can do something like:

<?php $firephp = sfFirePHP::getInstance(true); ?>
<?php $firephp->fb('Hello World'); // Defaults to FirePHP::LOG ?>
<?php $firephp->fb('Log message'  ,FirePHP::LOG); ?>
<?php $firephp->fb('Info message' ,FirePHP::INFO); ?>
<?php $firephp->fb('Warn message' ,FirePHP::WARN);  ?>
<?php $firephp->fb('Error message',FirePHP::ERROR); ?>

When you load the page, those messages will appear on your firebug console.

Web Debug new

Make sure to apply this patch first if firephp is < 0.3.2

Copy RequestProcessor.js to a public dir or

php symfony plugin:publish-assets

RequestProcessor.js enables this plugin to dump the configuration in directory mode. The default processor in firephp does not handle FirePHP::DUMP.

Edit factories.yml

    class: sfAggregateLogger
      level: debug
          class: sfFirePHPLogger
            level: debug
            processor: http://localhost/js/RequestProcessor.js #make sure this is absolute
              maxObjectDepth: 10
              maxArrayDepth: 20
              useNativeJsonEncode: true
              includeLineNumbers: true

If firebug warns about unathorized processor injection, just add the host in "Allowed Sites...".

Helper new

The helper file is loaded automatically in the global scope, simply use:

- where $level can be one of FirePHP::LOG, FirePHP::INFO, FirePHP::WARN, FirePHP::ERROR

or use the shortcut functions:


Screenshot 1 Screenshot 2


For the full copyright and license information, please view the LICENSE file that was distributed with this source code.