Permalink
Browse files

Fix idiocy, refs #152

  • Loading branch information...
1 parent 01bb026 commit 957ee8d0d62fad0c336797f0fb1ffa63ae6d6c71 @Seldaek committed Jan 22, 2013
Showing with 48 additions and 30 deletions.
  1. +24 −15 src/Monolog/Handler/ChromePHPHandler.php
  2. +24 −15 src/Monolog/Handler/FirePHPHandler.php
@@ -41,21 +41,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}
*/
public function handleBatch(array $records)
@@ -138,4 +123,28 @@ protected function headersAccepted()
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;
+ }
}
@@ -54,21 +54,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
*
* @param array $meta Wildfire Plugin, Protocol & Structure Indexes
@@ -172,4 +157,28 @@ protected function headersAccepted()
|| 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;
+ }
}

0 comments on commit 957ee8d

Please sign in to comment.