Helper class for handling page redirects, for use with REST Handlers that provide access to resources bound to MediaWiki pages.
More...
Helper class for handling page redirects, for use with REST Handlers that provide access to resources bound to MediaWiki pages.
- Since
- 1.41
Definition at line 23 of file PageRedirectHelper.php.
◆ __construct()
◆ createNormalizationRedirectResponseIfNeeded()
MediaWiki\Rest\Handler\Helper\PageRedirectHelper::createNormalizationRedirectResponseIfNeeded |
( |
PageIdentity | $page, |
|
|
?string | $titleAsRequested ) |
Check for Page Normalization Redirects and create a Permanent Redirect Response.
- Parameters
-
PageIdentity | $page | |
?string | $titleAsRequested | |
- Returns
- Response|null
Definition at line 73 of file PageRedirectHelper.php.
◆ createRedirectResponseIfNeeded()
MediaWiki\Rest\Handler\Helper\PageRedirectHelper::createRedirectResponseIfNeeded |
( |
PageIdentity | $page, |
|
|
?string | $titleAsRequested ) |
Use this function for endpoints that check for both normalizations and wiki redirects.
- Parameters
-
PageIdentity | $page | |
string | null | $titleAsRequested | |
- Returns
- Response|null
Definition at line 212 of file PageRedirectHelper.php.
◆ createWikiRedirectResponseIfNeeded()
MediaWiki\Rest\Handler\Helper\PageRedirectHelper::createWikiRedirectResponseIfNeeded |
( |
PageIdentity | $page | ) |
|
Check for Page Wiki Redirects and create a Temporary Redirect Response.
- Parameters
-
- Returns
- Response|null
Definition at line 97 of file PageRedirectHelper.php.
◆ getTargetUrl()
MediaWiki\Rest\Handler\Helper\PageRedirectHelper::getTargetUrl |
( |
| $title | ) |
|
- Parameters
-
string | LinkTarget | PageReference | $title | |
- Returns
- string The target to use in the Location header. Will be relative, unless setUseRelativeRedirects( false ) was called.
Definition at line 182 of file PageRedirectHelper.php.
◆ getWikiRedirectTargetUrl()
MediaWiki\Rest\Handler\Helper\PageRedirectHelper::getWikiRedirectTargetUrl |
( |
PageIdentity | $page | ) |
|
◆ setFollowWikiRedirects()
MediaWiki\Rest\Handler\Helper\PageRedirectHelper::setFollowWikiRedirects |
( |
bool | $followWikiRedirects | ) |
|
◆ setUseRelativeRedirects()
MediaWiki\Rest\Handler\Helper\PageRedirectHelper::setUseRelativeRedirects |
( |
bool | $useRelativeRedirects | ) |
|
The documentation for this class was generated from the following file: