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

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

sfFirePHP plugin

Overview

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.

Installation

php symfony plugin:install sfFirePHPPlugin

Upgrade plugins

php symfony plugin:upgrade -r=1.1.11 sfFirePHPPlugin

Uninstallation

php symfony plugin:uninstall sfFirePHPPlugin

Requirements

Client Side:

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

Usage

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

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

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:

Screenshots

Screenshot 1 Screenshot 2

License

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