Open Journal Systems  3.3.0
Guzzle\Stream\PhpStreamRequestFactory Class Reference
Inheritance diagram for Guzzle\Stream\PhpStreamRequestFactory:
Guzzle\Stream\StreamRequestFactoryInterface

Public Member Functions

 fromRequest (RequestInterface $request, $context=array(), array $params=array())
 
 getLastResponseHeaders ()
 

Protected Member Functions

 addBodyOptions (RequestInterface $request)
 
 addDefaultContextOptions (RequestInterface $request)
 
 addProxyOptions (RequestInterface $request)
 
 addSslOptions (RequestInterface $request)
 
 createContext (array $params)
 
 createResource ($callback)
 
 createStream (array $params)
 
 processResponseHeaders (StreamInterface $stream)
 
 setContextValue ($wrapper, $name, $value, $overwrite=false)
 
 setUrl (RequestInterface $request)
 

Protected Attributes

 $context
 
 $contextOptions
 
 $lastResponseHeaders
 
 $url
 

Detailed Description

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.

Definition at line 16 of file PhpStreamRequestFactory.php.

Member Function Documentation

◆ addBodyOptions()

Guzzle\Stream\PhpStreamRequestFactory::addBodyOptions ( RequestInterface  $request)
protected

Add body (content) specific options to the context options

Parameters
RequestInterface$request

Definition at line 183 of file PhpStreamRequestFactory.php.

References Guzzle\Stream\PhpStreamRequestFactory\setContextValue().

Referenced by Guzzle\Stream\PhpStreamRequestFactory\fromRequest().

◆ addDefaultContextOptions()

Guzzle\Stream\PhpStreamRequestFactory::addDefaultContextOptions ( RequestInterface  $request)
protected

◆ addProxyOptions()

Guzzle\Stream\PhpStreamRequestFactory::addProxyOptions ( RequestInterface  $request)
protected

Add proxy parameters to the context if needed

Parameters
RequestInterface$requestRequest

Definition at line 209 of file PhpStreamRequestFactory.php.

References Guzzle\Http\Message\RequestInterface\getCurlOptions(), and Guzzle\Stream\PhpStreamRequestFactory\setContextValue().

Referenced by Guzzle\Stream\PhpStreamRequestFactory\fromRequest().

◆ addSslOptions()

Guzzle\Stream\PhpStreamRequestFactory::addSslOptions ( RequestInterface  $request)
protected

Add SSL options to the stream context

Parameters
RequestInterface$requestRequest

Definition at line 166 of file PhpStreamRequestFactory.php.

References Guzzle\Http\Message\RequestInterface\getCurlOptions(), and Guzzle\Stream\PhpStreamRequestFactory\setContextValue().

Referenced by Guzzle\Stream\PhpStreamRequestFactory\fromRequest().

◆ createContext()

Guzzle\Stream\PhpStreamRequestFactory::createContext ( array  $params)
protected

Create a stream context

Parameters
array$paramsParameter array

Definition at line 103 of file PhpStreamRequestFactory.php.

References Guzzle\Stream\PhpStreamRequestFactory\$contextOptions, and Guzzle\Stream\PhpStreamRequestFactory\createResource().

Referenced by Guzzle\Stream\PhpStreamRequestFactory\fromRequest().

◆ createResource()

Guzzle\Stream\PhpStreamRequestFactory::createResource (   $callback)
protected

Create a resource and check to ensure it was created successfully

Parameters
callable$callbackClosure to invoke that must return a valid resource
Returns
resource
Exceptions
RuntimeExceptionon error

Definition at line 270 of file PhpStreamRequestFactory.php.

Referenced by Guzzle\Stream\PhpStreamRequestFactory\createContext(), and Guzzle\Stream\PhpStreamRequestFactory\createStream().

◆ createStream()

Guzzle\Stream\PhpStreamRequestFactory::createStream ( array  $params)
protected

◆ fromRequest()

Guzzle\Stream\PhpStreamRequestFactory::fromRequest ( RequestInterface  $request,
  $context = array(),
array  $params = array() 
)

