ZF-3943: Zend_Db_Profiler_Firebug does not initialize header's sending


You also need to register the plugin: $front->registerPlugin(Zend_Wildfire_Channel_HttpHeaders::getInstance());

It should be done automatically or mentioned in docs



It is done automatically if you have initialized your front controller before calling the first DB query that the profiler is registered with.

Is this not working for you?

I can confirm; I have an app where I'm initializing the front control prior to the first DB query, and I'm not getting headers. In fact, even manually adding the Wildfire channel plugin is not producing any headers for me. :(

I've had some success now. I had to call setEnabled() on the profiler AND register the plugin manually. Once I did both tasks, all worked as expected.

Neither the constructor nor setEnabled() register the plugin, btw; I've verified this looking in the source.

My recommendation is that the profiler should be enabled by default, and the constructor should attempt to register the plugin.

Another discussion on mailing list

I've been experiencing a similar issue with Zend_Log_Writer_Firebug. Please see the mailing list discussion Martin Hujer referenced yesterday for a full description.

The problem may well be the order in which plugins are Firebug logger instance works perfectly in every context except layout scripts. If the layout script is rendered after Zend_Wildfire_Channel_HttpHeaders::postDispatch() has already fired, any Firebug log messages triggered in the layout script will not make it into the final response.

Manually flushing out the headers again (Zend_Wildfire_Channel_HttpHeaders::getInstance()->flush()) at the very end of the layout script solves the issue; however, it's not an ideal solution.

Part of message exchange directly with [~cadorn]: "I use Db_Profiler_Firebug and Log_Writer_Firebug. I create Db_Profiler_Firebug in a auth plugin (dispatchLoopStartup) just for administrator. I create my logger in my bootstrap. I send info log in a postDispatch plugin (auth) just for administrator (so the first log is very late in my code).

Case 1: Just the doc => nothing in Firebug

Case 2: The doc + the manual registration => all is in Firebug

Case 3: The doc + an immediate log just after the creation of the logger (in bootstrap, so very early in my code) => all is in Firebug

I think, there is sending of headers too early. I don't know if it's due to my particular code."

Scheduling for RC3.

The registering of the plugin has been fixed for Zend_Db_Profiler_Firebug.

You only need to call setEnabled() on Zend_Db_Profiler_Firebug not Zend_Wildfire_Plugin_FirePhp as it is enabled by default.

For the issue of flushing messages in Zend_Wildfire_Channel_HttpHeaders::postDispatch() see ZF-3963.

This OK for me. ZF SVN 11073.

Updating for the 1.6.0 release.