Class Guzzle\Http\CachingEntityBody

InheritanceGuzzle\Http\CachingEntityBody » Guzzle\Http\AbstractEntityBodyDecorator
ImplementsGuzzle\Http\EntityBodyInterface

EntityBody decorator that can cache previously read bytes from a sequentially read tstream

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$body Guzzle\Http\EntityBodyInterface Decorated entity body Guzzle\Http\AbstractEntityBodyDecorator
$remoteStream Guzzle\Http\EntityBody Remote stream used to actually pull data onto the buffer Guzzle\Http\CachingEntityBody
$skipReadBytes int The number of bytes to skip reading due to a write on the temporary buffer Guzzle\Http\CachingEntityBody

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Allow decorators to implement custom methods Guzzle\Http\AbstractEntityBodyDecorator
__construct() We will treat the buffer object as the body of the entity body {@inheritdoc} Guzzle\Http\CachingEntityBody
__toString() Will give the contents of the buffer followed by the exhausted remote stream. Guzzle\Http\CachingEntityBody
close() Close both the remote stream and buffer stream Guzzle\Http\CachingEntityBody
compress() Guzzle\Http\AbstractEntityBodyDecorator
detachStream() Guzzle\Http\AbstractEntityBodyDecorator
feof() Alias of isConsumed() {@inheritdoc} Guzzle\Http\AbstractEntityBodyDecorator
ftell() Guzzle\Http\AbstractEntityBodyDecorator
getContentEncoding() Guzzle\Http\CachingEntityBody
getContentLength() Guzzle\Http\AbstractEntityBodyDecorator
getContentMd5() Guzzle\Http\AbstractEntityBodyDecorator
getContentType() Guzzle\Http\CachingEntityBody
getCustomData() Always retrieve custom data from the remote stream {@inheritdoc} Guzzle\Http\CachingEntityBody
getMetaData() Guzzle\Http\CachingEntityBody
getSize() Guzzle\Http\CachingEntityBody
getStream() Guzzle\Http\CachingEntityBody
getStreamType() Guzzle\Http\CachingEntityBody
getUri() Guzzle\Http\CachingEntityBody
getWrapper() Guzzle\Http\CachingEntityBody
getWrapperData() Guzzle\Http\CachingEntityBody
isConsumed() Guzzle\Http\CachingEntityBody
isLocal() Guzzle\Http\AbstractEntityBodyDecorator
isReadable() Guzzle\Http\AbstractEntityBodyDecorator
isRepeatable() Guzzle\Http\AbstractEntityBodyDecorator
isSeekable() Guzzle\Http\AbstractEntityBodyDecorator
isWritable() Guzzle\Http\AbstractEntityBodyDecorator
read() Guzzle\Http\CachingEntityBody
readLine() {@inheritdoc} Guzzle\Http\CachingEntityBody
rewind() Guzzle\Http\CachingEntityBody
seek() {@inheritdoc} Guzzle\Http\CachingEntityBody
setCustomData() Always set custom data on the remote stream {@inheritdoc} Guzzle\Http\CachingEntityBody
setRewindFunction() Does not support custom rewind functions Guzzle\Http\CachingEntityBody
setSize() Guzzle\Http\AbstractEntityBodyDecorator
setStream() Guzzle\Http\CachingEntityBody
uncompress() Guzzle\Http\AbstractEntityBodyDecorator
write() Guzzle\Http\CachingEntityBody

Property Details

$remoteStream protected property

Remote stream used to actually pull data onto the buffer

$skipReadBytes protected property

The number of bytes to skip reading due to a write on the temporary buffer

protected int $skipReadBytes 0

Method Details

__construct() public method

We will treat the buffer object as the body of the entity body {@inheritdoc}

public void __construct ( Guzzle\Http\EntityBodyInterface $body )
$body
__toString() public method

Will give the contents of the buffer followed by the exhausted remote stream.

Warning: Loads the entire stream into memory

public string __toString ( )
close() public method

Close both the remote stream and buffer stream

public void close ( )
getContentEncoding() public method

public void getContentEncoding ( )
getContentType() public method

public void getContentType ( )
getCustomData() public method

Always retrieve custom data from the remote stream {@inheritdoc}

public void getCustomData ( $key )
$key
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 ( )
read() public method

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

{@inheritdoc}

public void readLine ( $maxLength null )
$maxLength
rewind() public method

public void rewind ( )
seek() public method

{@inheritdoc}

public void seek ( $offset, $whence SEEK_SET )
$offset
$whence
throws Guzzle\Common\Exception\RuntimeException

When seeking with SEEK_END or when seeking past the total size of the buffer stream

setCustomData() public method

Always set custom data on the remote stream {@inheritdoc}

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

Does not support custom rewind functions

public void setRewindFunction ( $callable )
$callable
throws Guzzle\Common\Exception\RuntimeException
setStream() public method

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

public void write ( $string )
$string