Download the PHP package shiki/yii-firephp without Composer
On this page you can find all versions of the php package shiki/yii-firephp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shiki/yii-firephp
More information about shiki/yii-firephp
Files in shiki/yii-firephp
Package yii-firephp
Short Description FirePHP extension for Yii Framework.
License MIT
Homepage https://github.com/shiki/yii-firephp
Informations about the package yii-firephp
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. The classes work similarly
to CWebLogRoute
and 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.
Requirements
- PHP 5.4+
- A Yii Framework 1.1.14+ project.
- Firebug and FirePHP plugins for Firefox. See http://firephp.org. Firebug's Console and Net tabs have to be enabled for this to work.
- Set
output_buffering
setting to true inphp.ini
. You might also want to increase the buffer size to allow large log sizes.
Installation
The only supported installation method for now is using Composer.
-
Put this in your
composer.json
and runcomposer update
to install it:This will also automatically install the dependency
firephp/firephp-core
. -
Make sure you have loaded the Composer autoload file (
vendor/autoload.php
) so the libraries can be accessed in your Yii config file. See themain.php
config file in theexample
project on how this can be done. - Modify your config file (e.g.
protected/config/main.php
) to include the log route classes.
Standard logging
Once you've got the extension setup in the config, you can use Yii's logging methods to log messages to FirePHP.
See more about logging here.
Profiling
Profiling works by simply using Yii's profiling methods.
You can also profile SQL executions. See more about that and profiling in general here.
Example
To try all these out, there's an example project in the example
folder. To run it:
-
Install the required libraries using Composer.
$ cd example $ composer install
-
Run with the PHP built-in webserver
$ cd example/webroot $ php -S localhost:8000
- Browse http://localhost:8000 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.