MediaWiki master
|
The REST router is responsible for gathering module configuration, matching an input path against the defined modules, and constructing and executing the relevant module for a request. More...
Public Member Functions | |
__construct (array $routeFiles, array $extraRoutes, ServiceOptions $options, BagOStuff $cacheBag, ResponseFactory $responseFactory, BasicAuthorizerInterface $basicAuth, Authority $authority, ObjectFactory $objectFactory, Validator $restValidator, ErrorReporter $errorReporter, HookContainer $hookContainer, Session $session) | |
execute (RequestInterface $request) | |
getModule (string $name) | |
getModuleForPath (string $fullPath) | |
getModuleIds () | |
getPrivateRouteUrl (string $routeWithModulePrefix, array $pathParams=[], array $queryParams=[]) | |
getRestbaseCompatErrorData (RequestInterface $request, LocalizedHttpException $e) | |
getRoutePath (string $routeWithModulePrefix, array $pathParams=[], array $queryParams=[]) | |
getRouteUrl (string $routeWithModulePrefix, array $pathParams=[], array $queryParams=[]) | |
isRestbaseCompatEnabled (RequestInterface $request) | |
prepareHandler (Handler $handler) | |
Prepare the handler by injecting relevant service objects and state into $handler. | |
setCors (CorsUtils $cors) | |
setStats (StatsFactory $stats) | |
Public Attributes | |
const | CONSTRUCTOR_OPTIONS |
Protected Member Functions | |
substPathParams (string $route, array $pathParams) | |
The REST router is responsible for gathering module configuration, matching an input path against the defined modules, and constructing and executing the relevant module for a request.
Definition at line 30 of file Router.php.
MediaWiki\Rest\Router::__construct | ( | array | $routeFiles, |
array | $extraRoutes, | ||
ServiceOptions | $options, | ||
BagOStuff | $cacheBag, | ||
ResponseFactory | $responseFactory, | ||
BasicAuthorizerInterface | $basicAuth, | ||
Authority | $authority, | ||
ObjectFactory | $objectFactory, | ||
Validator | $restValidator, | ||
ErrorReporter | $errorReporter, | ||
HookContainer | $hookContainer, | ||
Session | $session ) |
string[] | $routeFiles | |
array[] | $extraRoutes | |
ServiceOptions | $options | |
BagOStuff | $cacheBag | A cache in which to store the matcher trees |
ResponseFactory | $responseFactory | |
BasicAuthorizerInterface | $basicAuth | |
Authority | $authority | |
ObjectFactory | $objectFactory | |
Validator | $restValidator | |
ErrorReporter | $errorReporter | |
HookContainer | $hookContainer | |
Session | $session |
Definition at line 104 of file Router.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), MediaWiki\MainConfigNames\CanonicalServer, MediaWiki\Config\ServiceOptions\get(), MediaWiki\MainConfigNames\InternalServer, MediaWiki\MainConfigNames\RestPath, and MediaWiki\MainConfigNames\ScriptPath.
MediaWiki\Rest\Router::execute | ( | RequestInterface | $request | ) |
Definition at line 443 of file Router.php.
MediaWiki\Rest\Router::getModule | ( | string | $name | ) |
Definition at line 360 of file Router.php.
MediaWiki\Rest\Router::getModuleForPath | ( | string | $fullPath | ) |
Definition at line 355 of file Router.php.
MediaWiki\Rest\Router::getModuleIds | ( | ) |
Definition at line 351 of file Router.php.
MediaWiki\Rest\Router::getPrivateRouteUrl | ( | string | $routeWithModulePrefix, |
array | $pathParams = [], | ||
array | $queryParams = [] ) |
Definition at line 419 of file Router.php.
MediaWiki\Rest\Router::getRestbaseCompatErrorData | ( | RequestInterface | $request, |
LocalizedHttpException | $e ) |
MediaWiki\Rest\Router::getRoutePath | ( | string | $routeWithModulePrefix, |
array | $pathParams = [], | ||
array | $queryParams = [] ) |
Definition at line 401 of file Router.php.
MediaWiki\Rest\Router::getRouteUrl | ( | string | $routeWithModulePrefix, |
array | $pathParams = [], | ||
array | $queryParams = [] ) |
Definition at line 411 of file Router.php.
MediaWiki\Rest\Router::isRestbaseCompatEnabled | ( | RequestInterface | $request | ) |
MediaWiki\Rest\Router::prepareHandler | ( | Handler | $handler | ) |
Prepare the handler by injecting relevant service objects and state into $handler.
Definition at line 496 of file Router.php.
References MediaWiki\Rest\Handler\initServices(), and MediaWiki\Rest\Handler\initSession().
MediaWiki\Rest\Router::setCors | ( | CorsUtils | $cors | ) |
MediaWiki\Rest\Router::setStats | ( | StatsFactory | $stats | ) |
StatsFactory | $stats |
Definition at line 525 of file Router.php.
|
protected |
const MediaWiki\Rest\Router::CONSTRUCTOR_OPTIONS |
Definition at line 82 of file Router.php.