Posted By

aurorius on 11/02/10


Tagged

ZF firephp


Versions (?)

Using FirePHP without FrontController


 / Published in: PHP
 

URL: http://stackoverflow.com/questions/3507165/firephp-doesnt-always-write-log-messages

The following example below shows how to make FirePHP get the header info it needs without using the FrontController.

  1. // create the logger and log writer
  2. $writer = new Zend_Log_Writer_Firebug();
  3. $logger = new Zend_Log($writer);
  4.  
  5. // get the wildfire channel
  6. $channel = Zend_Wildfire_Channel_HttpHeaders::getInstance();
  7.  
  8. // create and set the HTTP response
  9. $response = new Zend_Controller_Response_Http();
  10. $channel->setResponse($response);
  11.  
  12. // create and set the HTTP request
  13. $channel->setRequest(new Zend_Controller_Request_Http());
  14.  
  15. // record log messages
  16. $logger->info('info message');
  17. $logger->warn('warning message');
  18. $logger->err('error message');
  19.  
  20. // insert the wildfire headers into the HTTP response
  21. $channel->flush();
  22.  
  23. // send the HTTP response headers
  24. $response->sendHeaders();

Report this snippet  

You need to login to post a comment.