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 is refused. In the user information, in anything after the host and port, 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.

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

◆ 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.

Parameters
mixed$protocolThe protocol, such as https
mixed$hostThe host, which can start with user information and end with a port, a path, a query or a fragment
mixed$endpointThe endpoint
Returns
null|self The callback URL, or null when the protocol, host or endpoint is not set