From 232aa1924c8c0f10d87b210b46c9f061af5c844c Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 17 Oct 2010 13:29:57 +0000 Subject: added files --- .../classes/Swift/Plugins/Loggers/ArrayLogger.php | 73 ++++++++++++++++++++++ .../classes/Swift/Plugins/Loggers/EchoLogger.php | 64 +++++++++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 h-source/External/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php create mode 100644 h-source/External/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php (limited to 'h-source/External/swiftmailer/lib/classes/Swift/Plugins/Loggers') diff --git a/h-source/External/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php b/h-source/External/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php new file mode 100644 index 0000000..930eca2 --- /dev/null +++ b/h-source/External/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php @@ -0,0 +1,73 @@ +_size = $size; + } + + /** + * Add a log entry. + * @param string $entry + */ + public function add($entry) + { + $this->_log[] = $entry; + while (count($this->_log) > $this->_size) + { + array_shift($this->_log); + } + } + + /** + * Clear the log contents. + */ + public function clear() + { + $this->_log = array(); + } + + /** + * Get this log as a string. + * @return string + */ + public function dump() + { + return implode(PHP_EOL, $this->_log); + } + +} diff --git a/h-source/External/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php b/h-source/External/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php new file mode 100644 index 0000000..83dd54b --- /dev/null +++ b/h-source/External/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php @@ -0,0 +1,64 @@ +_isHtml = $isHtml; + } + + /** + * Add a log entry. + * @param string $entry + */ + public function add($entry) + { + if ($this->_isHtml) + { + printf('%s%s%s', htmlspecialchars($entry, ENT_QUOTES), '
', PHP_EOL); + } + else + { + printf('%s%s', $entry, PHP_EOL); + } + } + + /** + * Not implemented. + */ + public function clear() + { + } + + /** + * Not implemented. + */ + public function dump() + { + } + +} -- cgit v1.2.3