diff options
Diffstat (limited to 'src/Monolog/Writer')
-rw-r--r-- | src/Monolog/Writer/FileWriter.php | 41 | ||||
-rw-r--r-- | src/Monolog/Writer/NullWriter.php | 29 | ||||
-rw-r--r-- | src/Monolog/Writer/StreamWriter.php | 59 | ||||
-rw-r--r-- | src/Monolog/Writer/WriterInterface.php | 21 |
4 files changed, 0 insertions, 150 deletions
diff --git a/src/Monolog/Writer/FileWriter.php b/src/Monolog/Writer/FileWriter.php deleted file mode 100644 index 14993f0..0000000 --- a/src/Monolog/Writer/FileWriter.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Writer; - -class FileWriter extends StreamWriter -{ - protected $rotation; - protected $maxAge; - - public function __construct($file, $rotation = null, $maxAge = null) - { - parent::__construct($file); - $this->rotation = $rotation; - $this->maxAge = $maxAge; - } - - public function close() - { - parent::close(); - // TODO rotation - } - - public function setRotation($rotation) - { - $this->rotation = $rotation; - } - - public function setMaxAge($maxAge) - { - $this->maxAge = $maxAge; - } -}
\ No newline at end of file diff --git a/src/Monolog/Writer/NullWriter.php b/src/Monolog/Writer/NullWriter.php deleted file mode 100644 index c44a61f..0000000 --- a/src/Monolog/Writer/NullWriter.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Writer; - -use Monolog\Formatter\FormatterInterface; - -class NullWriter implements WriterInterface -{ - public function write($log, $message) - { - } - - public function close() - { - } - - public function setFormatter(FormatterInterface $formatter) - { - } -}
\ No newline at end of file diff --git a/src/Monolog/Writer/StreamWriter.php b/src/Monolog/Writer/StreamWriter.php deleted file mode 100644 index 09d5203..0000000 --- a/src/Monolog/Writer/StreamWriter.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Writer; - -use Monolog\Formatter\FormatterInterface; - -class StreamWriter implements WriterInterface -{ - protected $formatter; - protected $stream; - protected $url; - - public function __construct($streamUrl) - { - if (is_resource($streamUrl)) { - $this->stream = $streamUrl; - } else { - $this->url = $streamUrl; - } - } - - public function write($log, $message) - { - if (null === $this->stream) { - $this->stream = fopen($this->url, 'a'); - } - if ($this->formatter) { - $message = $this->formatter->format($log, $message); - } - fwrite($this->stream, (string) $message['message']); - } - - public function close() - { - fclose($this->stream); - $this->stream = null; - } - - public function setFormatter(FormatterInterface $formatter) - { - $this->formatter = $formatter; - } - - public function __destruct() - { - if (null !== $this->stream) { - $this->close(); - } - } -}
\ No newline at end of file diff --git a/src/Monolog/Writer/WriterInterface.php b/src/Monolog/Writer/WriterInterface.php deleted file mode 100644 index f8dffb3..0000000 --- a/src/Monolog/Writer/WriterInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php - -/* - * This file is part of the Monolog package. - * - * (c) Jordi Boggiano <j.boggiano@seld.be> - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Monolog\Writer; - -use Monolog\Formatter\FormatterInterface; - -interface WriterInterface -{ - function setFormatter(FormatterInterface $formatter); - function write($log, $message); - function close(); -} |