/** */ public function __toString() { $pos = ftell($this->stream->stream); $out = $this->_current . ' ' . $this->stream->getString(); fseek($this->stream->stream, $pos); return $out; }
/** * Return a Mime object representing the entire message. * * @return Horde_Mime_Part The Mime object. */ public function getMimeObject() { $this->_stream->rewind(); $part = Horde_Mime_Part::parseMessage($this->_stream->getString()); $part->isBasePart(true); return $part; }
/** * Return literal length data located at the end of the stream. * * @return mixed Null if no literal data found, or an array with these * keys: * - binary: (boolean) True if this is a literal8. * - length: (integer) Length of the literal. */ public function getLiteralLength() { if ($this->_stream->substring(-1, 1) === '}') { $literal_data = $this->_stream->getString($this->_stream->search('{', true) - 1); $literal_len = substr($literal_data, 2, -1); if (is_numeric($literal_len)) { return array('binary' => $literal_data[0] === '~', 'length' => intval($literal_len)); } } return null; }