MediaWiki REL1_34
MediaWiki\Rest\SimpleHandler Class Reference
Inheritance diagram for MediaWiki\Rest\SimpleHandler:
Collaboration diagram for MediaWiki\Rest\SimpleHandler:

Public Member Functions

 execute ()
 Execute the handler.
 
- Public Member Functions inherited from MediaWiki\Rest\Handler
 getBodyValidator ( $contentType)
 Fetch the BodyValidator.
 
 getConfig ()
 Get the configuration array for the current route.
 
 getParamSettings ()
 Fetch ParamValidator settings for parameters.
 
 getRequest ()
 Get the current request.
 
 getResponseFactory ()
 Get the ResponseFactory which can be used to generate Response objects.
 
 getValidatedBody ()
 Fetch the validated body.
 
 getValidatedParams ()
 Fetch the validated parameters.
 
 init (Router $router, RequestInterface $request, array $config, ResponseFactory $responseFactory)
 Initialise with dependencies from the Router.
 
 needsReadAccess ()
 Indicates whether this route requires read rights.
 
 needsWriteAccess ()
 Indicates whether this route requires write access.
 
 validate (Validator $restValidator)
 Validate the request parameters/attributes and body.
 

Additional Inherited Members

- Public Attributes inherited from MediaWiki\Rest\Handler
const PARAM_SOURCE = 'rest-param-source'
 (string) ParamValidator constant to specify the source of the parameter.
 
- Protected Member Functions inherited from MediaWiki\Rest\Handler
 getETag ()
 The subclass should override this to provide an ETag for the current request.
 
 getLastModified ()
 The subclass should override this to provide the maximum last modified timestamp for the current request.
 
 getRouter ()
 Get the Router.
 

Detailed Description

Definition at line 15 of file SimpleHandler.php.

Member Function Documentation

◆ execute()

MediaWiki\Rest\SimpleHandler::execute ( )

Execute the handler.

This is called after parameter validation. The return value can either be a Response or any type accepted by ResponseFactory::createFromReturnValue().

To automatically construct an error response, execute() should throw a RestException. Such exceptions will not be logged like a normal exception.

If execute() throws any other kind of exception, the exception will be logged and a generic 500 error page will be shown.

Returns
mixed

Reimplemented from MediaWiki\Rest\Handler.

Definition at line 16 of file SimpleHandler.php.

References $source, MediaWiki\Rest\Handler\$validatedParams, MediaWiki\Rest\Handler\getParamSettings(), MediaWiki\Rest\Handler\getRequest(), MediaWiki\Rest\Handler\getValidatedParams(), and MediaWiki\Rest\Handler\PARAM_SOURCE.


The documentation for this class was generated from the following file: