MediaWiki master
MediaWiki\Page\RedirectStore Class Reference

Service for storing and retrieving page redirect information. More...

Inherits MediaWiki\Page\RedirectLookup.

Collaboration diagram for MediaWiki\Page\RedirectStore:

Public Member Functions

 __construct (IConnectionProvider $connectionProvider, PageLookup $pageLookup, TitleParser $titleParser, RepoGroup $repoGroup, LoggerInterface $logger)
 
 clearCache ( $page)
 Clear process-cached redirect information for a page.
 
 getRedirectTarget (PageIdentity $page)
 Get the redirect destination.
 
 updateRedirectTarget (PageIdentity $page, ?LinkTarget $target, ?bool $lastRevWasRedirect=null)
 Update the redirect target for a page.
 

Detailed Description

Service for storing and retrieving page redirect information.

Stability: unstable
Since
1.38

Definition at line 39 of file RedirectStore.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Page\RedirectStore::__construct ( IConnectionProvider $connectionProvider,
PageLookup $pageLookup,
TitleParser $titleParser,
RepoGroup $repoGroup,
LoggerInterface $logger )

Definition at line 47 of file RedirectStore.php.

Member Function Documentation

◆ clearCache()

MediaWiki\Page\RedirectStore::clearCache ( $page)

Clear process-cached redirect information for a page.

Parameters
LinkTarget | PageIdentity$pageThe page to clear the cache for.
Returns
void

Definition at line 213 of file RedirectStore.php.

◆ getRedirectTarget()

MediaWiki\Page\RedirectStore::getRedirectTarget ( PageIdentity $page)

Get the redirect destination.

Since
1.38
Parameters
PageIdentity$page
Returns
LinkTarget|null Returns null if this page is not a redirect
Exceptions
PageAssertionExceptionIf page does not represent an editable page

Implements MediaWiki\Page\RedirectLookup.

Definition at line 62 of file RedirectStore.php.

◆ updateRedirectTarget()

MediaWiki\Page\RedirectStore::updateRedirectTarget ( PageIdentity $page,
?LinkTarget $target,
?bool $lastRevWasRedirect = null )

Update the redirect target for a page.

Parameters
PageIdentity$pageThe page to update the redirect target for.
LinkTarget | null$targetThe new redirect target, or null if this is not a redirect.
bool | null$lastRevWasRedirectWhether the last revision was a redirect, or null if not known. If set, this allows eliding writes to the redirect table.
Returns
bool true on success, false on failure.

Definition at line 129 of file RedirectStore.php.

References MediaWiki\Page\PageIdentity\getId(), MediaWiki\Page\PageReference\getNamespace(), and NS_FILE.


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