51Degrees Pipeline for PHP

fiftyone\pipeline\core\CallbackUrl Class Reference

Detailed Description

The callback URL the client script posts to for updated JSON.

The protocol and host usually come from the request, and the script holds the URL in a single-quoted string, so the URL is checked before it is written into the script. A URL that is not valid, including one whose protocol is not http or https, is refused. In anything after the authority, and in the endpoint, the bytes a URL cannot hold or that could end the string or the script are percent-encoded.

See also
https://github.com/51Degrees/specifications/blob/main/pipeline-specification/pipeline-elements/javascript-builder.md#callback-url

Static Public Member Functions

static of ($protocol, $host, $endpoint)
 Builds the callback URL from its parts and checks it.
static isScheme ($protocol)
 Whether the protocol is http or https, ignoring the case of its ASCII letters only, so that no letter outside ASCII can stand in for an ASCII one.

Data Fields

bool $valid
 Whether the URL can be written into the script.
string $url
 The URL to write into the script when it is valid, and otherwise the URL as it was built, for the log.

Member Function Documentation

◆ isScheme()

fiftyone\pipeline\core\CallbackUrl::isScheme ( $protocol)
static

Whether the protocol is http or https, ignoring the case of its ASCII letters only, so that no letter outside ASCII can stand in for an ASCII one.

Parameters
mixed$protocol

◆ of()

fiftyone\pipeline\core\CallbackUrl::of ( $protocol,
$host,
$endpoint )
static

Builds the callback URL from its parts and checks it.

One slash separates the host and the endpoint, being added when neither has one and removed when both do. The protocol and the host are written in lower case and the rest as given, apart from the percent-encoding. The host value holds no '?', '#' or '@'.

Parameters
mixed$protocolThe protocol, http or https in any case
mixed$hostThe host, which can end with a port and a path
mixed$endpointThe endpoint
Returns
null|self The callback URL, or null when the protocol, host or endpoint is not set. The URL of an invalid one is as it was built, for the log, with '***' in place of everything in the host before its last '@'.