Properties

$io

$io : 

Type

$config

$config : 

Type

$scheme

$scheme : 

Type

$bytesMax

$bytesMax : 

Type

$originUrl

$originUrl : 

Type

$fileUrl

$fileUrl : 

Type

$fileName

$fileName : 

Type

$retry

$retry : 

Type

$progress

$progress : 

Type

$lastProgress

$lastProgress : 

Type

$options

$options : 

Type

$peerCertificateMap

$peerCertificateMap : 

Type

$disableTls

$disableTls : 

Type

$retryAuthFailure

$retryAuthFailure : 

Type

$lastHeaders

$lastHeaders : 

Type

$storeAuth

$storeAuth : 

Type

$degradedMode

$degradedMode : 

Type

$redirects

$redirects : 

Type

$maxRedirects

$maxRedirects : 

Type

Methods

__construct()

__construct(\Composer\IO\IOInterface  $io, \Composer\Config  $config = null, array  $options = array(), boolean  $disableTls = false) 

Constructor.

Parameters

\Composer\IO\IOInterface $io

The IO instance

\Composer\Config $config

The config

array $options

The options

boolean $disableTls

copy()

copy(string  $originUrl, string  $fileUrl, string  $fileName, boolean  $progress = true, array  $options = array()) : boolean

Copy the remote file in local.

Parameters

string $originUrl

The origin URL

string $fileUrl

The file URL

string $fileName

the local filename

boolean $progress

Display the progression

array $options

Additional context options

Returns

boolean —

true

getContents()

getContents(string  $originUrl, string  $fileUrl, boolean  $progress = true, array  $options = array()) : boolean|string

Get the content.

Parameters

string $originUrl

The origin URL

string $fileUrl

The file URL

boolean $progress

Display the progression

array $options

Additional context options

Returns

boolean|string —

The content

getOptions()

getOptions() : array

Retrieve the options set in the constructor

Returns

array —

Options

setOptions()

setOptions(array  $options) : array

Merges new options

Parameters

array $options

Returns

array —

$options

isTlsDisabled()

isTlsDisabled() 

getLastHeaders()

getLastHeaders() : array

Returns the headers of the last request

Returns

array

findHeaderValue()

findHeaderValue(array  $headers, string  $name) : string|null

Parameters

array $headers

array of returned headers like from getLastHeaders()

string $name

header name (case insensitive)

Returns

string|null

findStatusCode()

findStatusCode(array  $headers) : integer|null

Parameters

array $headers

array of returned headers like from getLastHeaders()

Returns

integer|null

findStatusMessage()

findStatusMessage(array  $headers) : string|null

Parameters

array $headers

array of returned headers like from getLastHeaders()

Returns

string|null

get()

get(string  $originUrl, string  $fileUrl, array  $additionalOptions = array(), string  $fileName = null, boolean  $progress = true) : boolean|string

Get file content or copy action.

Parameters

string $originUrl

The origin URL

string $fileUrl

The file URL

array $additionalOptions

context options

string $fileName

the local filename

boolean $progress

Display the progression

Throws

\Composer\Downloader\TransportException|\Exception
\Composer\Downloader\TransportException

When the file could not be downloaded

Returns

boolean|string

getRemoteContents()

getRemoteContents(string  $originUrl, string  $fileUrl, resource  $context, array  $responseHeaders = null) : string|false

Get contents of remote URL.

Parameters

string $originUrl

The origin URL

string $fileUrl

The file URL

resource $context

The stream context

array $responseHeaders

Returns

string|false —

The response contents or false on failure

callbackGet()

callbackGet(integer  $notificationCode, integer  $severity, string  $message, integer  $messageCode, integer  $bytesTransferred, integer  $bytesMax) 

Get notification action.

Parameters

integer $notificationCode

The notification code

integer $severity

The severity level

string $message

The message

integer $messageCode

The message code

integer $bytesTransferred

The loaded size

integer $bytesMax

The total size

Throws

\Composer\Downloader\TransportException

promptAuthAndRetry()

promptAuthAndRetry(  $httpStatus,   $reason = null,   $warning = null,   $headers = array()) 

Parameters

$httpStatus
$reason
$warning
$headers

getOptionsForUrl()

getOptionsForUrl(  $originUrl,   $additionalOptions) 

Parameters

$originUrl
$additionalOptions

handleRedirect()

handleRedirect(array  $http_response_header, array  $additionalOptions,   $result) 

Parameters

array $http_response_header
array $additionalOptions
$result

getTlsDefaults()

getTlsDefaults(array  $options) : array

Parameters

array $options

Returns

array

getCertificateCnAndFp()

getCertificateCnAndFp(  $url,   $options) 

Fetch certificate common name and fingerprint for validation of SAN.

Parameters

$url
$options

getUrlAuthority()

getUrlAuthority(  $url) 

Parameters

$url

isPublicBitBucketDownload()

isPublicBitBucketDownload(string  $urlToBitBucketFile) : boolean

Parameters

string $urlToBitBucketFile

URL to a file at bitbucket.org.

Returns

boolean —

Whether the given URL is a public BitBucket download which requires no authentication.