51Degrees Pipeline for PHP

fiftyone\pipeline\core\Utils Class Reference

Static Public Member Functions

static javascriptResponse (FlowData $flowData, ?array $server=null, int $maxAgeSeconds=self::CLIENT_SIDE_MAX_AGE_SECONDS)
 Answer a request for the client-side JavaScript with the JavaScript the Pipeline's JavaScript Builder Element writes, and the cache headers of the web integration specification.
static jsonResponse (FlowData $flowData, ?array $server=null, int $maxAgeSeconds=self::CLIENT_SIDE_MAX_AGE_SECONDS)
 Answer a request from the client-side JavaScript with the JSON the Pipeline's JSON Builder Element writes, in the same way as javascriptResponse().
static setResponseHeader (FlowData $flowData)
 Set response headers in the response object (e.g.

Data Fields

const CLIENT_SIDE_MAX_AGE_SECONDS = 1800
 How long a browser may keep a client-side response, unless the caller gives another time.

Member Function Documentation

◆ javascriptResponse()

fiftyone\pipeline\core\Utils::javascriptResponse ( FlowData $flowData,
?array $server = null,
int $maxAgeSeconds = self::CLIENT_SIDE_MAX_AGE_SECONDS )
static

Answer a request for the client-side JavaScript with the JavaScript the Pipeline's JavaScript Builder Element writes, and the cache headers of the web integration specification.

The FlowData holds the request's Evidence and has not been processed, because the ETag is a hash of the Evidence the request supplied, and processing adds Evidence, such as the session id the Sequence Element gives a request without one. The ETag is weak, W/"...", because the response can change while the Evidence does not, for example when the data file is updated.

A request whose If-None-Match header matches the ETag, by the weak comparison of RFC 9110 section 13.1.2, is not processed. It gets a 304 when it is a GET or HEAD and a 412 otherwise. An If-None-Match that is neither "*" nor a list of entity tags matches nothing. Any other request is processed and gets a 200 with Cache-Control 'max-age=1800, private', or the max age given, and the ETag, or 'private, no-cache' and no ETag when processing recorded errors.

Parameters
\fiftyone\pipeline\core\FlowData$flowDataThe request's FlowData, with its Evidence set and not yet processed
null|array<string,mixed>$server The request's server values, $_SERVER when not given
int$maxAgeSecondsHow long a browser may keep the response
Exceptions

LogicException When the FlowData has been processed

◆ jsonResponse()

fiftyone\pipeline\core\Utils::jsonResponse ( FlowData $flowData,
?array $server = null,
int $maxAgeSeconds = self::CLIENT_SIDE_MAX_AGE_SECONDS )
static

Answer a request from the client-side JavaScript with the JSON the Pipeline's JSON Builder Element writes, in the same way as javascriptResponse().

Parameters
\fiftyone\pipeline\core\FlowData$flowDataThe request's FlowData, with its Evidence set and not yet processed
null|array<string,mixed>$server The request's server values, $_SERVER when not given
int$maxAgeSecondsHow long a browser may keep the response
Exceptions

LogicException When the FlowData has been processed

◆ setResponseHeader()

fiftyone\pipeline\core\Utils::setResponseHeader ( FlowData $flowData)
static

Set response headers in the response object (e.g.

Accept-CH).

Parameters
\fiftyone\pipeline\core\FlowData$flowDataA processed FlowData instance to get the response header values from