Overview

Namespaces

  • Docta
    • MercadoLibre
      • Exception
      • OAuth2
        • Client
          • Test
  • GuzzleHttp
    • Cookie
    • Exception
    • Handler
    • Promise
      • Test
      • Tests
    • Psr7
    • Test
      • Handler
    • Tests
      • CookieJar
      • Event
      • Exception
      • Handler
      • Promise
      • Psr7
  • League
    • OAuth2
      • Client
        • Grant
          • Exception
        • Provider
          • Exception
        • Test
          • Grant
          • Provider
            • Exception
            • Fake
          • Token
          • Tool
        • Token
        • Tool
  • None
  • Psr
    • Http
      • Message

Classes

  • AppendStream
  • BufferStream
  • CachingStream
  • DroppingStream
  • FnStream
  • InflateStream
  • LazyOpenStream
  • LimitStream
  • MultipartStream
  • NoSeekStream
  • PumpStream
  • Request
  • Response
  • ServerRequest
  • Stream
  • StreamWrapper
  • UploadedFile
  • Uri
  • UriNormalizer
  • UriResolver

Traits

  • MessageTrait
  • StreamDecoratorTrait

Functions

  • build_query
  • copy_to_stream
  • copy_to_string
  • fread
  • hash
  • mimetype_from_extension
  • mimetype_from_filename
  • modify_request
  • normalize_header
  • parse_header
  • parse_query
  • parse_request
  • parse_response
  • readline
  • rewind_body
  • str
  • stream_for
  • try_fopen
  • uri_for
  • Overview
  • Namespace
  • Class
  • Download

Class CachingStream

Stream decorator that can cache previously read bytes from a sequentially read stream.

GuzzleHttp\Psr7\CachingStream implements Psr\Http\Message\StreamInterface uses GuzzleHttp\Psr7\StreamDecoratorTrait
Namespace: GuzzleHttp\Psr7
Located at src/CachingStream.php
Methods summary
public
# __construct( Psr\Http\Message\StreamInterface $stream, Psr\Http\Message\StreamInterface $target = null )

We will treat the buffer object as the body of the stream

We will treat the buffer object as the body of the stream

Parameters

$stream
Stream to cache
$target
Optionally specify where data is cached
public integer|null
# getSize( )

Get the size of the stream if known.

Get the size of the stream if known.

Returns

integer|null
Returns the size in bytes if known, or null if unknown.

Implementation of

Psr\Http\Message\StreamInterface::getSize()
public
# rewind( )

Seek to the beginning of the stream.

Seek to the beginning of the stream.

If the stream is not seekable, this method will raise an exception; otherwise, it will perform a seek(0).

Throws

RuntimeException
on failure.

See

GuzzleHttp\Psr7\CachingStream::seek()

Link

http://www.php.net/manual/en/function.fseek.php

Implementation of

Psr\Http\Message\StreamInterface::rewind()
public
# seek( integer $offset, integer $whence = SEEK_SET )

Seek to a position in the stream.

Seek to a position in the stream.

Parameters

$offset
Stream offset
$whence

Specifies how the cursor position will be calculated based on the seek offset. Valid values are identical to the built-in PHP $whence values for fseek(). SEEK_SET: Set position equal to offset bytes SEEK_CUR: Set position to current location plus offset SEEK_END: Set position to end-of-stream plus offset.

Throws

RuntimeException
on failure.

Link

http://www.php.net/manual/en/function.fseek.php

Implementation of

Psr\Http\Message\StreamInterface::seek()
public string
# read( integer $length )

Read data from the stream.

Read data from the stream.

Parameters

$length

Read up to $length bytes from the object and return them. Fewer than $length bytes may be returned if underlying stream call returns fewer bytes.

Returns

string

Returns the data read from the stream, or an empty string if no bytes are available.

Throws

RuntimeException
if an error occurs.

Implementation of

Psr\Http\Message\StreamInterface::read()
public integer
# write( string $string )

Write data to the stream.

Write data to the stream.

Parameters

$string
The string that is to be written.

Returns

integer
Returns the number of bytes written to the stream.

Throws

RuntimeException
on failure.

Implementation of

Psr\Http\Message\StreamInterface::write()
public boolean
# eof( )

Returns true if the stream is at the end of the stream.

Returns true if the stream is at the end of the stream.

Returns

boolean

Implementation of

Psr\Http\Message\StreamInterface::eof()
public
# close( )

Close both the remote stream and buffer stream

Close both the remote stream and buffer stream

Implementation of

Psr\Http\Message\StreamInterface::close()
Methods inherited from Psr\Http\Message\StreamInterface
__toString(), detach(), getContents(), getMetadata(), isReadable(), isSeekable(), isWritable(), tell()
Methods used from GuzzleHttp\Psr7\StreamDecoratorTrait
__call(), __get(), __toString(), createStream(), detach(), getContents(), getMetadata(), isReadable(), isSeekable(), isWritable(), tell()
MercadoLibre PHP SDK API documentation generated by ApiGen