mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-29 11:26:09 +01:00
Make ChromePHPHandler and FirePHPHandler sendHeaders flag static so that when multiple instances of the handler class exist they will all respect the one-time check that determines whether the handler should append its logs to the response header
This commit is contained in:
@@ -38,7 +38,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
|
||||
'rows' => array(),
|
||||
);
|
||||
|
||||
protected $sendHeaders = true;
|
||||
protected static $sendHeaders = true;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
@@ -91,7 +91,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
|
||||
protected function send()
|
||||
{
|
||||
if (!self::$initialized) {
|
||||
$this->sendHeaders = $this->headersAccepted();
|
||||
self::$sendHeaders = $this->headersAccepted();
|
||||
self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
|
||||
|
||||
self::$initialized = true;
|
||||
@@ -108,7 +108,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
|
||||
*/
|
||||
protected function sendHeader($header, $content)
|
||||
{
|
||||
if (!headers_sent() && $this->sendHeaders) {
|
||||
if (!headers_sent() && self::$sendHeaders) {
|
||||
header(sprintf('%s: %s', $header, $content));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user