public function write($data, $eol = false)
    {
        if ($eol) {
            $buffer = $this->_buffer;
            $debug = $this->client_debug;
            $this->_buffer = '';

            $this->client_debug = true;

            if (fwrite($this->_stream, $buffer . $data . ($eol ? "\r\n" : '')) === false) {
                throw new Horde_Imap_Client_Exception(
                    Horde_Imap_Client_Translation::r("Server write error."),
                    Horde_Imap_Client_Exception::SERVER_WRITEERROR
                );
            }

            if ($debug) {
                $this->_params['debug']->client($buffer . $data);
            }
        } else {
            $this->_buffer .= $data;
        }
    }
public function write($data, $eol = false)
    {
        if ($eol) {
            $buffer = $this->_buffer;
            $debug = $this->client_debug;
            $this->_buffer = '';

            $this->client_debug = true;

            if (fwrite($this->_stream, $buffer . $data . ($eol ? "\r\n" : '')) === false) {
                throw new Horde_Imap_Client_Exception(
                    Horde_Imap_Client_Translation::r("Server write error."),
                    Horde_Imap_Client_Exception::SERVER_WRITEERROR
                );
            }

            if ($debug) {
                $this->_params['debug']->client($buffer . $data);
            }
        } else {
            $this->_buffer .= $data;
        }
    }
public function write ( $ data , $ eol = false ) { if ( $ eol ) { $ buffer = $ this -> _buffer ; $ debug = $ this -> client_debug ; $ this -> _buffer = '' ; $ this -> client_debug = true ; if ( fwrite ( $ this -> _stream , $ buffer . $ data . ( $ eol ? "\r\n" : '' ) ) === false ) { throw new Horde_Imap_Client_Exception ( Horde_Imap_Client_Translation :: r ( "Server write error." ) , Horde_Imap_Client_Exception :: SERVER_WRITEERROR ) ; } if ( $ debug ) { $ this -> _params [ 'debug' ] -> client ( $ buffer . $ data ) ; } } else { $ this -> _buffer .= $ data ; } }
Writes data to the IMAP output stream.

@param string $data  String data.
@param boolean $eol  Append EOL?

@throws Horde_Imap_Client_Exception
Writes data to the IMAP output stream .