MediaWiki master
MediaWiki\Rest\Hook\HookRunner Class Reference

Inherits MediaWiki\Rest\Hook\RestCheckCanExecuteHook.

Collaboration diagram for MediaWiki\Rest\Hook\HookRunner:

Public Member Functions

 __construct (HookContainer $container)
 
 onRestCheckCanExecute (Module $module, Handler $handler, string $path, RequestInterface $request, ?HttpException &$error)
 Called when initializing a REST API request.
 

Detailed Description

Definition at line 11 of file HookRunner.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Rest\Hook\HookRunner::__construct ( HookContainer $container)

Definition at line 15 of file HookRunner.php.

Member Function Documentation

◆ onRestCheckCanExecute()

MediaWiki\Rest\Hook\HookRunner::onRestCheckCanExecute ( Module $module,
Handler $handler,
string $path,
RequestInterface $request,
?HttpException & $error )

Called when initializing a REST API request.

Use this hook to deny requests to API endpoints belonging to a different component than the hook handler.

Parameters
Module$moduleThe module responsible for processing the request. (When the handler does not belong to a module, this will be an ExtraRoutesModule instance.)
Handler$handlerThe handler responsible for processing the request.
string$pathPath of the request. When the handler belongs to a module, doesn't include the module prefix.
RequestInterface$request
HttpException | null&$errorSet this to explain why the request cannot be executed. Should only be set when returning false.
Returns
bool Return false to block request execution. $error must be set.

Implements MediaWiki\Rest\Hook\RestCheckCanExecuteHook.

Definition at line 19 of file HookRunner.php.


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