Class Guzzle\Http\EntityBody

InheritanceGuzzle\Http\EntityBody » Guzzle\Stream\Stream
ImplementsGuzzle\Http\EntityBodyInterface, Guzzle\Stream\StreamInterface

Entity body used with an HTTP request or response

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$cache array Stream cached data Guzzle\Stream\Stream
$contentEncoding bool Content-Encoding of the entity body if known Guzzle\Http\EntityBody
$customData array Custom stream data Guzzle\Stream\Stream
$readWriteHash array Hash table of readable and writeable stream types for fast lookups Guzzle\Stream\Stream
$rewindFunction callable Method to invoke for rewinding a stream Guzzle\Http\EntityBody
$size int Size of the stream contents in bytes Guzzle\Stream\Stream
$stream resource Stream resource Guzzle\Stream\Stream

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Guzzle\Stream\Stream
__destruct() Closes the stream when the helper is destructed Guzzle\Stream\Stream
__toString() Guzzle\Stream\Stream
calculateMd5() Calculate the MD5 hash of an entity body Guzzle\Http\EntityBody
close() Guzzle\Stream\Stream
compress() Guzzle\Http\EntityBody
detachStream() Guzzle\Stream\Stream
factory() Create a new EntityBody based on the input type Guzzle\Http\EntityBody
feof() Guzzle\Stream\Stream
fromString() Create a new EntityBody from a string Guzzle\Http\EntityBody
ftell() Guzzle\Stream\Stream
getContentEncoding() Guzzle\Http\EntityBody
getContentLength() Guzzle\Http\EntityBody
getContentMd5() Guzzle\Http\EntityBody
getContentType() Guzzle\Http\EntityBody
getCustomData() Guzzle\Stream\Stream
getHash() Calculate a hash of a Stream Guzzle\Stream\Stream
getMetaData() Guzzle\Stream\Stream
getSize() Guzzle\Stream\Stream
getStream() Guzzle\Stream\Stream
getStreamType() Guzzle\Stream\Stream
getUri() Guzzle\Stream\Stream
getWrapper() Guzzle\Stream\Stream
getWrapperData() Guzzle\Stream\Stream
isConsumed() Guzzle\Stream\Stream
isLocal() Guzzle\Stream\Stream
isReadable() Guzzle\Stream\Stream
isRepeatable() Guzzle\Stream\Stream
isSeekable() Guzzle\Stream\Stream
isWritable() Guzzle\Stream\Stream
read() Guzzle\Stream\Stream
readLine() Guzzle\Stream\Stream
rewind() Guzzle\Http\EntityBody
seek() Guzzle\Stream\Stream
setCustomData() Guzzle\Stream\Stream
setRewindFunction() Guzzle\Http\EntityBody
setSize() Guzzle\Stream\Stream
setStream() Guzzle\Stream\Stream
setStreamFilterContentEncoding() Guzzle\Http\EntityBody
uncompress() Guzzle\Http\EntityBody
write() Guzzle\Stream\Stream

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
handleCompression() Guzzle\Http\EntityBody
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

$contentEncoding protected property

Content-Encoding of the entity body if known

protected bool $contentEncoding false
$rewindFunction protected property

Method to invoke for rewinding a stream

protected callable $rewindFunction null

Method Details

calculateMd5() public static method

Calculate the MD5 hash of an entity body

public static bool|string calculateMd5 ( Guzzle\Http\EntityBodyInterface $body, $rawOutput false, $base64Encode false )
$body Guzzle\Http\EntityBodyInterface

Entity body to calculate the hash for

$rawOutput bool

Whether or not to use raw output

$base64Encode bool

Whether or not to base64 encode raw output (only if raw output is true)

return bool|string

Returns an MD5 string on success or FALSE on failure

compress() public method

public void compress ( $filter 'zlib.deflate' )
$filter
factory() public static method

Create a new EntityBody based on the input type

public static Guzzle\Http\EntityBody factory ( $resource '', $size null )
$resource resource|string|Guzzle\Http\EntityBody

Entity body data

$size int

Size of the data contained in the resource

throws Guzzle\Common\Exception\InvalidArgumentException

if the $resource arg is not a resource or string

fromString() public static method

Create a new EntityBody from a string

public static Guzzle\Http\EntityBody fromString ( $string )
$string string

String of data

getContentEncoding() public method

public void getContentEncoding ( )
getContentLength() public method

public void getContentLength ( )
getContentMd5() public method

public void getContentMd5 ( $rawOutput false, $base64Encode false )
$rawOutput
$base64Encode
getContentType() public method

public void getContentType ( )
handleCompression() protected method

protected void handleCompression ( $filter, $offsetStart 0 )
$filter
$offsetStart
rewind() public method

public void rewind ( )
setRewindFunction() public method

public void setRewindFunction ( $callable )
$callable
setStreamFilterContentEncoding() public method

public void setStreamFilterContentEncoding ( $streamFilterContentEncoding )
$streamFilterContentEncoding
uncompress() public method

public void uncompress ( $filter 'zlib.inflate' )
$filter