MediaWiki REL1_34
|
This is a Request class that allows data to be injected, for the purposes of testing or internal requests. More...
Public Member Functions | |
__construct ( $params=[]) | |
Construct a RequestData from an array of parameters. | |
getBody () | |
Gets the body of the message. | |
getCookieParams () | |
Retrieve cookies. | |
getMethod () | |
Retrieves the HTTP method of the request. | |
getPostParams () | |
Retrieve POST form parameters. | |
getProtocolVersion () | |
Retrieves the HTTP protocol version as a string. | |
getQueryParams () | |
Retrieve query string arguments. | |
getServerParams () | |
Retrieve server parameters. | |
getUploadedFiles () | |
Retrieve normalized file upload data. | |
getUri () | |
Retrieves the URI instance. | |
Public Member Functions inherited from MediaWiki\Rest\RequestBase | |
__clone () | |
getCookie ( $name, $default=null) | |
Add the cookie prefix to a specified cookie name and get the value of the resulting prefixed cookie. | |
getCookiePrefix () | |
Get the current cookie prefix. | |
getHeader ( $name) | |
Retrieves a message header value by the given case-insensitive name. | |
getHeaderLine ( $name) | |
Retrieves a comma-separated string of the values for a single header. | |
getHeaders () | |
Retrieves all message header values. | |
getPathParam ( $name) | |
Retrieve a single path parameter. | |
getPathParams () | |
Get the parameters derived from the path template match. | |
hasHeader ( $name) | |
Checks if a header exists by the given case-insensitive name. | |
setPathParams ( $params) | |
Erase all path parameters from the object and set the parameter array to the one specified. | |
Private Attributes | |
StreamInterface | $body |
$cookieParams | |
$method | |
$postParams | |
$protocolVersion | |
$queryParams | |
$serverParams | |
UploadedFileInterface[] | $uploadedFiles |
UriInterface | $uri |
Additional Inherited Members | |
Protected Member Functions inherited from MediaWiki\Rest\RequestBase | |
initHeaders () | |
Override this in the implementation class if lazy initialisation of header values is desired. | |
setHeaders ( $headers) | |
Erase any existing headers and replace them with the specified header lines. | |
This is a Request class that allows data to be injected, for the purposes of testing or internal requests.
Definition at line 14 of file RequestData.php.
MediaWiki\Rest\RequestData::__construct | ( | $params = [] | ) |
Construct a RequestData from an array of parameters.
array | $params | An associative array of parameters. All parameters have defaults. Parameters are:
|
Reimplemented from MediaWiki\Rest\RequestBase.
Definition at line 54 of file RequestData.php.
References MediaWiki\Rest\RequestBase\setHeaders(), and MediaWiki\Rest\RequestBase\setPathParams().
MediaWiki\Rest\RequestData::getBody | ( | ) |
Gets the body of the message.
Implements MediaWiki\Rest\RequestInterface.
Definition at line 81 of file RequestData.php.
References MediaWiki\Rest\RequestData\$body.
MediaWiki\Rest\RequestData::getCookieParams | ( | ) |
Retrieve cookies.
Retrieves cookies sent by the client to the server.
The data MUST be compatible with the structure of the $_COOKIE superglobal.
Implements MediaWiki\Rest\RequestInterface.
Definition at line 89 of file RequestData.php.
References MediaWiki\Rest\RequestData\$cookieParams.
MediaWiki\Rest\RequestData::getMethod | ( | ) |
Retrieves the HTTP method of the request.
Implements MediaWiki\Rest\RequestInterface.
Definition at line 69 of file RequestData.php.
References MediaWiki\Rest\RequestData\$method.
MediaWiki\Rest\RequestData::getPostParams | ( | ) |
Retrieve POST form parameters.
This will return an array of parameters in the format of $_POST.
Implements MediaWiki\Rest\RequestInterface.
Definition at line 101 of file RequestData.php.
References MediaWiki\Rest\RequestData\$postParams.
MediaWiki\Rest\RequestData::getProtocolVersion | ( | ) |
Retrieves the HTTP protocol version as a string.
The string MUST contain only the HTTP version number (e.g., "1.1", "1.0").
Implements MediaWiki\Rest\RequestInterface.
Definition at line 77 of file RequestData.php.
References MediaWiki\Rest\RequestData\$protocolVersion.
MediaWiki\Rest\RequestData::getQueryParams | ( | ) |
Retrieve query string arguments.
Retrieves the deserialized query string arguments, if any.
Note: the query params might not be in sync with the URI or server params. If you need to ensure you are only getting the original values, you may need to parse the query string from getUri()->getQuery()
or from the QUERY_STRING
server param.
Implements MediaWiki\Rest\RequestInterface.
Definition at line 93 of file RequestData.php.
References MediaWiki\Rest\RequestData\$queryParams.
MediaWiki\Rest\RequestData::getServerParams | ( | ) |
Retrieve server parameters.
Retrieves data related to the incoming request environment, typically derived from PHP's $_SERVER superglobal. The data IS NOT REQUIRED to originate from $_SERVER.
Implements MediaWiki\Rest\RequestInterface.
Definition at line 85 of file RequestData.php.
References MediaWiki\Rest\RequestData\$serverParams.
MediaWiki\Rest\RequestData::getUploadedFiles | ( | ) |
Retrieve normalized file upload data.
This method returns upload metadata in a normalized tree, with each leaf an instance of Psr\Http\Message\UploadedFileInterface.
Implements MediaWiki\Rest\RequestInterface.
Definition at line 97 of file RequestData.php.
References MediaWiki\Rest\RequestData\$uploadedFiles.
MediaWiki\Rest\RequestData::getUri | ( | ) |
Retrieves the URI instance.
This method MUST return a UriInterface instance.
UriInterface Returns a UriInterface instance representing the URI of the request.
Implements MediaWiki\Rest\RequestInterface.
Definition at line 73 of file RequestData.php.
References MediaWiki\Rest\RequestData\$uri.
|
private |
Definition at line 23 of file RequestData.php.
Referenced by MediaWiki\Rest\RequestData\getBody().
|
private |
Definition at line 27 of file RequestData.php.
Referenced by MediaWiki\Rest\RequestData\getCookieParams().
|
private |
Definition at line 15 of file RequestData.php.
Referenced by MediaWiki\Rest\RequestData\getMethod().
|
private |
Definition at line 34 of file RequestData.php.
Referenced by MediaWiki\Rest\RequestData\getPostParams().
|
private |
Definition at line 20 of file RequestData.php.
Referenced by MediaWiki\Rest\RequestData\getProtocolVersion().
|
private |
Definition at line 29 of file RequestData.php.
Referenced by MediaWiki\Rest\RequestData\getQueryParams().
|
private |
Definition at line 25 of file RequestData.php.
Referenced by MediaWiki\Rest\RequestData\getServerParams().
|
private |
Definition at line 32 of file RequestData.php.
Referenced by MediaWiki\Rest\RequestData\getUploadedFiles().
|
private |
Definition at line 18 of file RequestData.php.
Referenced by MediaWiki\Rest\RequestData\getUri().