using without Zend_Controller_Front

3 messages Options
Embed this post
Permalink
Liane_ () using without Zend_Controller_Front
Reply Threaded More More options
Print post
Permalink
Hi,

it is a great debugging tool, but I have some issues using it with ZF 1.7.8:

I use some parts of ZendFramework, but not Zend_Controller_Front, and according to http://framework.zend.com/manual/en/zend.log.writers.html#zend.log.writers.firebug the minimum code to use firePHP is:

/********************************************************/
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);

$request = new Zend_Controller_Request_Http();
$response = new Zend_Controller_Response_Http();
$channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
$channel->setRequest($request);
$channel->setResponse($response);

// Start output buffering
ob_start();

// Now you can make calls to the logger

$logger->log('This is a log message!', Zend_Log::INFO);

// Flush log data to browser
$channel->flush();
$response->sendHeaders();
/********************************************************/

this works on my server, but not only it is overkill to use, but also needs trailer code to flush the headers, else nothing is sent to the browser.

Is there a way to use firePHP provided with ZendFrameWork in a simple way, I was expecting something like that to work:

/********************************************************/
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);
$logger->log('This is a log message!', Zend_Log::INFO);
/********************************************************/

perhaps I missed something obvious?
Christoph Dorn () Re: using without Zend_Controller_Front
Reply Threaded More More options
Print post
Permalink
Sorry about the long wait for a reply. I seem to have missed your message.

At the moment there is no "easier" way to use FirePHP with ZF. You can write your own wrapper using register_shutdown_function() to make it more convenient.

Christoph
Liane_ () Re: using without Zend_Controller_Front
Reply Threaded More More options
Print post
Permalink
Thanks a lot for this suggestion, it works great (dunno why but I was under the impression that register_shutdown_function was called *after* the headers were sent?)

I'm now going to use intensively this great tool, thanks again.