MediaWiki  REL1_19
RefreshLinks Class Reference

Refresh link tables. More...

Inheritance diagram for RefreshLinks:
Collaboration diagram for RefreshLinks:

List of all members.

Public Member Functions

 __construct ()
 Default constructor.
 execute ()
 Do the actual work.

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

Refresh link tables.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Definition at line 25 of file refreshLinks.php.


Constructor & Destructor Documentation

Default constructor.

Children should call this *first* if implementing their own constructors

Reimplemented from Maintenance.

Definition at line 26 of file refreshLinks.php.

References Maintenance\addArg(), Maintenance\addOption(), and Maintenance\setBatchSize().

Here is the call graph for this function:


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:
$maxLag
$batchSizeThe size of deletion batches
Author:
Merlijn van Deen <[email protected]>

Definition at line 238 of file refreshLinks.php.

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

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Do the actual link refreshing.

Parameters:
$startint Page_id to start from
$newOnlybool Only do pages with 1 edit
$maxLagint Max DB replication lag
$endint Page_id to stop at
$redirectsOnlybool Only fix redirects
$oldRedirectsOnlybool Only fix redirects without redirect entries

Definition at line 61 of file refreshLinks.php.

References $dbr, $res, $wgParser, $wgUseTidy, fixLinksFromArticle(), fixRedirect(), Maintenance\output(), wfGetDB(), wfRunHooks(), and wfWaitForSlaves().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

Do the actual work.

All child classes will need to implement this

Reimplemented from Maintenance.

Definition at line 39 of file refreshLinks.php.

References deleteLinksFromNonexistent(), doRefreshLinks(), Maintenance\getArg(), Maintenance\getOption(), and Maintenance\hasOption().

Here is the call graph for this function:

static RefreshLinks::fixLinksFromArticle ( id) [static]

Run LinksUpdate for all links on a given page_id.

Parameters:
$idint The page_id

Definition at line 203 of file refreshLinks.php.

References $options, $title, $wgParser, Title\newFromID(), Revision\newFromTitle(), LinkCache\singleton(), and wfGetDB().

Referenced by doRefreshLinks().

Here is the call graph for this function:

Here is the caller graph for this function:

RefreshLinks::fixRedirect ( id) [private]

Update the redirect entry for a given page.

Parameters:
$idint The page_id of the redirect

Definition at line 176 of file refreshLinks.php.

References $page, $title, WikiPage\factory(), Title\newFromID(), and wfGetDB().

Referenced by doRefreshLinks().

Here is the call graph for this function:

Here is the caller graph for this function:


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