Class Guzzle\Stream\Stream

InheritanceGuzzle\Stream\Stream
ImplementsGuzzle\Stream\StreamInterface
SubclassesGuzzle\Http\EntityBody

PHP stream implementation

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$cache array Stream cached data Guzzle\Stream\Stream
$customData array Custom stream data Guzzle\Stream\Stream
$readWriteHash array Hash table of readable and writeable stream types for fast lookups Guzzle\Stream\Stream
$size int Size of the stream contents in bytes Guzzle\Stream\Stream
$stream resource Stream resource Guzzle\Stream\Stream

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
rebuildCache() Reprocess stream metadata Guzzle\Stream\Stream

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
IS_LOCAL 'is_local' Guzzle\Stream\Stream
IS_READABLE 'is_readable' Guzzle\Stream\Stream
IS_WRITABLE 'is_writable' Guzzle\Stream\Stream
SEEKABLE 'seekable' Guzzle\Stream\Stream
STREAM_TYPE 'stream_type' Guzzle\Stream\Stream
WRAPPER_TYPE 'wrapper_type' Guzzle\Stream\Stream

Property Details

$cache protected property

Stream cached data

protected array $cache = []
$customData protected property

Custom stream data

protected array $customData = []
$readWriteHash protected static property

Hash table of readable and writeable stream types for fast lookups

protected static array $readWriteHash = ['read' => ['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' => ['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]]
$size protected property

Size of the stream contents in bytes

protected int $size null
$stream protected property

Stream resource

protected resource $stream null

Method Details

__construct() public method

public void __construct ( $stream, $size null )
$stream resource

Stream resource to wrap

$size int

Size of the stream in bytes. Only pass if the size cannot be obtained from the stream.

throws Guzzle\Common\Exception\InvalidArgumentException

if the stream is not a stream resource

__destruct() public method

Closes the stream when the helper is destructed

public void __destruct ( )
__toString() public method

public void __toString ( )
close() public method

public void close ( )
detachStream() public method

public void detachStream ( )
feof() public method

public void feof ( )
ftell() public method

public void ftell ( )
getCustomData() public method

public void getCustomData ( $key )
$key
getHash() public static method

Calculate a hash of a Stream

public static bool|string getHash ( Guzzle\Stream\StreamInterface $stream, $algo, $rawOutput false )
$stream Guzzle\Stream\StreamInterface

Stream to calculate the hash for

$algo string

Hash algorithm (e.g. md5, crc32, etc)

$rawOutput bool

Whether or not to use raw output

return bool|string

Returns false on failure or a hash string on success

getMetaData() public method

public void getMetaData ( $key null )
$key
getSize() public method

public void getSize ( )
getStream() public method

public void getStream ( )
getStreamType() public method

public void getStreamType ( )
getUri() public method

public void getUri ( )
getWrapper() public method

public void getWrapper ( )
getWrapperData() public method

public void getWrapperData ( )
isConsumed() public method

public void isConsumed ( )
isLocal() public method

public void isLocal ( )
isReadable() public method

public void isReadable ( )
isRepeatable() public method

public void isRepeatable ( )
isSeekable() public method

public void isSeekable ( )
isWritable() public method

public void isWritable ( )
read() public method

public void read ( $length )
$length
readLine() public method

public void readLine ( $maxLength null )
$maxLength
rebuildCache() protected method

Reprocess stream metadata

protected void rebuildCache ( )
rewind() public method

public void rewind ( )
seek() public method

public void seek ( $offset, $whence SEEK_SET )
$offset
$whence
setCustomData() public method

public void setCustomData ( $key, $value )
$key
$value
setSize() public method

public void setSize ( $size )
$size
setStream() public method

public void setStream ( $stream, $size null )
$stream
$size
write() public method

public void write ( $string )
$string