PHPackages                             shiki/yii-firephp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. shiki/yii-firephp

ActiveLibrary[Framework](/categories/framework)

shiki/yii-firephp
=================

FirePHP extension for Yii Framework.

0.3.0(12y ago)1510.9k4MITCSS

Since Nov 15Pushed 12y ago2 watchersCompare

[ Source](https://github.com/shiki/yii-firephp)[ Packagist](https://packagist.org/packages/shiki/yii-firephp)[ Docs](https://github.com/shiki/yii-firephp)[ RSS](/packages/shiki-yii-firephp/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

FirePHP extension for Yii Framework
===================================

[](#firephp-extension-for-yii-framework)

This extension contains 2 log route classes. The first, `SK\Yii\FirePHP\LogRoute`, processes standard Yii log messages. The second, `SK\Yii\FirePHP\ProfileLogRoute`, processes profile summaries. Both classes send all output to [FirePHP](http://www.firephp.org/). The classes work similarly to [`CWebLogRoute`](http://www.yiiframework.com/doc/api/1.1/CWebLogRoute)and [`CProfileLogRoute`](http://www.yiiframework.com/doc/api/1.1/CProfileLogRoute). The only major difference is the target output.

An advantage of using this extension is that logging and profiling work even through AJAX requests.

[![](https://camo.githubusercontent.com/c3b9e62d464601b925ba5d08429f1ab5e568bd8958fee3e27568dad611cf9baf/687474703a2f2f7368696b692e6d652f7075626c69632f6769746875622f7969692d666972657068702f6578616d706c652e706e67)](https://camo.githubusercontent.com/c3b9e62d464601b925ba5d08429f1ab5e568bd8958fee3e27568dad611cf9baf/687474703a2f2f7368696b692e6d652f7075626c69632f6769746875622f7969692d666972657068702f6578616d706c652e706e67)

Requirements
------------

[](#requirements)

- PHP *5.4+*
- A Yii Framework *1.1.14+* project.
- Firebug and FirePHP plugins for Firefox. See . Firebug's *Console* and *Net* tabs have to be enabled for this to work.
- Set `output_buffering` setting to true in `php.ini`. You might also want to increase the buffer size to allow large log sizes.

Installation
------------

[](#installation)

The only supported installation method for now is using [Composer](http://getcomposer.org/).

1. Put this in your `composer.json` and run `composer update` to install it:

```
{
  "require": {
    "shiki/yii-firephp": "dev-master"
  }
}
```

This will also automatically install the dependency `firephp/firephp-core`.

2. Make sure you have loaded the Composer autoload file (`vendor/autoload.php`) so the libraries can be accessed in your Yii config file. See the `main.php` config file in the `example` project on how this can be done.
3. Modify your config file (e.g. `protected/config/main.php`) to include the log route classes.

```
....

'log' => array(
  'class' => 'CLogRouter',
  'routes' => array(
    // the default (file logger)
    array(
      'class' => 'CFileLogRoute',
      'levels' => 'error, warning',
    ),
    // standard log route
    array(
      'class' => '\\SK\\Yii\\FirePHP\\LogRoute',
      'levels' => 'error, warning, info, trace',
    ),
    // profile log route
    array(
      'class' => '\\SK\\Yii\\FirePHP\\ProfileLogRoute',
      'report' => 'summary', // or "callstack"
    ),
  ),
),

....
```

Standard logging
----------------

[](#standard-logging)

Once you've got the extension setup in the config, you can use Yii's logging methods to log messages to FirePHP.

```
// logging an INFO message
Yii::log('This is an info message.', CLogger::LEVEL_INFO);

// logging a WARNING message
Yii::log("You didn't setup a profile, are you really a person?", CLogger::LEVEL_WARNING);

// logging with a CATEGORY (categories are displayed as "labels" in FirePHP -- just an additional info text)
Yii::log('Profile successfully created', CLogger::LEVEL_INFO, 'application.user.profiles');

// tracing simple text
Yii::trace('Loading application.user.profiles.ninja', 'application.user.profiles');

// logging an ERROR
Yii::log('We have successfully determined that you are not a person',
  CLogger::LEVEL_ERROR, 'Any category/label will work');

// If you need to log an array, you can use FirePHP's core methods
FB::warn(array('a' => 'b', 'c' => 'd'), 'an.array.warning');
```

See more about logging [here](http://www.yiiframework.com/doc/guide/1.1/en/topics.logging).

Profiling
---------

[](#profiling)

Profiling works by simply using Yii's profiling methods.

```
Yii::beginProfile('a somewhat slow method');

...
// some function calls here
// more function calls

Yii::beginProfile('nested profile');
// you can also nest profile calls
Yii::endProfile('nested profile');

Yii::endProfile('a somewhat slow method'); // end
```

You can also profile SQL executions. See more about that and profiling in general [here](http://www.yiiframework.com/doc/guide/1.1/en/topics.logging#performance-profiling).

Example
-------

[](#example)

To try all these out, there's an example project in the `example` folder. To run it:

1. Install the required libraries using Composer.

    ```
     $ cd example
     $ composer install

    ```
2. Run with the PHP [built-in webserver](http://php.net/manual/en/features.commandline.webserver.php)

    ```
     $ cd example/webroot
     $ php -S localhost:8000

    ```
3. Browse  in Firefox. Make sure first that Firebug is opened and the Console and Net tabs are enabled. You should be able to see the FirePHP logs in Firebug's console. If you don't, try refreshing first.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4603d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f24f88be6f9c67ea5e29f72b63e67adb64ea49dabfeecaae224801e028c7aa87?d=identicon)[shiki](/maintainers/shiki)

---

Top Contributors

[![shiki](https://avatars.githubusercontent.com/u/198826?v=4)](https://github.com/shiki "shiki (20 commits)")

---

Tags

yiifirephpfirebug

### Embed Badge

![Health badge](/badges/shiki-yii-firephp/health.svg)

```
[![Health](https://phpackages.com/badges/shiki-yii-firephp/health.svg)](https://phpackages.com/packages/shiki-yii-firephp)
```

###  Alternatives

[yiisoft/yii

Yii Web Programming Framework

4.8k5.8M267](/packages/yiisoft-yii)[yiisoft/yii2-queue

Yii2 Queue Extension which supports queues based on DB, Redis, RabbitMQ, Beanstalk, SQS, and Gearman

1.1k10.9M162](/packages/yiisoft-yii2-queue)[omnilight/yii2-scheduling

Scheduling extension for Yii2 framework

3151.1M8](/packages/omnilight-yii2-scheduling)[yiisoft/yii2-coding-standards

Yii PHP Framework Version 2 - Coding standard tools

1821.1M178](/packages/yiisoft-yii2-coding-standards)[yiisoft/db

Database abstraction layer and query builder

188498.4k44](/packages/yiisoft-db)[yiisoft/arrays

Yii Array Helper

562.1M61](/packages/yiisoft-arrays)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
