class file_downloader

Constants

OK

NOT_FOUND

REQUEST_TIMEOUT

Properties

protected string $error_string
protected int $error_number

Methods

Client
create_client(string $host, int $port = 443, int $timeout = 6)

Create new guzzle client

bool|string
get(string $host, string $directory, string $filename, int $port = 443, int $timeout = 6)

Retrieve contents from remotely stored file

string
get_error_string()

Get error string

int
get_error_number()

Get error number

Details

at line 41
protected Client create_client(string $host, int $port = 443, int $timeout = 6)

Create new guzzle client

Parameters

string $host
int $port
int $timeout

Return Value

Client

at line 76
bool|string get(string $host, string $directory, string $filename, int $port = 443, int $timeout = 6)

Retrieve contents from remotely stored file

Parameters

string $host

File host

string $directory

Directory file is in

string $filename

Filename of file to retrieve

int $port

Port to connect to; default: 443

int $timeout

Connection timeout in seconds; default: 6

Return Value

bool|string

File data as string if file can be read and there is no timeout, false if there were errors or the connection timed out

Exceptions

runtime_exception

at line 137
string get_error_string()

Get error string

Return Value

string

Error string

at line 147
int get_error_number()

Get error number

Return Value

int

Error number