开发者

FirePHP not working with Zend's json action helper

开发者 https://www.devze.com 2023-03-29 09:19 出处:网络
my FirePHP is working in Firebug 1.8. Did copy over the new core files. However, when I use the following in the action

my FirePHP is working in Firebug 1.8. Did copy over the new core files.

However, when I use the following in the action

My_FirePHP::info('test');
    $this->_helper->json($result);

of a jQuery post XMLHttpRequest, it does not work.

I'm not too familiar with this to be sure where I'm going wrong. Any assistance appreciated.

PS: My_FirePHP uses Zend's logger, if that helps:

protected function __construct()
{
    $logger = new Zend_Log();
    $writer = n开发者_如何学运维ew Zend_Log_Writer_Firebug();
    $logger->addWriter($writer);
    $this->logger = $logger;
}


The JSON Helper stops execution of the request handler before the FirePHP headers are written to the response. Just call flush before invoking the JSON helper:

// if Firebug is enabled:
Zend_Wildfire_Channel_HttpHeaders::getInstance()->flush();

// proceed as usual
$this->_helper->json($response);
0

精彩评论

暂无评论...
验证码 换一张
取 消