Manual:UpdateCollation.php/zh

MediaWiki版本:
1.19
Category:MediaWiki code/zh#UpdateCollation.php

细节

此脚本更新类别排序规则。 您需要在更改 $wgCategoryCollation 后运行此脚本。 它还需要在从 1.17 之前的 MediaWiki 版本升级到 1.17 及更高版本后运行。 通常它作为update.php的一部分运行。

If your category collations are messed up (aka things sort incorrectly in categories), you can use the --force switch to forcibly fix all the category collations.

The run time of the script depends on the number of rows in the categorylinks table, and for extremely large wikis may take over 24 hours. (A run on the English Wikipedia in September 2016 took around a week: phab:T136150.) The script can process on the order of 10,000 rows per minute (depending on your setup); you can view the estimated number of rows on your wiki before running the real script by using updateCollation.php --dry-run. Wikimedia wikis of various sizes have been painlessly switched to different collations over time (phab:T47443), just make sure to estimate how long the script will run before you start it.

选项/参数

选项描述必需?
--forceRun on all rows, even if the collation is supposed to be up-to-date.Optional
--previous-collation Set the previous value of $wgCategoryCollation here to speed up this script, especially if your categorylinks table is large. This will only update rows with that collation, though, so it may miss out-of-date rows with a different, even older collation. Optional
--target-collation 将其设置为要使用的新排序规则类型,而不是 $wgCategoryCollation。 通常你不应该使用它,你应该只更新 $wgCategoryCollation 在 LocalSettings.php Optional
--target-tableCopy rows from categorylinks into the specified table instead of updating them in place.Optional
--remoteUse Shellbox to calculate the new sort keys remotely.Optional
--dry-runDon't actually change the collations, just compile statistics.Optional
--verbose-stats显示更多统计信息。Optional

用法

php maintenance/run.php updateCollation [ --force| --previous-collation| --target-collation| --target-table| --remote| --dry-run| --verbose-stats ]
In MediaWiki version 1.39.12 and earlier, you must invoke maintenance scripts using php maintenance/scriptName.php instead of php maintenance/run.php scriptName.

试运行以检查更新

Terminal

更新类别排序规则

Terminal

参见

Category:Maintenance scripts/zh Category:Content maintenance scripts/zh
Category:Content maintenance scripts/zh Category:Maintenance scripts/zh Category:MediaWiki code/zh