TYPO3  7.6
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Swift_Transport_StreamBuffer Class Reference
Inheritance diagram for Swift_Transport_StreamBuffer:
Swift_ByteStream_AbstractFilterableInputStream Swift_Transport_IoBuffer Swift_InputByteStream Swift_Filterable Swift_InputByteStream Swift_OutputByteStream

Public Member Functions

 __construct (Swift_ReplacementFilterFactory $replacementFactory)
 
 initialize (array $params)
 
 setParam ($param, $value)
 
 startTLS ()
 
 terminate ()
 
 setWriteTranslations (array $replacements)
 
 readLine ($sequence)
 
 read ($length)
 
 setReadPointer ($byteOffset)
 
- Public Member Functions inherited from Swift_ByteStream_AbstractFilterableInputStream
 addFilter (Swift_StreamFilter $filter, $key)
 
 removeFilter ($key)
 
 write ($bytes)
 
 commit ()
 
 bind (Swift_InputByteStream $is)
 
 unbind (Swift_InputByteStream $is)
 
 flushBuffers ()
 

Protected Member Functions

 _flush ()
 
 _commit ($bytes)
 
- Protected Member Functions inherited from Swift_ByteStream_AbstractFilterableInputStream
 _commit ($bytes)
 
 _flush ()
 

Private Member Functions

 _establishSocketConnection ()
 
 _establishProcessConnection ()
 
 _getReadConnectionDescription ()
 

Private Attributes

 $_stream
 
 $_in
 
 $_out
 
 $_params = array()
 
 $_replacementFactory
 
 $_translations = array()
 

Additional Inherited Members

- Public Attributes inherited from Swift_Transport_IoBuffer
const TYPE_SOCKET = 0x0001
 
const TYPE_PROCESS = 0x0010
 
- Protected Attributes inherited from Swift_ByteStream_AbstractFilterableInputStream
 $_sequence = 0
 

Detailed Description

A generic IoBuffer implementation supporting remote sockets and local processes.

Author
Chris Corbyn

Definition at line 16 of file StreamBuffer.php.

Constructor & Destructor Documentation

__construct ( Swift_ReplacementFilterFactory  $replacementFactory)

Create a new StreamBuffer using $replacementFactory for transformations.

Parameters
Swift_ReplacementFilterFactory$replacementFactory

Definition at line 41 of file StreamBuffer.php.

Member Function Documentation

_commit (   $bytes)
protected

Write this bytes to the stream

Definition at line 225 of file StreamBuffer.php.

References Swift_ByteStream_AbstractFilterableInputStream\$_sequence.

_establishProcessConnection ( )
private

Opens a process for input/output.

Definition at line 283 of file StreamBuffer.php.

Referenced by initialize().

_establishSocketConnection ( )
private

Establishes a connection to a remote server.

Definition at line 249 of file StreamBuffer.php.

References $_stream.

Referenced by initialize().

_flush ( )
protected

Flush the stream contents

Definition at line 217 of file StreamBuffer.php.

_getReadConnectionDescription ( )
private

Definition at line 302 of file StreamBuffer.php.

Referenced by read(), and readLine().

initialize ( array  $params)

Perform any initialization needed, using the given $params.

Parameters will vary depending upon the type of IoBuffer used.

Parameters
array$params

Implements Swift_Transport_IoBuffer.

Definition at line 53 of file StreamBuffer.php.

References _establishProcessConnection(), and _establishSocketConnection().

read (   $length)

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
int$length
Exceptions
Swift_IoException
Returns
string|bool

Implements Swift_OutputByteStream.

Definition at line 192 of file StreamBuffer.php.

References _getReadConnectionDescription().

readLine (   $sequence)

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
int$sequenceof last write to scan from
Exceptions
Swift_IoException
Returns
string

Implements Swift_Transport_IoBuffer.

Definition at line 160 of file StreamBuffer.php.

References _getReadConnectionDescription().

setParam (   $param,
  $value 
)

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

Parameters
string$param
mixed$value

Implements Swift_Transport_IoBuffer.

Definition at line 73 of file StreamBuffer.php.

setReadPointer (   $byteOffset)

Not implemented

Implements Swift_OutputByteStream.

Definition at line 212 of file StreamBuffer.php.

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
string[]$replacements

Implements Swift_Transport_IoBuffer.

Definition at line 129 of file StreamBuffer.php.

References Swift_ByteStream_AbstractFilterableInputStream\addFilter(), and Swift_ByteStream_AbstractFilterableInputStream\removeFilter().

startTLS ( )

Definition at line 93 of file StreamBuffer.php.

terminate ( )

Perform any shutdown logic needed.

Implements Swift_Transport_IoBuffer.

Definition at line 101 of file StreamBuffer.php.

Member Data Documentation

$_in
private

The input stream

Definition at line 22 of file StreamBuffer.php.

$_out
private

The output stream

Definition at line 25 of file StreamBuffer.php.

$_params = array()
private

Buffer initialization parameters

Definition at line 28 of file StreamBuffer.php.

$_replacementFactory
private

The ReplacementFilterFactory

Definition at line 31 of file StreamBuffer.php.

$_stream
private

A primary socket

Definition at line 19 of file StreamBuffer.php.

Referenced by _establishSocketConnection().

$_translations = array()
private

Translations performed on data being streamed into the buffer

Definition at line 34 of file StreamBuffer.php.