Horde_Imap_Client_Data_Format_String::escapeStream PHP Method

escapeStream() public method

Return the escaped string as a stream.
public escapeStream ( ) : resource
return resource The IMAP escaped stream.
    public function escapeStream()
    {
        if ($this->literal()) {
            throw new Horde_Imap_Client_Data_Format_Exception('String requires literal to output.');
        }
        rewind($this->_data->stream);
        $stream = new Horde_Stream_Temp();
        $stream->add($this->_data, true);
        stream_filter_register('horde_imap_client_string_quote', 'Horde_Imap_Client_Data_Format_Filter_Quote');
        stream_filter_append($stream->stream, 'horde_imap_client_string_quote', STREAM_FILTER_READ);
        return $stream->stream;
    }

Usage Example

示例#1
0
文件: Nstring.php 项目: horde/horde
 public function escapeStream()
 {
     if (is_null($this->_data)) {
         $stream = new Horde_Stream_Temp();
         $stream->add('NIL', true);
         return $stream->stream;
     }
     return parent::escapeStream();
 }