Methods summary
public
|
#
__construct( resource $stream, integer $size = null )
Parameters
- $stream
- Stream resource to wrap
- $size
- Size of the stream in bytes. Only pass if the size cannot be obtained from the stream.
Throws
|
public
|
#
__destruct( )
Closes the stream when the helper is destructed
Closes the stream when the helper is destructed
|
public
string
|
#
__toString( )
Convert the stream to a string if the stream is readable and the stream is seekable.
Convert the stream to a string if the stream is readable and the stream is seekable.
Returns
string
Implementation of
|
public
|
#
close( )
Close the underlying stream
Close the underlying stream
Implementation of
|
public static
boolean|string
|
#
getHash( Guzzle\Stream\StreamInterface $stream, string $algo, boolean $rawOutput = false )
Calculate a hash of a Stream
Calculate a hash of a Stream
Parameters
- $stream
- Stream to calculate the hash for
- $algo
- Hash algorithm (e.g. md5, crc32, etc)
- $rawOutput
- Whether or not to use raw output
Returns
boolean|string Returns false on failure or a hash string on success
|
public
array|mixed|null
|
#
getMetaData( string $key = null )
Get stream metadata
Parameters
- $key
- Specific metadata to retrieve
Returns
array|mixed|null
Implementation of
|
public
resource
|
#
getStream( )
Get the stream resource
Returns
resource
Implementation of
|
public
Guzzle\Stream\Stream
|
#
setStream( resource $stream, integer $size = null )
Set the stream that is wrapped by the object
Set the stream that is wrapped by the object
Parameters
- $stream
- Stream resource to wrap
- $size
- Size of the stream in bytes. Only pass if the size cannot be obtained from the stream.
Returns
Implementation of
|
public
Guzzle\Stream\Stream
|
#
detachStream( )
Detach the current stream resource
Detach the current stream resource
Returns
Implementation of
|
public
string
|
#
getWrapper( )
Get the stream wrapper type
Get the stream wrapper type
Returns
string
Implementation of
|
public
array
|
#
getWrapperData( )
Wrapper specific data attached to this stream.
Wrapper specific data attached to this stream.
Returns
array
Implementation of
|
public
string
|
#
getStreamType( )
Get a label describing the underlying implementation of the stream
Get a label describing the underlying implementation of the stream
Returns
string
Implementation of
|
public
string
|
#
getUri( )
Get the URI/filename associated with this stream
Get the URI/filename associated with this stream
Returns
string
Implementation of
|
public
integer|boolean
|
#
getSize( )
Get the size of the stream if able
Get the size of the stream if able
Returns
integer|boolean
Implementation of
|
public
boolean
|
#
isReadable( )
Check if the stream is readable
Check if the stream is readable
Returns
boolean
Implementation of
|
public
boolean
|
#
isRepeatable( )
Check if the stream is repeatable
Check if the stream is repeatable
Returns
boolean
Implementation of
|
public
boolean
|
#
isWritable( )
Check if the stream is writable
Check if the stream is writable
Returns
boolean
Implementation of
|
public
boolean
|
#
isConsumed( )
Check if the stream has been consumed
Check if the stream has been consumed
Returns
boolean
Implementation of
|
public
boolean
|
#
feof( )
Alias of isConsumed
Returns
boolean
Implementation of
|
public
boolean
|
#
isLocal( )
Check if the stream is a local stream vs a remote stream
Check if the stream is a local stream vs a remote stream
Returns
boolean
Implementation of
|
public
boolean
|
#
isSeekable( )
Check if the string is repeatable
Check if the string is repeatable
Returns
boolean
Implementation of
|
public
Guzzle\Stream\Stream
|
#
setSize( integer $size )
Specify the size of the stream in bytes
Specify the size of the stream in bytes
Parameters
- $size
- Size of the stream contents in bytes
Returns
Implementation of
|
public
boolean
|
#
seek( integer $offset, integer $whence = SEEK_SET )
Seek to a position in the stream
Seek to a position in the stream
Parameters
- $offset
- Stream offset
- $whence
- Where the offset is applied
Returns
boolean Returns TRUE on success or FALSE on failure
Link
Implementation of
|
public
string|boolean
|
#
read( integer $length )
Read data from the stream
Read data from the stream
Parameters
- $length
- Up to length number of bytes read.
Returns
string|boolean Returns the data read from the stream or FALSE on failure or EOF
Implementation of
|
public
integer|boolean
|
#
write( string $string )
Write data to the stream
Parameters
- $string
- The string that is to be written.
Returns
integer|boolean Returns the number of bytes written to the stream on success or FALSE on failure.
Implementation of
|
public
integer|boolean
|
#
ftell( )
Returns the current position of the file read/write pointer
Returns the current position of the file read/write pointer
Returns
integer|boolean Returns the position of the file pointer or false on error
Implementation of
|
public
boolean
|
#
rewind( )
Rewind to the beginning of the stream
Rewind to the beginning of the stream
Returns
boolean Returns true on success or false on failure
Implementation of
|
public
string|boolean
|
#
readLine( integer $maxLength = null )
Read a line from the stream up to the maximum allowed buffer length
Read a line from the stream up to the maximum allowed buffer length
Parameters
- $maxLength
- Maximum buffer length
Returns
string|boolean
Implementation of
|
public
Guzzle\Stream\Stream
|
#
setCustomData( string $key, mixed $value )
Set custom data on the stream
Set custom data on the stream
Parameters
- $key
- Key to set
- $value
- Value to set
Returns
Implementation of
|
public
null|mixed
|
#
getCustomData( string $key )
Get custom data from the stream
Get custom data from the stream
Parameters
Returns
null|mixed
Implementation of
|
protected
|
#
rebuildCache( )
Reprocess stream metadata
Reprocess stream metadata
|
Properties summary
protected
resource
|
$stream
|
|
protected
integer
|
$size
Size of the stream contents in bytes
Size of the stream contents in bytes
|
|
protected
array
|
$cache
|
|
protected
array
|
$customData
|
|
protected static
array
|
$readWriteHash
Hash table of readable and writeable stream types for fast lookups
Hash table of readable and writeable stream types for fast lookups
|
#
array(
'read' => array(
'r' => true, 'w+' => true, 'r+' => true, 'x+' => true, 'c+' => true,
'rb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, 'c+b' => true,
'rt' => true, 'w+t' => true, 'r+t' => true, 'x+t' => true, 'c+t' => true, 'a+' => true
),
'write' => array(
'w' => true, 'w+' => true, 'rw' => true, 'r+' => true, 'x+' => true, 'c+' => true,
'wb' => true, 'w+b' => true, 'r+b' => true, 'x+b' => true, 'c+b' => true,
'w+t' => true, 'r+t' => true, 'x+t' => true, 'c+t' => true, 'a' => true, 'a+' => true
)
)
|