Manual:attachLatest.php

From Linux Web Expert

Revision as of 19:41, 24 February 2022 by imported>APaskulin (WMF) (Simply and correct first sentence)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.6
<translate> MediaWiki version:</translate>

Details

attachLatest.php file is a maintenance script that fixes incorrect values in the page_latest field in the database. The program is looking for pages with column page_latest from the table page set to 0. For these pages, it then attaches the latest revision of that page according to the revision timestamp. The script finally prints out the number of pages, which have been or would be changed.

attachLatest.php does not check, if the revision, which is set as page_latest actually exists. If the page_latest field points to a non-existing revision, attachLatest.php, unless used with the --regenerate-all parameter, will not fix this.

Options/Arguments

Option Description Required?
--fix To actually change the database. <translate> Optional</translate>
--regenerate-all To regenerate this field for all records in table page. <translate> Optional</translate>

Without any parameter, it will display what will be fixed, but not changes will be done to the database.

Usage

php maintenance/attachLatest.php [ --fix| --regenerate-all ]

Dry run to check pages

Terminal

Fixing the pages

Terminal

See also