MediaWiki REL1_39
|
The REST router is responsible for gathering handler configuration, matching an input path and HTTP method against the defined routes, and constructing and executing the relevant handler for a request. More...
Public Member Functions | |
__construct ( $routeFiles, $extraRoutes, ServiceOptions $options, BagOStuff $cacheBag, ResponseFactory $responseFactory, BasicAuthorizerInterface $basicAuth, Authority $authority, ObjectFactory $objectFactory, Validator $restValidator, ErrorReporter $errorReporter, HookContainer $hookContainer, Session $session) | |
execute (RequestInterface $request) | |
Find the handler for a request and execute it. | |
getPrivateRouteUrl (string $route, array $pathParams=[], array $queryParams=[]) | |
Returns a full private URL for the given route. | |
getRouteUrl (string $route, array $pathParams=[], array $queryParams=[]) | |
Returns a full URL for the given route. | |
setCors (CorsUtils $cors) | |
Protected Member Functions | |
substPathParams (string $route, array $pathParams) | |
The REST router is responsible for gathering handler configuration, matching an input path and HTTP method against the defined routes, and constructing and executing the relevant handler for a request.
Definition at line 25 of file Router.php.
MediaWiki\Rest\Router::__construct | ( | $routeFiles, | |
$extraRoutes, | |||
ServiceOptions | $options, | ||
BagOStuff | $cacheBag, | ||
ResponseFactory | $responseFactory, | ||
BasicAuthorizerInterface | $basicAuth, | ||
Authority | $authority, | ||
ObjectFactory | $objectFactory, | ||
Validator | $restValidator, | ||
ErrorReporter | $errorReporter, | ||
HookContainer | $hookContainer, | ||
Session | $session ) |
string[] | $routeFiles | List of names of JSON files containing routes |
array | $extraRoutes | Extension route array |
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 108 of file Router.php.
References MediaWiki\Config\ServiceOptions\assertRequiredOptions(), MediaWiki\MainConfigNames\CanonicalServer, MediaWiki\Config\ServiceOptions\get(), MediaWiki\MainConfigNames\InternalServer, and MediaWiki\MainConfigNames\RestPath.
MediaWiki\Rest\Router::execute | ( | RequestInterface | $request | ) |
Find the handler for a request and execute it.
RequestInterface | $request |
Definition at line 352 of file Router.php.
References $path, MediaWiki\Rest\RequestInterface\getMethod(), MediaWiki\Rest\RequestInterface\getUri(), and MediaWiki\Rest\RequestInterface\setPathParams().
MediaWiki\Rest\Router::getPrivateRouteUrl | ( | string | $route, |
array | $pathParams = [], | ||
array | $queryParams = [] ) |
Returns a full private URL for the given route.
Private URLs are for use within the local subnet, they may use host names or ports or paths that are not publicly accessible. Intended for use in redirects and when including links to endpoints in output.
string | $route | |
array | $pathParams | |
array | $queryParams |
Definition at line 319 of file Router.php.
MediaWiki\Rest\Router::getRouteUrl | ( | string | $route, |
array | $pathParams = [], | ||
array | $queryParams = [] ) |
Returns a full URL for the given route.
Intended for use in redirects and when including links to endpoints in output.
string | $route | |
array | $pathParams | |
array | $queryParams |
Definition at line 290 of file Router.php.
MediaWiki\Rest\Router::setCors | ( | CorsUtils | $cors | ) |
|
protected |