\Composer\UtilStreamContextFactory

Allows the creation of a basic context supporting http proxy

Summary

Methods
Properties
Constants
getContext()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
fixHttpHeaderField()
No private properties found
N/A

Methods

getContext()

getContext(string  $url, array  $defaultOptions = array(), array  $defaultParams = array()) : resource

Creates a context supporting HTTP proxies

Parameters

string $url

URL the context is to be used for

array $defaultOptions

Options to merge with the default

array $defaultParams

Parameters to specify on the context

Throws

\RuntimeException

if https proxy required and OpenSSL uninstalled

Returns

resource —

Default context

fixHttpHeaderField()

fixHttpHeaderField(  $header) : array

A bug in PHP prevents the headers from correctly being sent when a content-type header is present and NOT at the end of the array

This method fixes the array by moving the content-type header to the end

Parameters

$header

Returns

array