/** * Prepares append message data for insertion into the IMAP command * string. * * @param mixed $data Either a resource or a string. * * @param Horde_Stream A stream containing the data. */ protected function _appendData($data) { $stream = new Horde_Stream_Temp(); stream_filter_register('horde_eol', 'Horde_Stream_Filter_Eol'); $res = stream_filter_append($stream->stream, 'horde_eol', STREAM_FILTER_WRITE); if (is_resource($data)) { rewind($data); } $stream->add($data, true); $this->_temp['appendsize'] += $stream->length(); stream_filter_remove($res); return $stream; }
/** */ public function length($utf8 = false) { return $this->_string ? $this->_string->length($utf8) : parent::length($utf8); }