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

  • PhpStreamRequestFactory
  • Stream

Interfaces

  • StreamInterface
  • StreamRequestFactoryInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Class PhpStreamRequestFactory

Factory used to create fopen streams using PHP's http and https stream wrappers

Note: PHP's http stream wrapper only supports streaming downloads. It does not support streaming uploads.

Guzzle\Stream\PhpStreamRequestFactory implements Guzzle\Stream\StreamRequestFactoryInterface
Namespace: Guzzle\Stream
Located at Guzzle/Stream/PhpStreamRequestFactory.php
Methods summary
public Guzzle\Stream\StreamInterface
# fromRequest( Guzzle\Http\Message\RequestInterface $request, array|resource $context = array(), array $params = array() )

Create a stream based on a request object

Create a stream based on a request object

The $params array can contain the following custom keys specific to the PhpStreamRequestFactory:

  • stream_class: The name of a class to create instead of a Guzzle\Stream\Stream object

Parameters

$request
Guzzle\Http\Message\RequestInterface
$request Base the stream on a request
$context
array|resource
$context A stream_context_options resource or array of parameters used to create a stream context.
$params
array
$params Optional array of parameters specific to the factory

Returns

Guzzle\Stream\StreamInterface
Returns a stream object

Throws

Guzzle\Common\Exception\RuntimeException
if the stream cannot be opened or an error occurs

Implementation of

Guzzle\Stream\StreamRequestFactoryInterface::fromRequest()
protected
# setContextValue( string $wrapper, string $name, mixed $value, boolean $overwrite = false )

Set an option on the context and the internal options array

Set an option on the context and the internal options array

Parameters

$wrapper
string
$wrapper Stream wrapper name of http
$name
string
$name Context name
$value
mixed
$value Context value
$overwrite
boolean
$overwrite Set to true to overwrite an existing value
protected
# createContext( array $params )

Create a stream context

Create a stream context

Parameters

$params
array
$params Parameter array
public array
# getLastResponseHeaders( )

Get the last response headers received by the HTTP request

Get the last response headers received by the HTTP request

Returns

array
protected
# addDefaultContextOptions( Guzzle\Http\Message\RequestInterface $request )

Adds the default context options to the stream context options

Adds the default context options to the stream context options

Parameters

$request
Guzzle\Http\Message\RequestInterface
$request Request
protected
# setUrl( Guzzle\Http\Message\RequestInterface $request )

Set the URL to use with the factory

Set the URL to use with the factory

Parameters

$request
Guzzle\Http\Message\RequestInterface
$request Request that owns the URL
protected
# addSslOptions( Guzzle\Http\Message\RequestInterface $request )

Add SSL options to the stream context

Add SSL options to the stream context

Parameters

$request
Guzzle\Http\Message\RequestInterface
$request Request
protected
# addBodyOptions( Guzzle\Http\Message\RequestInterface $request )

Add body (content) specific options to the context options

Add body (content) specific options to the context options

Parameters

$request
Guzzle\Http\Message\RequestInterface
$request
protected
# addProxyOptions( Guzzle\Http\Message\RequestInterface $request )

Add proxy parameters to the context if needed

Add proxy parameters to the context if needed

Parameters

$request
Guzzle\Http\Message\RequestInterface
$request Request
protected Guzzle\Stream\StreamInterface
# createStream( array $params )

Create the stream for the request with the context options

Create the stream for the request with the context options

Parameters

$params
array
$params Parameters of the stream

Returns

Guzzle\Stream\StreamInterface
protected resource
# createResource( callable $callback )

Create a resource and check to ensure it was created successfully

Create a resource and check to ensure it was created successfully

Parameters

$callback
callable
$callback Closure to invoke that must return a valid resource

Returns

resource

Throws

Guzzle\Common\Exception\RuntimeException
on error
Properties summary
protected resource $context
#

Stream context options

Stream context options

protected array $contextOptions
#

Stream context

Stream context

protected Guzzle\Http\Url $url
#

Stream URL

Stream URL

protected array $lastResponseHeaders
#

Last response headers received by the HTTP request

Last response headers received by the HTTP request

php-coveralls API documentation generated by ApiGen 2.8.0