Manual:cleanupEmptyCategories.php
Appearance
MediaWiki バージョン: | ≧ 1.28 |
MediaWiki ファイル: cleanupEmptyCategories.php | |
---|---|
場所: | maintenance/ |
ソース コード: | master • 1.42.3 • 1.41.4 • 1.39.10 |
クラス: | CleanupEmptyCategories |
詳細
cleanupEmptyCategories.php is a maintenance script to clean up empty categories in the category
table.
This script will clean up the category
table by removing entries for empty categories without a description page and adding entries for empty categories with a description page.
It will print out progress indicators every batch.
The script is perfectly safe to run on large, live wikis, and running it multiple times is harmless.
You may want to use the throttling options if it's causing too much load; they will not affect correctness.
If the script is stopped and later resumed, you can use the --mode and --begin options with the last printed progress indicator to pick up where you left off.
オプション/引数
オプション | 説明 | 必須かどうか |
---|---|---|
--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 |
省略可能 |
--begin | Only do categories whose names are alphabetically after the provided name | 省略可能 |
--throttle | Wait this many milliseconds after each batch. 既定値: 0 | 省略可能 |
--force | If the script was already ever used once force it to cleanup again. Default: unused | 省略可能 |
使用法
php maintenance/cleanupEmptyCategories.php [ --mode| --begin| --throttle| --force ]
Terminal
$ php maintenance/cleanupEmptyCategories.php Adding empty categories with description pages... Removing empty categories without description pages... Category cleanup complete.
スクリプトが実行されるたびに、データベース内にメモが作成され、二度と実行されないようになります。 このスクリプトをもう一度実行したい場合は、コマンドに --force オプションを付けて実行してください。
バグ T235019 を参照してください。