{Create a stream based on a request object

Parameters
RequestInterface$requestBase the stream on a request
array | resource$contextA stream_context_options resource or array of parameters used to create a stream context.
array$paramsOptional array of parameters specific to the factory
Returns
StreamInterface Returns a stream object
Exceptions
}

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

Implements Guzzle\Stream\StreamRequestFactoryInterface.

Definition at line 48 of file PhpStreamRequestFactory.php.

References Guzzle\Stream\PhpStreamRequestFactory\$context, Guzzle\Stream\PhpStreamRequestFactory\addBodyOptions(), Guzzle\Stream\PhpStreamRequestFactory\addDefaultContextOptions(), Guzzle\Stream\PhpStreamRequestFactory\addProxyOptions(), Guzzle\Stream\PhpStreamRequestFactory\addSslOptions(), Guzzle\Stream\PhpStreamRequestFactory\createContext(), Guzzle\Stream\PhpStreamRequestFactory\createStream(), Guzzle\Common\HasDispatcherInterface\dispatch(), Guzzle\Stream\PhpStreamRequestFactory\getLastResponseHeaders(), and Guzzle\Stream\PhpStreamRequestFactory\setUrl().

◆ getLastResponseHeaders()

Guzzle\Stream\PhpStreamRequestFactory::getLastResponseHeaders ( )

Get the last response headers received by the HTTP request

Returns
array

Definition at line 116 of file PhpStreamRequestFactory.php.

References Guzzle\Stream\PhpStreamRequestFactory\$lastResponseHeaders.

Referenced by Guzzle\Stream\PhpStreamRequestFactory\fromRequest().

◆ processResponseHeaders()

Guzzle\Stream\PhpStreamRequestFactory::processResponseHeaders ( StreamInterface  $stream)
protected

Process response headers

Parameters
StreamInterface$stream

Definition at line 252 of file PhpStreamRequestFactory.php.

Referenced by Guzzle\Stream\PhpStreamRequestFactory\createStream().

◆ setContextValue()

Guzzle\Stream\PhpStreamRequestFactory::setContextValue (   $wrapper,
  $name,
  $value,
  $overwrite = false 
)
protected

Set an option on the context and the internal options array

Parameters
string$wrapperStream wrapper name of http
string$nameContext name
mixed$valueContext value
bool$overwriteSet to true to overwrite an existing value

Definition at line 87 of file PhpStreamRequestFactory.php.

Referenced by Guzzle\Stream\PhpStreamRequestFactory\addBodyOptions(), Guzzle\Stream\PhpStreamRequestFactory\addDefaultContextOptions(), Guzzle\Stream\PhpStreamRequestFactory\addProxyOptions(), and Guzzle\Stream\PhpStreamRequestFactory\addSslOptions().

◆ setUrl()

Guzzle\Stream\PhpStreamRequestFactory::setUrl ( RequestInterface  $request)
protected

Set the URL to use with the factory

Parameters
RequestInterface$requestRequest that owns the URL

Definition at line 146 of file PhpStreamRequestFactory.php.

References Guzzle\Http\Message\RequestInterface\getPassword(), Guzzle\Http\Message\RequestInterface\getUrl(), and Guzzle\Http\Message\RequestInterface\getUsername().

Referenced by Guzzle\Stream\PhpStreamRequestFactory\fromRequest().

Field Documentation

◆ $context

resource Guzzle\Stream\PhpStreamRequestFactory::$context
protected

◆ $contextOptions

array Guzzle\Stream\PhpStreamRequestFactory::$contextOptions
protected

◆ $lastResponseHeaders

array Guzzle\Stream\PhpStreamRequestFactory::$lastResponseHeaders
protected

Last response headers received by the HTTP request

Definition at line 40 of file PhpStreamRequestFactory.php.

Referenced by Guzzle\Stream\PhpStreamRequestFactory\getLastResponseHeaders().

◆ $url

Url Guzzle\Stream\PhpStreamRequestFactory::$url
protected

The documentation for this class was generated from the following file: