Composer API
Class

Composer\Util\RemoteFilesystem

class RemoteFilesystem

Methods

__construct(IOInterface $io, Config $config = null, array $options = array(), bool $disableTls = false)

Constructor.

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

Copy the remote file in local.

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

Get the content.

array getOptions()

Retrieve the options set in the constructor

array setOptions(array $options)

Merges new options

isTlsDisabled()

array getLastHeaders()

Returns the headers of the last request

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

int|null findStatusCode(array $headers)

Details

at line 56
public __construct(IOInterface $io, Config $config = null, array $options = array(), bool $disableTls = false)

Constructor.

Parameters

IOInterface $io The IO instance
Config $config The config
array $options The options
bool $disableTls

at line 84
public bool copy(string $originUrl, string $fileUrl, string $fileName, bool $progress = true, array $options = array())

Copy the remote file in local.

Parameters

string $originUrl The origin URL
string $fileUrl The file URL
string $fileName the local filename
bool $progress Display the progression
array $options Additional context options

Return Value

bool true

at line 99
public bool|string getContents(string $originUrl, string $fileUrl, bool $progress = true, array $options = array())

Get the content.

Parameters

string $originUrl The origin URL
string $fileUrl The file URL
bool $progress Display the progression
array $options Additional context options

Return Value

bool|string The content

at line 109
public array getOptions()

Retrieve the options set in the constructor

Return Value

array Options

at line 119
public array setOptions(array $options)

Merges new options

Parameters

array $options

Return Value

array $options

at line 124
public isTlsDisabled()

at line 134
public array getLastHeaders()

Returns the headers of the last request

Return Value

array

at line 144
public string|null findHeaderValue(array $headers, string $name)

Parameters

array $headers array of returned headers like from getLastHeaders()
string $name header name (case insensitive)

Return Value

string|null

at line 164
public int|null findStatusCode(array $headers)

Parameters

array $headers array of returned headers like from getLastHeaders()

Return Value

int|null