Open Journal Systems
3.3.0
|
Public Member Functions | |
compress ($filter='zlib.deflate') | |
getContentEncoding () | |
getContentLength () | |
getContentMd5 ($rawOutput=false, $base64Encode=false) | |
getContentType () | |
rewind () | |
setRewindFunction ($callable) | |
setStreamFilterContentEncoding ($streamFilterContentEncoding) | |
uncompress ($filter='zlib.inflate') | |
![]() | |
__construct ($stream, $size=null) | |
__destruct () | |
__toString () | |
close () | |
detachStream () | |
feof () | |
ftell () | |
getCustomData ($key) | |
getMetaData ($key=null) | |
getSize () | |
getStream () | |
getStreamType () | |
getUri () | |
getWrapper () | |
getWrapperData () | |
isConsumed () | |
isLocal () | |
isReadable () | |
isRepeatable () | |
isSeekable () | |
isWritable () | |
read ($length) | |
readLine ($maxLength=null) | |
seek ($offset, $whence=SEEK_SET) | |
setCustomData ($key, $value) | |
setSize ($size) | |
setStream ($stream, $size=null) | |
write ($string) | |
Static Public Member Functions | |
static | calculateMd5 (EntityBodyInterface $body, $rawOutput=false, $base64Encode=false) |
static | factory ($resource='', $size=null) |
static | fromString ($string) |
![]() | |
static | getHash (StreamInterface $stream, $algo, $rawOutput=false) |
Protected Member Functions | |
handleCompression ($filter, $offsetStart=0) | |
![]() | |
rebuildCache () | |
Protected Attributes | |
$contentEncoding = false | |
$rewindFunction | |
![]() | |
$cache = array() | |
$customData = array() | |
$size | |
$stream | |
Additional Inherited Members | |
![]() | |
const | IS_LOCAL = 'is_local' |
const | IS_READABLE = 'is_readable' |
const | IS_WRITABLE = 'is_writable' |
const | SEEKABLE = 'seekable' |
const | STREAM_TYPE = 'stream_type' |
const | WRAPPER_TYPE = 'wrapper_type' |
![]() | |
static | $readWriteHash |
Entity body used with an HTTP request or response
Definition at line 13 of file EntityBody.php.
|
static |
Calculate the MD5 hash of an entity body
EntityBodyInterface | $body | Entity body to calculate the hash for |
bool | $rawOutput | Whether or not to use raw output |
bool | $base64Encode | Whether or not to base64 encode raw output (only if raw output is true) |
Definition at line 153 of file EntityBody.php.
References Guzzle\Http\EntityBodyInterface\getContentMd5(), and Guzzle\Common\Version\warn().
Guzzle\Http\EntityBody::compress | ( | $filter = 'zlib.deflate' | ) |
If the stream is readable, compress the data in the stream using deflate compression. The uncompressed stream is then closed, and the compressed stream then becomes the wrapped stream.
string | $filter | Compression filter |
Implements Guzzle\Http\EntityBodyInterface.
Definition at line 93 of file EntityBody.php.
References Guzzle\Http\EntityBody\handleCompression().
|
static |
Create a new EntityBody based on the input type
resource | string | EntityBody | $resource | Entity body data |
int | $size | Size of the data contained in the resource |
InvalidArgumentException | if the $resource arg is not a resource or string |
Definition at line 36 of file EntityBody.php.
References Guzzle\Stream\Stream\$size, and Guzzle\Http\EntityBody\fromString().
Referenced by Guzzle\Http\Message\Response\__construct(), Guzzle\Tests\Http\Curl\CurlHandleTest\dataProvider(), Guzzle\Http\Message\Request\getResponseBody(), Guzzle\Plugin\Log\LogPlugin\onRequestBeforeSend(), Guzzle\Http\Curl\RequestMediator\receiveResponseHeader(), Guzzle\Http\Message\EntityEnclosingRequest\setBody(), Guzzle\Http\Message\Response\setBody(), Guzzle\Http\Message\Request\setResponseBody(), Guzzle\Tests\Http\IoEmittingEntityBodyTest\setUp(), Guzzle\Tests\Log\MessageFormatterTest\setUp(), Guzzle\Tests\Http\CachingEntityBodyTest\setUp(), Guzzle\Tests\Http\ReadLimitEntityBodyTest\setUp(), Guzzle\Tests\Service\Command\LocationVisitor\Request\BodyVisitorTest\testAddsContentEncodingWhenSetOnBody(), Guzzle\Tests\Http\EntityBodyTest\testAllowsCustomRewind(), Guzzle\Tests\Service\Command\CommandTest\testCanChangeResponseBody(), Guzzle\Tests\Http\Message\HttpRequestFactoryTest\testCanChangeSaveToLocation(), Guzzle\Tests\Http\CachingEntityBodyTest\testClosesBothStreams(), Guzzle\Tests\Message\ResponseTest\testConstructor(), Guzzle\Tests\Http\EntityBodyTest\testCreatesMd5Checksum(), Guzzle\Tests\Http\Message\HttpRequestFactoryTest\testCreatesNewGetRequests(), Guzzle\Tests\Http\Message\HttpRequestFactoryTest\testCreatesPutRequests(), Guzzle\Tests\Http\EntityBodyTest\testCustomRewindFunctionMustBeCallable(), Guzzle\Tests\Http\AbstractEntityBodyDecoratorTest\testDecoratesEntityBody(), Guzzle\Tests\Http\EntityBodyTest\testDeterminesContentType(), Guzzle\Tests\Message\ResponseTest\testDeterminesIfItCanBeCached(), Guzzle\Tests\Http\EntityBodyTest\testFactory(), Guzzle\Tests\Http\EntityBodyTest\testFactoryCanCreateFromObject(), Guzzle\Tests\Http\EntityBodyTest\testFactoryCreatesTempStreamByDefault(), Guzzle\Tests\Http\EntityBodyTest\testFactoryEnsuresObjectsHaveToStringMethod(), Guzzle\Tests\Http\EntityBodyTest\testFactoryThrowsException(), Guzzle\Tests\Message\ResponseTest\testGetBody(), Guzzle\Tests\Http\EntityBodyTest\testGetTypeFormBodyFactoring(), Guzzle\Tests\Http\EntityBodyTest\testHandlesCompression(), Guzzle\Tests\Plugin\Md5\Md5ValidatorPluginTest\testProperlyValidatesWhenUsingContentEncoding(), Guzzle\Tests\Plugin\Mock\MockPluginTest\testReadsBodiesFromMockedRequests(), Guzzle\Tests\Http\Message\EntityEnclosingRequestTest\testRequestBodyAddsContentLength(), Guzzle\Tests\Http\Message\RequestTest\testRequestCanHaveManuallySetResponseBody(), Guzzle\Tests\Http\Message\EntityEnclosingRequestTest\testRequestHasMutableBody(), Guzzle\Tests\Http\ReadLimitEntityBodyTest\testReturnsSubsetOfEmptyBodyWhenCastToString(), Guzzle\Tests\Http\ReadLimitEntityBodyTest\testReturnsSubsetWhenCastToString(), Guzzle\Tests\Plugin\Redirect\RedirectPluginTest\testRewindsStreamWhenRedirectingIfNeeded(), Guzzle\Tests\Http\CachingEntityBodyTest\testRewindUsesSeek(), Guzzle\Tests\Http\EntityBodyTest\testSeeksToOriginalPosAfterMd5(), Guzzle\Tests\Http\Message\EntityEnclosingRequestTest\testSetsContentTypeWhenSettingBodyByGuessingFromEntityBody(), Guzzle\Tests\Http\CachingEntityBodyTest\testSkipsOverwrittenBytes(), Guzzle\Tests\Plugin\Redirect\RedirectPluginTest\testThrowsExceptionWhenStreamCannotBeRewound(), Guzzle\Tests\Http\Curl\CurlHandleTest\testUploadsPutData(), Guzzle\Tests\Http\Curl\CurlHandleTest\testUploadsPutDataUsingChunkedEncodingWhenLengthCannotBeDetermined(), Guzzle\Tests\Http\Message\RequestTest\testUsesCustomResponseBodyWhenItIsCustom(), Guzzle\Tests\Http\CachingEntityBodyTest\testUsesRemoteSizeIfPossible(), Guzzle\Tests\Plugin\Log\LogPluginTest\testWiresBodiesWhenNeeded(), and Guzzle\Service\Command\LocationVisitor\Request\BodyVisitor\visit().
|
static |
Create a new EntityBody from a string
string | $string | String of data |
Definition at line 82 of file EntityBody.php.
References Guzzle\Stream\Stream\$stream, and Guzzle\Http\EntityBody\rewind().
Referenced by Guzzle\Http\EntityBody\factory().
Guzzle\Http\EntityBody::getContentEncoding | ( | ) |
Get the Content-Encoding of the EntityBody
Implements Guzzle\Http\EntityBodyInterface.
Definition at line 166 of file EntityBody.php.
Guzzle\Http\EntityBody::getContentLength | ( | ) |
Get the Content-Length of the entity body if possible (alias of getSize)
Implements Guzzle\Http\EntityBodyInterface.
Definition at line 123 of file EntityBody.php.
References Guzzle\Stream\Stream\getSize().
Guzzle\Http\EntityBody::getContentMd5 | ( | $rawOutput = false , |
|
$base64Encode = false |
|||
) |
Get an MD5 checksum of the stream's contents
bool | $rawOutput | Whether or not to use raw output |
bool | $base64Encode | Whether or not to base64 encode raw output (only if raw output is true) |
Implements Guzzle\Http\EntityBodyInterface.
Definition at line 133 of file EntityBody.php.
Guzzle\Http\EntityBody::getContentType | ( | ) |
Guess the Content-Type of a local stream
Implements Guzzle\Http\EntityBodyInterface.
Definition at line 128 of file EntityBody.php.
References Guzzle\Http\Mimetypes\getInstance(), and Guzzle\Stream\Stream\getUri().
|
protected |
Definition at line 174 of file EntityBody.php.
References Guzzle\Stream\Stream\isConsumed(), Guzzle\Stream\Stream\isReadable(), Guzzle\Stream\Stream\isSeekable(), Guzzle\Stream\Stream\rebuildCache(), and Guzzle\Stream\Stream\seek().
Referenced by Guzzle\Http\EntityBody\compress(), and Guzzle\Http\EntityBody\uncompress().
Guzzle\Http\EntityBody::rewind | ( | ) |
Rewind to the beginning of the stream
Reimplemented from Guzzle\Stream\Stream.
Definition at line 70 of file EntityBody.php.
Referenced by Guzzle\Http\EntityBody\fromString().
Guzzle\Http\EntityBody::setRewindFunction | ( | $callable | ) |
Specify a custom callback used to rewind a non-seekable stream. This can be useful entity enclosing requests that are redirected.
mixed | $callable | Callable to invoke to rewind a non-seekable stream. The callback must accept an EntityBodyInterface object, perform the rewind if possible, and return a boolean representing whether or not the rewind was successful. |
Implements Guzzle\Http\EntityBodyInterface.
Definition at line 59 of file EntityBody.php.
Guzzle\Http\EntityBody::setStreamFilterContentEncoding | ( | $streamFilterContentEncoding | ) |
Definition at line 159 of file EntityBody.php.
Guzzle\Http\EntityBody::uncompress | ( | $filter = 'zlib.inflate' | ) |
Decompress a deflated string. Once uncompressed, the uncompressed string is then used as the wrapped stream.
string | $filter | De-compression filter |
Implements Guzzle\Http\EntityBodyInterface.
Definition at line 101 of file EntityBody.php.
References Guzzle\Http\EntityBody\handleCompression(), Guzzle\Stream\Stream\isConsumed(), Guzzle\Stream\Stream\isReadable(), and Guzzle\Stream\Stream\isSeekable().
|
protected |
Content-Encoding of the entity body if known
Definition at line 19 of file EntityBody.php.
|
protected |
Method to invoke for rewinding a stream
Definition at line 25 of file EntityBody.php.