1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-07 05:36:45 +02:00

Fix idiocy, refs #152

This commit is contained in:
Jordi Boggiano
2013-01-22 16:02:20 +01:00
parent 01bb026750
commit 957ee8d0d6
2 changed files with 48 additions and 30 deletions

View File

@@ -40,21 +40,6 @@ class ChromePHPHandler extends AbstractProcessingHandler
protected static $sendHeaders = true;
/**
* pointer to the static sendHeaders for BC
*/
protected $sendHeaders;
/**
* @param integer $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
*/
public function __construct($level = Logger::DEBUG, $bubble = true)
{
parent::__construct($level, $bubble);
$this->sendHeaders =& static::$sendHeaders;
}
/**
* {@inheritdoc}
*/
@@ -138,4 +123,28 @@ class ChromePHPHandler extends AbstractProcessingHandler
return !isset($_SERVER['HTTP_USER_AGENT'])
|| preg_match('{\bChrome/\d+[\.\d+]*\b}', $_SERVER['HTTP_USER_AGENT']);
}
/**
* BC getter for the sendHeaders property that has been made static
*/
public function __get($property)
{
if ('sendHeaders' !== $property) {
throw new \InvalidArgumentException('Undefined property '.$property);
}
return static::$sendHeaders;
}
/**
* BC setter for the sendHeaders property that has been made static
*/
public function __set($property, $value)
{
if ('sendHeaders' !== $property) {
throw new \InvalidArgumentException('Undefined property '.$property);
}
static::$sendHeaders = $value;
}
}

View File

@@ -53,21 +53,6 @@ class FirePHPHandler extends AbstractProcessingHandler
protected static $sendHeaders = true;
/**
* pointer to the static sendHeaders for BC
*/
protected $sendHeaders;
/**
* @param integer $level The minimum logging level at which this handler will be triggered
* @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
*/
public function __construct($level = Logger::DEBUG, $bubble = true)
{
parent::__construct($level, $bubble);
$this->sendHeaders =& static::$sendHeaders;
}
/**
* Base header creation function used by init headers & record headers
*
@@ -172,4 +157,28 @@ class FirePHPHandler extends AbstractProcessingHandler
|| preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])
|| isset($_SERVER['HTTP_X_FIREPHP_VERSION']);
}
/**
* BC getter for the sendHeaders property that has been made static
*/
public function __get($property)
{
if ('sendHeaders' !== $property) {
throw new \InvalidArgumentException('Undefined property '.$property);
}
return static::$sendHeaders;
}
/**
* BC setter for the sendHeaders property that has been made static
*/
public function __set($property, $value)
{
if ('sendHeaders' !== $property) {
throw new \InvalidArgumentException('Undefined property '.$property);
}
static::$sendHeaders = $value;
}
}