class Factory (View source)

Properties

protected Application $app

Methods

__construct(Application $app)

No description

array
getOptions(Repository $config)

Read the HTTP Client configuration.

array
normalizeOptions(array $options)

Normalize the Zend HTTP Client options.

createFromConfig(Repository $config, string|object|null $adapter = null)

Create a new HTTP Client instance starting from configuration.

createFromOptions(array $options, mixed $adapter = null)

Create a new HTTP Client instance starting from configuration.

Details

__construct(Application $app)

No description

Parameters

Application $app

protected array getOptions(Repository $config)

Read the HTTP Client configuration.

Parameters

Repository $config

Return Value

array

{ @var bool $sslverifypeer [always] @var string $proxyhost [optional] @var int $proxyport [optional] @var string $proxyuser [optional] @var string $proxypass [optional] ... and all other options set in app.curl }

protected array normalizeOptions(array $options)

Normalize the Zend HTTP Client options.

Parameters

array $options

Return Value

array

Client createFromConfig(Repository $config, string|object|null $adapter = null)

Create a new HTTP Client instance starting from configuration.

Parameters

Repository $config
string|object|null $adapter

Return Value

Client

Client createFromOptions(array $options, mixed $adapter = null)

Create a new HTTP Client instance starting from configuration.

Parameters

array $options

See the app.http_client values at concrete/config/app.php, plus the concrete.proxy values at concrete/config/concrete.php.

mixed $adapter

The adapter to use (defaults to Curl adapter if curl extension is installed, otherwise we'll use the Socket adapter)

Return Value

Client