merged branch Seldaek/firephp (PR #2458)
Commits
-------
27d0809
[MonologBridge] Adjust for Monolog 1.0.2
Discussion
----------
[MonologBridge] Adjust for Monolog 1.0.2
This is BC, it just turns off headers in browsers that don't have Firebug, I have had problems in IE with more than 150 log entries just crashing the page.
This commit is contained in:
commit
e790842ea6
@ -42,6 +42,12 @@ class FirePHPHandler extends BaseFirePHPHandler
|
||||
return;
|
||||
}
|
||||
|
||||
if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent'))) {
|
||||
$this->sendHeaders = false;
|
||||
$this->headers = array();
|
||||
return;
|
||||
}
|
||||
|
||||
$this->response = $event->getResponse();
|
||||
foreach ($this->headers as $header => $content) {
|
||||
$this->response->headers->set($header, $content);
|
||||
@ -54,10 +60,22 @@ class FirePHPHandler extends BaseFirePHPHandler
|
||||
*/
|
||||
protected function sendHeader($header, $content)
|
||||
{
|
||||
if (!$this->sendHeaders) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->response) {
|
||||
$this->response->headers->set($header, $content);
|
||||
} else {
|
||||
$this->headers[$header] = $content;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Override default behavior since we check the user agent in onKernelResponse
|
||||
*/
|
||||
protected function headersAccepted()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user