yretuta
yretuta

Reputation: 8091

implementing firephp

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?

Upvotes: 1

Views: 396

Answers (3)

mpen
mpen

Reputation: 282805

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.

Upvotes: 0

homelessDevOps
homelessDevOps

Reputation: 20726

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

Upvotes: 2

NDM
NDM

Reputation: 6830

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 :)

Upvotes: 0

Related Questions