手册:cleanupEmptyCategories.php
Appearance
Outdated translations are marked like this.
| MediaWiki版本: | ≥ 1.28 |
| MediaWiki文件: cleanupEmptyCategories.php | |
|---|---|
| 位置: | maintenance/ |
| 源代码: | master • 1.45.1 • 1.44.3 • 1.39.17 |
| 类: | CleanupEmptyCategories |
细节
cleanupEmptyCategories.php是一个用于清理category数据表中的空分类的维护脚本。 此脚本会移除没有描述页面的空分类,并添加有描述页面的空分类来清理category数据表。 它将分批次打印出进度指示器。 此脚本可以非常安全地在大型的,活跃的维基上运行,并且运行多次也不会有影响。 如果运行脚本造成过高负载,您可以使用限制参数;这不会影响准确性。
如果需要中断脚本并稍后恢复,您可以使用--mode和--begin参数带上最后打印出的进度指示,以从您中断的位置开始工作。
Options/Arguments
| 选项/参数 | 描述 | Required? |
|---|---|---|
| --mode | Use "add" option to empty categories with description pages, "remove" option to empty categories without description pages or "both" to actually do both. Default: both |
Optional |
| --begin | Only do categories whose names are alphabetically after the provided name | Optional |
| --throttle | Wait this many milliseconds after each batch. 默认值: 0 | Optional |
| --force | If the script was already ever used once force it to cleanup again. Default: unused | Optional |
用法
php maintenance/run.php cleanupEmptyCategories [ --mode| --begin| --throttle| --force ]
Terminal
$ php maintenance/run.php cleanupEmptyCategories Adding empty categories with description pages... Removing empty categories without description pages... Category cleanup complete.
Whenever the script runs, it makes a note in the database and will not run again. If you want to run the script again, run the command with the --force option.
请参阅bug T235019。