Swift_Encoder_QpEncoder::__construct PHP Method

__construct() public method

Creates a new QpEncoder for the given CharacterStream.
public __construct ( Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null )
$charStream Swift_CharacterStream to use for reading characters
$filter Swift_StreamFilter if input should be canonicalized
    public function __construct(Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null)
    {
        $this->_charStream = $charStream;
        if (!isset(self::$_safeMapShare[$this->getSafeMapShareId()])) {
            $this->initSafeMap();
            self::$_safeMapShare[$this->getSafeMapShareId()] = $this->_safeMap;
        } else {
            $this->_safeMap = self::$_safeMapShare[$this->getSafeMapShareId()];
        }
        $this->_filter = $filter;
    }

Usage Example

 /**
  * Creates a new QpContentEncoder for the given CharacterStream.
  * @param Swift_CharacterStream $charStream to use for reading characters
  * @param Swift_StreamFilter $filter if canonicalization should occur
  * @param boolean $dotEscape if dot stuffing workaround must be enabled
  */
 public function __construct(Swift_CharacterStream $charStream, Swift_StreamFilter $filter = null, $dotEscape = false)
 {
     parent::__construct($charStream, $filter);
     if ($dotEscape) {
         /* Encode . as =2e for buggy remote servers */
         unset($this->_safeMap[0x2e]);
     }
 }
All Usage Examples Of Swift_Encoder_QpEncoder::__construct