[ Index ]

MailPress 7.2

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

title

Body

[close]

/mp-includes/composer/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/ -> NullContentEncoder.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   * Handles the case where the email body is already encoded and you just need specify the correct
  13   * encoding without actually changing the encoding of the body.
  14   *
  15   * @author Jan Flora <jf@penneo.com>
  16   */
  17  class Swift_Mime_ContentEncoder_NullContentEncoder implements Swift_Mime_ContentEncoder
  18  {
  19      /**
  20       * The name of this encoding scheme (probably 7bit or 8bit).
  21       *
  22       * @var string
  23       */
  24      private $_name;
  25  
  26      /**
  27       * Creates a new NullContentEncoder with $name (probably 7bit or 8bit).
  28       *
  29       * @param string $name
  30       */
  31      public function __construct($name)
  32      {
  33          $this->_name = $name;
  34      }
  35  
  36      /**
  37       * Encode a given string to produce an encoded string.
  38       *
  39       * @param string $string
  40       * @param int    $firstLineOffset ignored
  41       * @param int    $maxLineLength   ignored
  42       *
  43       * @return string
  44       */
  45      public function encodeString($string, $firstLineOffset = 0, $maxLineLength = 0)
  46      {
  47          return $string;
  48      }
  49  
  50      /**
  51       * Encode stream $in to stream $out.
  52       *
  53       * @param int $firstLineOffset ignored
  54       * @param int $maxLineLength   ignored
  55       */
  56      public function encodeByteStream(Swift_OutputByteStream $os, Swift_InputByteStream $is, $firstLineOffset = 0, $maxLineLength = 0)
  57      {
  58          while (false !== ($bytes = $os->read(8192))) {
  59              $is->write($bytes);
  60          }
  61      }
  62  
  63      /**
  64       * Get the name of this encoding scheme.
  65       *
  66       * @return string
  67       */
  68      public function getName()
  69      {
  70          return $this->_name;
  71      }
  72  
  73      /**
  74       * Not used.
  75       */
  76      public function charsetChanged($charset)
  77      {
  78      }
  79  }


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1