[ Index ]

MailPress 544

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/Swiftmailer/classes/Swift/Plugins/Loggers/ -> EchoLogger.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of SwiftMailer.
   5   * (c) 2004-2009 Chris Corbyn
   6   *
   7   * For the full copyright and license information, please view the LICENSE
   8   * file that was distributed with this source code.
   9   */
  10  
  11  /**
  12   * Prints all log messages in real time.
  13   *
  14   * @author Chris Corbyn
  15   */
  16  class Swift_Plugins_Loggers_EchoLogger implements Swift_Plugins_Logger
  17  {
  18      /** Whether or not HTML should be output */
  19      private $_isHtml;
  20  
  21      /**
  22       * Create a new EchoLogger.
  23       *
  24       * @param bool $isHtml
  25       */
  26      public function __construct($isHtml = true)
  27      {
  28          $this->_isHtml = $isHtml;
  29      }
  30  
  31      /**
  32       * Add a log entry.
  33       *
  34       * @param string $entry
  35       */
  36      public function add($entry)
  37      {
  38          if ($this->_isHtml) {
  39              printf('%s%s%s', htmlspecialchars($entry, ENT_QUOTES), '<br />', PHP_EOL);
  40          } else {
  41              printf('%s%s', $entry, PHP_EOL);
  42          }
  43      }
  44  
  45      /**
  46       * Not implemented.
  47       */
  48      public function clear()
  49      {
  50      }
  51  
  52      /**
  53       * Not implemented.
  54       */
  55      public function dump()
  56      {
  57      }
  58  }


Generated: Thu Apr 28 18:38:52 2016 Cross-referenced by PHPXref 0.7.1