FirePHP and Zend Framework

Written in

by

Zend has a great tool for debugging ajax code. It allows error messages to be displayed directly in firebug via an additional plug-in called FirePHP.

First, visit the mozilla plug-in site and install FireBug and FirePHP.

Then add this to your zend framework projects bootstrap file.

<?php

// Place this in your bootstrap file before dispatching your front controller
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);

 

// Use this in your model, view and controller files
$logger = Zend_Registry::get(‘logger’);
$logger->log(‘This is a log message!’, Zend_Log::INFO);

?>

This plug-in saved my bacon on a recent project which has a ton of ajax parts.
There is also an adapter for zend_db_profiler which will log all queries to firebug which is also very useful.

More details here. Thanks Chris for all your hard work.

Verified by MonsterInsights