MediaWiki REL1_39
|
A class to assist with the parsing of If-None-Match, If-Match and ETag headers. More...
Public Member Functions | |
getLastError () | |
Get the last parse error message, or null if there was none. | |
parseETag ( $eTag) | |
Parse an entity-tag such as might be found in an ETag response header. | |
parseHeaderList ( $headerList) | |
Parse an If-None-Match or If-Match header list as returned by RequestInterface::getHeader(). | |
Additional Inherited Members | |
Protected Member Functions inherited from MediaWiki\Rest\HeaderParser\HeaderParserBase | |
assertEnd () | |
If the position is not at the end of the input string, raise an error, complaining of trailing characters. | |
consumeFixedDigits ( $numDigits) | |
Consume a specified number of digits, or throw an exception. | |
consumeString ( $s) | |
Consume a specified string, or throw an exception. | |
error ( $message) | |
Throw an exception to indicate a parse error. | |
setInput ( $input) | |
Set the input, and derived convenience properties. | |
skipWhitespace () | |
Skip whitespace at the input position (OWS) | |
Protected Attributes inherited from MediaWiki\Rest\HeaderParser\HeaderParserBase | |
string | $input |
The input string being processed. | |
int | $inputLength |
The length of $input. | |
int | $pos |
The position within $input. | |
A class to assist with the parsing of If-None-Match, If-Match and ETag headers.
Definition at line 8 of file IfNoneMatch.php.
MediaWiki\Rest\HeaderParser\IfNoneMatch::getLastError | ( | ) |
Get the last parse error message, or null if there was none.
Definition at line 88 of file IfNoneMatch.php.
MediaWiki\Rest\HeaderParser\IfNoneMatch::parseETag | ( | $eTag | ) |
Parse an entity-tag such as might be found in an ETag response header.
The result is an associative array in the same format returned by parseHeaderList().
If parsing failed, null is returned.
string | $eTag |
Definition at line 68 of file IfNoneMatch.php.
References MediaWiki\Rest\HeaderParser\HeaderParserBase\assertEnd(), and MediaWiki\Rest\HeaderParser\HeaderParserBase\setInput().
Referenced by MediaWiki\Rest\ConditionalHeaderUtil\checkPreconditions().
MediaWiki\Rest\HeaderParser\IfNoneMatch::parseHeaderList | ( | $headerList | ) |
Parse an If-None-Match or If-Match header list as returned by RequestInterface::getHeader().
The return value is an array of tag info arrays. Each tag info array is an associative array with the following keys:
In the case of a wildcard header like "If-Match: *", there cannot be any other tags. The return value is an array with a single tag info array with 'whole' => '*'.
If the header was invalid, an empty array will be returned. Further information about why the parsing failed can be found by calling getLastError().
string[] | $headerList |
Definition at line 37 of file IfNoneMatch.php.
References $header.