Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • AbstractEntityBodyDecorator
  • CachingEntityBody
  • Client
  • EntityBody
  • IoEmittingEntityBody
  • Mimetypes
  • QueryString
  • ReadLimitEntityBody
  • RedirectPlugin
  • Url

Interfaces

  • ClientInterface
  • EntityBodyInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Class CachingEntityBody

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

Guzzle\Http\AbstractEntityBodyDecorator implements Guzzle\Http\EntityBodyInterface
Extended by Guzzle\Http\CachingEntityBody
Namespace: Guzzle\Http
Located at Guzzle/Http/CachingEntityBody.php
Methods summary
public
# __construct( Guzzle\Http\EntityBodyInterface $body )

We will treat the buffer object as the body of the entity body Wrap an entity body

We will treat the buffer object as the body of the entity body Wrap an entity body

Parameters

$body
Guzzle\Http\EntityBodyInterface
$body Entity body to decorate

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::__construct()
public string
# __toString( )

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

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

Warning: Loads the entire stream into memory

Returns

string

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::__toString()
public integer|boolean
# getSize( )

Get the size of the stream if able

Get the size of the stream if able

Returns

integer|boolean

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::getSize()
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
integer
$offset Stream offset
$whence
integer
$whence Where the offset is applied

Returns

boolean
Returns TRUE on success or FALSE on failure

Throws

Guzzle\Common\Exception\RuntimeException
When seeking with SEEK_END or when seeking past the total size of the buffer stream

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::seek()
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

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::rewind()
public Guzzle\Http\CachingEntityBody
# setRewindFunction( mixed $callable )

Does not support custom rewind functions

Does not support custom rewind functions

Parameters

$callable
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.

Returns

Guzzle\Http\CachingEntityBody

Throws

Guzzle\Common\Exception\RuntimeException

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::setRewindFunction()
public string|boolean
# read( integer $length )

Read data from the stream

Read data from the stream

Parameters

$length
integer
$length Up to length number of bytes read.

Returns

string|boolean
Returns the data read from the stream or FALSE on failure or EOF

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::read()
public integer|boolean
# write( string $string )

Write data to the stream

Write data to the stream

Parameters

$string
string
$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.

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::write()
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
integer
$maxLength Maximum buffer length

Returns

string|boolean

Link

http://php.net/manual/en/function.fgets.php

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::readLine()
public boolean
# isConsumed( )

Check if the stream has been consumed

Check if the stream has been consumed

Returns

boolean

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::isConsumed()
public
# close( )

Close both the remote stream and buffer stream

Close both the remote stream and buffer stream

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::close()
public Guzzle\Http\CachingEntityBody
# setStream( resource $stream, integer $size = 0 )

Set the stream that is wrapped by the object

Set the stream that is wrapped by the object

Parameters

$stream
resource
$stream Stream resource to wrap
$size
integer
$size Size of the stream in bytes. Only pass if the size cannot be obtained from the stream.

Returns

Guzzle\Http\CachingEntityBody

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::setStream()
public string|null
# getContentType( )

Guess the Content-Type of a local stream

Guess the Content-Type of a local stream

Returns

string|null

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::getContentType()
public boolean|string
# getContentEncoding( )

Get the Content-Encoding of the EntityBody

Get the Content-Encoding of the EntityBody

Returns

boolean|string

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::getContentEncoding()
public array|mixed|null
# getMetaData( string $key = null )

Get stream metadata

Get stream metadata

Parameters

$key
string
$key Specific metadata to retrieve

Returns

array|mixed|null

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::getMetaData()
public resource
# getStream( )

Get the stream resource

Get the stream resource

Returns

resource

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::getStream()
public string
# getWrapper( )

Get the stream wrapper type

Get the stream wrapper type

Returns

string

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::getWrapper()
public array
# getWrapperData( )

Wrapper specific data attached to this stream.

Wrapper specific data attached to this stream.

Returns

array

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::getWrapperData()
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

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::getStreamType()
public string
# getUri( )

Get the URI/filename associated with this stream

Get the URI/filename associated with this stream

Returns

string

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::getUri()
public null|mixed
# getCustomData( string $key )

Always retrieve custom data from the remote stream

Always retrieve custom data from the remote stream

Parameters

$key
string
$key Key to retrieve

Returns

null|mixed

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::getCustomData()
public Guzzle\Http\CachingEntityBody
# setCustomData( string $key, mixed $value )

Always set custom data on the remote stream

Always set custom data on the remote stream

Parameters

$key
string
$key Key to set
$value
mixed
$value Value to set

Returns

Guzzle\Http\CachingEntityBody

Overrides

Guzzle\Http\AbstractEntityBodyDecorator::setCustomData()
Methods inherited from Guzzle\Http\AbstractEntityBodyDecorator
__call(), compress(), feof(), ftell(), getContentLength(), getContentMd5(), isLocal(), isReadable(), isSeekable(), isWritable(), setSize(), uncompress()
Properties summary
protected Guzzle\Http\EntityBody $remoteStream
#

Remote stream used to actually pull data onto the buffer

Remote stream used to actually pull data onto the buffer

protected integer $skipReadBytes 0
#

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

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

Properties inherited from Guzzle\Http\AbstractEntityBodyDecorator
$body
php-coveralls API documentation generated by ApiGen 2.8.0