class ExternalURLCheck implements EnvironmentCheck (View source)

Checks that one or more URLs are reachable via HTTP.

Note that the HTTP connectivity can just be verified from the server to the remote URL, it can still fail if the URL in question is requested by the client, e.g. through an iframe.

Requires curl to present, so ensure to check it before with the following:

EnvironmentCheckSuite::register(
    'check',
    'HasFunctionCheck("curl_init")',
    "Does PHP have CURL support?"
);

Properties

protected array $urls
protected int $timeout

Methods

public
__construct(string $urls, int $timeout = 15)

No description

public
array
check()

No description

protected
array
getCurlOpts($url)

No description

protected
array
getURLs()

No description

Details

__construct(string $urls, int $timeout = 15)

No description

Parameters

string $urls

Space-separated list of absolute URLs.

int $timeout

array check()

No description

Return Value

array

Result with 'status' and 'message' keys.

Status is EnvironmentCheck::ERROR, EnvironmentCheck::WARNING, or EnvironmentCheck::OK.

protected array getCurlOpts($url)

No description

Parameters

$url

Return Value

array

protected array getURLs()

No description

Return Value

array