tags:

views:

74

answers:

3

that's about it...the problem is

I want to make firephp work, but I can't find any simple examples! What's it for anyway?

"FirePHP enables you to print to your Firebug Console using a simple PHP function call."

Why would I want to do that anyway? Are there any solid debugging advantage in using FirePHP?

A: 

it's usefull for times when you can't use a step through debugger (on a live server for instance) and you want to know the value of some variable or function call. You don't want to var_dump an instance on the frontpage of a live site :)

Nicky De Maeyer
+2  A: 

Hi,

after you've installed FireBug and FirePHP move the Foleder "FirePHPCore" to your PEAR Folder.

Inside your script you have to incldude the FirePHP Library

require('FirePHPCore/fb.php');

Now you can your FirePHP in your script:

fb('Log message', FirePHP::LOG);
fb('Info message', FirePHP::INFO);
fb('Warn message', FirePHP::WARN);
fb('Error message', FirePHP::ERROR);

There are altough other ways, many Frameworks are supporing FirePHP out of the box, like the Zend Framework.

$fb = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($fb);

$logger->log('Log with Zend and FirePHP', Zend_Log::INFO);

Cheers, Arne

ArneRie
I am using Kohana Framework...and I have not yet worked with any PEAR library...is PEAR a requirement?
Ygam
You can use firephp altough with kohana: http://learn.kohanaphp.com/2008/07/21/introducing-fire-profiler/
ArneRie
A: 

Why would you want to print to firebug rather than mixing in your debug statements with presentation?

It makes it more clear, and easier to read for one.

Mark