MediaWiki REL1_37
|
Public Member Functions | |
parseAccept ( $accept) | |
Parse media types from an Accept header and sort them by q-factor. | |
parseWeights ( $rawHeader) | |
Parses an HTTP header into a weight map, that is an associative array mapping values to their respective weights. | |
Definition at line 13 of file HttpAcceptParser.php.
Wikimedia\Http\HttpAcceptParser::parseAccept | ( | $accept | ) |
Parse media types from an Accept header and sort them by q-factor.
Note that his was mostly ported from, https://github.com/arlolra/negotiator/blob/full-parse-access/lib/mediaType.js
string | $accept |
Definition at line 29 of file HttpAcceptParser.php.
References $matches.
Wikimedia\Http\HttpAcceptParser::parseWeights | ( | $rawHeader | ) |
Parses an HTTP header into a weight map, that is an associative array mapping values to their respective weights.
Any header name preceding weight spec is ignored for convenience.
Note that type parameters and accept extension like the "level" parameter are not supported, weights are derived from "q" values only.
See RFC 7231 section 5.3.2 for details.
string | $rawHeader |
Definition at line 93 of file HttpAcceptParser.php.
References $type.