MediaWiki  1.34.0
MediaWiki\Rest\Handler\HelloHandler Class Reference

Example handler @unstable. More...

Inheritance diagram for MediaWiki\Rest\Handler\HelloHandler:
Collaboration diagram for MediaWiki\Rest\Handler\HelloHandler:

Public Member Functions

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

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. More...
 
- Protected Member Functions inherited from MediaWiki\Rest\Handler
 getETag ()
 The subclass should override this to provide an ETag for the current request. More...
 
 getLastModified ()
 The subclass should override this to provide the maximum last modified timestamp for the current request. More...
 
 getRouter ()
 Get the Router. More...
 

Detailed Description

Example handler @unstable.

Definition at line 12 of file HelloHandler.php.

Member Function Documentation

◆ getParamSettings()

MediaWiki\Rest\Handler\HelloHandler::getParamSettings ( )

Fetch ParamValidator settings for parameters.

Every setting must include self::PARAM_SOURCE to specify which part of the request is to contain the parameter.

Returns
array[] Associative array mapping parameter names to ParamValidator settings arrays

Reimplemented from MediaWiki\Rest\Handler.

Definition at line 21 of file HelloHandler.php.

◆ needsWriteAccess()

MediaWiki\Rest\Handler\HelloHandler::needsWriteAccess ( )

Indicates whether this route requires write access.

The handler should override this if the route does not need to write to the database.

This should return true for routes that may require synchronous database writes. Modules that do not need such writes should also not rely on master database access, since only read queries are needed and each master DB is a single point of failure.

Returns
bool

Reimplemented from MediaWiki\Rest\Handler.

Definition at line 17 of file HelloHandler.php.

◆ run()

MediaWiki\Rest\Handler\HelloHandler::run (   $name)

Definition at line 13 of file HelloHandler.php.


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