1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-25 10:36:33 +02:00

Merge branch '1.6.0_with_fix_for_eaccelerator'

Conflicts:
	src/Monolog/Handler/StreamHandler.php
This commit is contained in:
Birkir A. Barkarson
2013-10-10 16:52:03 +09:00

View File

@@ -24,6 +24,7 @@ class StreamHandler extends AbstractProcessingHandler
{ {
protected $stream; protected $stream;
protected $url; protected $url;
private $errorMessage;
/** /**
* @param string $stream * @param string $stream
@@ -60,6 +61,7 @@ class StreamHandler extends AbstractProcessingHandler
if (!$this->url) { if (!$this->url) {
throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().'); throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().');
} }
$errorMessage = null;
set_error_handler(array($this, 'customErrorHandler')); set_error_handler(array($this, 'customErrorHandler'));
$this->stream = fopen($this->url, 'a'); $this->stream = fopen($this->url, 'a');
restore_error_handler(); restore_error_handler();
@@ -71,7 +73,6 @@ class StreamHandler extends AbstractProcessingHandler
fwrite($this->stream, (string) $record['formatted']); fwrite($this->stream, (string) $record['formatted']);
} }
private $errorMessage = null;
protected function customErrorHandler($code, $msg) { protected function customErrorHandler($code, $msg) {
$this->errorMessage = preg_replace('{^fopen\(.*?\): }', '', $msg); $this->errorMessage = preg_replace('{^fopen\(.*?\): }', '', $msg);
} }