MediaWiki REL1_37
|
Public Member Functions | |
applyResponseHeaders (ResponseInterface $response) | |
Set Last-Modified and ETag headers in the response according to the cached values set by setValidators(), which are also used for precondition checks. | |
checkPreconditions (RequestInterface $request) | |
Check conditional request headers in the order required by RFC 7232 section 6. | |
setValidators ( $eTag, $lastModified, $hasRepresentation) | |
Initialize the object with information about the requested resource. | |
Private Member Functions | |
strongCompare ( $tag1, $tag2) | |
The strong comparison function. | |
weakCompare ( $tag1, $tag2) | |
The weak comparison function. | |
Private Attributes | |
$eTag | |
$hasRepresentation | |
$lastModified | |
$validatorsHaveBeenSet = false | |
Definition at line 9 of file ConditionalHeaderUtil.php.
MediaWiki\Rest\ConditionalHeaderUtil::applyResponseHeaders | ( | ResponseInterface | $response | ) |
Set Last-Modified and ETag headers in the response according to the cached values set by setValidators(), which are also used for precondition checks.
If the headers are already present in the response, the existing headers take precedence.
ResponseInterface | $response |
Definition at line 123 of file ConditionalHeaderUtil.php.
References MediaWiki\Rest\HeaderParser\HttpDate\format(), MediaWiki\Rest\ResponseInterface\hasHeader(), and MediaWiki\Rest\ResponseInterface\setHeader().
MediaWiki\Rest\ConditionalHeaderUtil::checkPreconditions | ( | RequestInterface | $request | ) |
Check conditional request headers in the order required by RFC 7232 section 6.
RequestInterface | $request |
Definition at line 50 of file ConditionalHeaderUtil.php.
References MediaWiki\Rest\RequestInterface\getHeader(), MediaWiki\Rest\RequestInterface\getMethod(), MediaWiki\Rest\RequestInterface\hasHeader(), MediaWiki\Rest\HeaderParser\HttpDate\parse(), MediaWiki\Rest\HeaderParser\IfNoneMatch\parseETag(), MediaWiki\Rest\ConditionalHeaderUtil\strongCompare(), and MediaWiki\Rest\ConditionalHeaderUtil\weakCompare().
MediaWiki\Rest\ConditionalHeaderUtil::setValidators | ( | $eTag, | |
$lastModified, | |||
$hasRepresentation | |||
) |
Initialize the object with information about the requested resource.
string | null | $eTag | The entity-tag (including quotes), or null if it is unknown. |
string | int | null | $lastModified | The Last-Modified date in a format accepted by ConvertibleTimestamp, or null if it is unknown. |
bool | null | $hasRepresentation | Whether the server has a current representation of the target resource. This should be true if the resource exists, and false if it does not exist. It is used for wildcard validators – the intended use case is to abort a PUT if the resource does (or does not) exist. If null is passed, we assume that the resource exists if an ETag was specified for it. |
Definition at line 29 of file ConditionalHeaderUtil.php.
References MediaWiki\Rest\ConditionalHeaderUtil\$eTag, MediaWiki\Rest\ConditionalHeaderUtil\$hasRepresentation, and MediaWiki\Rest\ConditionalHeaderUtil\$lastModified.
Referenced by MediaWiki\Rest\Handler\getConditionalHeaderUtil().
|
private |
The strong comparison function.
array | null | $tag1 | Parsed tag info array |
array | null | $tag2 | Parsed tag info array |
Definition at line 150 of file ConditionalHeaderUtil.php.
Referenced by MediaWiki\Rest\ConditionalHeaderUtil\checkPreconditions().
|
private |
The weak comparison function.
array | $tag1 | Parsed tag info array |
array | $tag2 | Parsed tag info array |
Definition at line 139 of file ConditionalHeaderUtil.php.
Referenced by MediaWiki\Rest\ConditionalHeaderUtil\checkPreconditions().
|
private |
Definition at line 11 of file ConditionalHeaderUtil.php.
Referenced by MediaWiki\Rest\ConditionalHeaderUtil\setValidators().
|
private |
Definition at line 13 of file ConditionalHeaderUtil.php.
Referenced by MediaWiki\Rest\ConditionalHeaderUtil\setValidators().
|
private |
Definition at line 12 of file ConditionalHeaderUtil.php.
Referenced by MediaWiki\Rest\ConditionalHeaderUtil\setValidators().
|
private |
Definition at line 10 of file ConditionalHeaderUtil.php.