Manual:refreshLinks.php

From MediaWiki.org
Jump to: navigation, search
MediaWiki File: refreshLinks.php
Location: /maintenance/
Source code:

HEAD1.18beta1
1.18.11.17.2

Classes: None

refreshLinks.php is a maintenance script used to [re]fill pagelinks, categorylinks, imagelinks tables. You should run it if you found that Categories are empty or don't show all pages, if "What links here?" doesn't work well or in some other link-related trouble.

Contents

[edit] Invocation

php maintenance/refreshLinks.php [starting_article]

[edit] Advanced Usage

php refreshLinks.php [--conf|--dbpass|--dbuser|--dfn-only|--e|--globals|--help|--m|--new-only|--old-redirects-only|--quiet|--redirects-only|--wiki] <start>
Option/Parameter Description
--dfn-only Delete links from nonexistent articles only
--e <page_id> Last page id to refresh
--m <max_lag> Maximum replication lag
--new-only Only affect articles with just a single edit
--old-redirects-only Only fix redirects with no redirect table entry
--redirects-only Only fix redirects, not all links
--wiki For specifying the wiki ID
--help Show help text
<start> Article number (page_id) to start at
no parameters Will refresh all articles

This also supports the common options as well.

[edit] Example

vi-notebook:/var/lib/mediawiki1.7# php maintenance/refreshLinks.php
Refreshing link table.
Starting from page_id 1 of 1426.
100
200
300
400
500
600
700
800
900
1000
1100
1200
1300
1400

[edit] Avoiding memory issues

This script may run into memory issues. To avoid this you may like to set a last page_id to refresh.

php refreshLinks.php --e 1500

To do the next set of page_ids you enter

php refreshLinks.php -- 1500 --e 3000

Just continue until all page ids in your wiki were refreshed.

If you forgot to set a last page_id to refresh and the script runs out of memory simply rerun it with the last output page_id as the article to start at, e.g.

php refreshLinks.php -- 1600
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox