Zend Framework, FireBug, FirePHP and Debuggin’

I finally got around to implementing some debugging my applications. By debugging, I mean something more useful than random ‘echo‘ and ‘exit‘ statements littering my code.

I found a nice post by Christoph Dorn with a few nice pointers on how to integrate FireBug and FirePHP using Zend_Log and Zend_Log_Writer_Firebug.

My only addition was the use of a ‘debug’ flag that I use in my applications.  Basically, if it is set to true the logwriter will work, if it’s false, it won’t write anything.

if ($config->debug === '1') {
	$writer->setEnabled(true);
	$frontController->throwExceptions(true);
} else {
	$writer->setEnabled(false);
	$frontController->throwExceptions(false);
}

That little snippit in my bootstrap makes all the magic happen.

You can leave a response, or trackback from your own site.

Leave a Reply

Subscribe to RSS Feed Follow me on Twitter!