$context
$context : resource
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.
$url : \Guzzle\Http\Url
fromRequest(\Guzzle\Http\Message\RequestInterface $request, array|resource $context = array(), array $params = array()) : \Guzzle\Stream\StreamInterface
Create a stream based on a request object
The $params array can contain the following custom keys specific to the PhpStreamRequestFactory:
\Guzzle\Http\Message\RequestInterface | $request | Base the stream on a request |
array|resource | $context | A stream_context_options resource or array of parameters used to create a stream context. |
array | $params | Optional array of parameters specific to the factory |
Returns a stream object
setContextValue(string $wrapper, string $name, mixed $value, boolean $overwrite = false)
Set an option on the context and the internal options array
string | $wrapper | Stream wrapper name of http |
string | $name | Context name |
mixed | $value | Context value |
boolean | $overwrite | Set to true to overwrite an existing value |
addDefaultContextOptions(\Guzzle\Http\Message\RequestInterface $request)
Adds the default context options to the stream context options
\Guzzle\Http\Message\RequestInterface | $request | Request |
setUrl(\Guzzle\Http\Message\RequestInterface $request)
Set the URL to use with the factory
\Guzzle\Http\Message\RequestInterface | $request | Request that owns the URL |
addSslOptions(\Guzzle\Http\Message\RequestInterface $request)
Add SSL options to the stream context
\Guzzle\Http\Message\RequestInterface | $request | Request |
addBodyOptions(\Guzzle\Http\Message\RequestInterface $request)
Add body (content) specific options to the context options
\Guzzle\Http\Message\RequestInterface | $request |
addProxyOptions(\Guzzle\Http\Message\RequestInterface $request)
Add proxy parameters to the context if needed
\Guzzle\Http\Message\RequestInterface | $request | Request |
createStream(array $params) : \Guzzle\Stream\StreamInterface
Create the stream for the request with the context options
array | $params | Parameters of the stream |
processResponseHeaders(\Guzzle\Stream\StreamInterface $stream)
Process response headers
\Guzzle\Stream\StreamInterface | $stream |