Manual:attachLatest.php
MediaWiki version: | ≥ 1.6 |
MediaWiki file: attachLatest.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.42.4 • 1.41.5 • 1.39.11 |
Classes: | AttachLatest |
Details
editattachLatest.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
editOption | Description | Required? |
---|---|---|
--fix | To actually change the database. | Optional |
--regenerate-all | To regenerate this field for all records in table page. | Optional |
Without any parameter, it will display what will be fixed, but not changes will be done to the database.
Usage
editphp maintenance/run.php attachLatest [ --fix| --regenerate-all ]
In MediaWiki version 1.39.10 and earlier, you must invoke maintenance scripts using
php maintenance/scriptName.php
instead of php maintenance/run.php scriptName
.Dry run to check pages
editTerminal
$ php maintenance/run.php attachLatest Looking for pages with page_latest set to 0... Done! Processed 13 pages. This was a dry run; rerun with --fix to update page_latest.
Fixing the pages
editTerminal
$ php maintenance/run.php attachLatest --fix Looking for pages with page_latest set to 0... Done! Processed 13 pages.