Properties

$sequence

$sequence : integer

Write sequence

Type

integer

$filters

$filters : array

StreamFilters

Type

array

$writeBuffer

$writeBuffer : string

A buffer for writing

Type

string

$mirrors

$mirrors : array

Bound streams

Type

array

$stream

$stream : resource

A primary socket

Type

resource

$in

$in : resource

The input stream

Type

resource

$out

$out : resource

The output stream

Type

resource

$params

$params : 

Buffer initialization parameters $var array

Type

$translations

$translations : array

Translations performed on data being streamed into the buffer

Type

array

Methods

removeFilter()

removeFilter(string  $key) 

Remove an already present StreamFilter based on its $key

Parameters

string $key

write()

write(string  $bytes) : integer

Writes $bytes to the end of the stream

Writing may not happen immediately if the stream chooses to buffer. If you want to write these bytes with immediate effect, call \commit() after calling write().

This method returns the sequence ID of the write (i.e. 1 for first, 2 for second, etc etc).

Parameters

string $bytes

Returns

integer

commit()

commit() 

For any bytes that are currently buffered inside the stream, force them off the buffer

bind()

bind(\Pop\Mail\Transport\Smtp\Stream\Byte\InputInterface  $is) 

Attach $is to this stream.

The stream acts as an observer, receiving all data that is written. All \write() and \flushBuffers() operations will be mirrored.

Parameters

\Pop\Mail\Transport\Smtp\Stream\Byte\InputInterface $is

unbind()

unbind(\Pop\Mail\Transport\Smtp\Stream\Byte\InputInterface  $is) 

Remove an already bound stream.

If $is is not bound, no errors will be raised. If the stream currently has any buffered data it will be written to $is before unbinding occurs.

Parameters

\Pop\Mail\Transport\Smtp\Stream\Byte\InputInterface $is

flushBuffers()

flushBuffers() 

Flush the contents of the stream (empty it) and set the internal pointer to the beginning.

initialize()

initialize(array  $params) 

Perform any initialization needed, using the given $params.

Parameters will vary depending upon the type of IoBuffer used.

Parameters

array $params

setParam()

setParam(string  $param, mixed  $value) 

Set an individual param on the buffer (e.g. switching to SSL)

Parameters

string $param
mixed $value

startTls()

startTls() : boolean

Start TLS

Returns

boolean

terminate()

terminate() 

Perform any shutdown logic needed

setWriteTranslations()

setWriteTranslations(array  $replacements) 

Set an array of string replacements which should be made on data written to the buffer.

This could replace LF with CRLF for example.

Parameters

array $replacements

readLine()

readLine(integer  $sequence) : string

Get a line of output (including any CRLF).

The $sequence number comes from any writes and may or may not be used depending upon the implementation.

Parameters

integer $sequence

of last write to scan from

Throws

\Pop\Mail\Transport\Smtp\Stream\Exception

Returns

string

read()

read(integer  $length) : string|boolean

Reads $length bytes from the stream into a string and moves the pointer through the stream by $length.

If less bytes exist than are requested the remaining bytes are given instead. If no bytes are remaining at all, boolean false is returned.

Parameters

integer $length

Throws

\Pop\Mail\Transport\Smtp\Stream\Exception

Returns

string|boolean

setReadPointer()

setReadPointer(integer  $byteOffset) : boolean|void

Not implemented

Parameters

integer $byteOffset

Returns

boolean|void

commitBytes()

commitBytes(string  $bytes) : integer

Write this bytes to the stream

Parameters

string $bytes

Returns

integer

flush()

flush() 

Flush the stream contents

filter()

filter(integer  $bytes) : integer

Run $bytes through all filters

Parameters

integer $bytes

Returns

integer

doWrite()

doWrite(integer  $bytes) 

Just write the bytes to the stream

Parameters

integer $bytes

establishSocketConnection()

establishSocketConnection() 

Establishes a connection to a remote server

establishProcessConnection()

establishProcessConnection() 

Opens a process for input/output

getReadConnectionDescription()

getReadConnectionDescription() : string

Get read connection description

Returns

string