MediaWiki  REL1_24
RefreshLinks Class Reference

Maintenance script to refresh link tables. More...

Inheritance diagram for RefreshLinks:
Collaboration diagram for RefreshLinks:

List of all members.

Public Member Functions

 __construct ()
 execute ()

Static Public Member Functions

static fixLinksFromArticle ($id)
 Run LinksUpdate for all links on a given page_id.

Private Member Functions

 deleteLinksFromNonexistent ($maxLag=0, $batchSize=100)
 Removes non-existing links from pages from pagelinks, imagelinks, categorylinks, templatelinks, externallinks, interwikilinks, langlinks and redirect tables.
 doRefreshLinks ($start, $newOnly=false, $maxLag=false, $end=0, $redirectsOnly=false, $oldRedirectsOnly=false)
 Do the actual link refreshing.
 fixRedirect ($id)
 Update the redirect entry for a given page.

Detailed Description

Maintenance script to refresh link tables.

Definition at line 31 of file refreshLinks.php.


Constructor & Destructor Documentation


Member Function Documentation

RefreshLinks::deleteLinksFromNonexistent ( maxLag = 0,
batchSize = 100 
) [private]

Removes non-existing links from pages from pagelinks, imagelinks, categorylinks, templatelinks, externallinks, interwikilinks, langlinks and redirect tables.

Parameters:
int$maxLag
int$batchSizeThe size of deletion batches
Author:
Merlijn van Deen <[email protected]>

Definition at line 261 of file refreshLinks.php.

References $dbr, $lb, array(), as, Maintenance\output(), wfGetDB(), wfGetLBFactory(), and wfWaitForSlaves().

Referenced by execute().

RefreshLinks::doRefreshLinks ( start,
newOnly = false,
maxLag = false,
end = 0,
redirectsOnly = false,
oldRedirectsOnly = false 
) [private]

Do the actual link refreshing.

Parameters:
int$startPage_id to start from
bool$newOnlyOnly do pages with 1 edit
int$maxLagMax DB replication lag
int$endPage_id to stop at
bool$redirectsOnlyOnly fix redirects
bool$oldRedirectsOnlyOnly fix redirects without redirect entries

Definition at line 67 of file refreshLinks.php.

References $conds, $dbr, $res, $wgParser, array(), as, fixLinksFromArticle(), fixRedirect(), global, Maintenance\output(), wfGetDB(), wfRunHooks(), and wfWaitForSlaves().

Referenced by execute().

static RefreshLinks::fixLinksFromArticle ( id) [static]

Run LinksUpdate for all links on a given page_id.

Parameters:
int$idThe page_id

Definition at line 229 of file refreshLinks.php.

References $content, WikiPage\newFromID(), Revision\RAW, DataUpdate\runUpdates(), LinkCache\singleton(), and wfGetDB().

Referenced by doRefreshLinks().

RefreshLinks::fixRedirect ( id) [private]

Update the redirect entry for a given page.

This methods bypasses the "redirect" table to get the redirect target, and parses the page's content to fetch it. This allows to be sure that the redirect target is up to date and valid. This is particularly useful when modifying namespaces to be sure the entry in the "redirect" table points to the correct page and not to an invalid one.

Parameters:
int$idThe page ID to check

Definition at line 191 of file refreshLinks.php.

References $content, array(), WikiPage\newFromID(), Revision\RAW, and wfGetDB().

Referenced by doRefreshLinks().


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