Jump to content

Manual:cleanupEmptyCategories.php

From mediawiki.org
This page is a translated version of the page Manual:CleanupEmptyCategories.php and the translation is 70% complete.
MediaWiki バージョン:
1.28

詳細

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 説明ページのあるカテゴリを空にするには「add」オプションを、説明ページのないカテゴリを空にするには「remove」オプションを、両方を空にするには「both」を使用します。既定値: both 省略可能
--begin 指定した文字列の後にアルファベット順で続く名前のカテゴリのみを処理します 省略可能
--throttle 処理を行うごとに、ここで指定したミリ秒数待機します。 既定値: 0 省略可能
--force スクリプトが既に一度使用されている場合に、強制的に再度クリーンアップを実行します。既定値: unused 省略可能


使用法

php maintenance/run.php cleanupEmptyCategories [ --mode| --begin| --throttle| --force ]
Terminal
スクリプトが実行されるたびに、データベース内にメモが作成され、二度と実行されないようになります。 このスクリプトをもう一度実行したい場合は、コマンドに --force オプションを付けて実行してください。

バグ T235019 を参照してください。

MediaWiki バージョン 1.39.15 以前では、メンテナンス スクリプトを php maintenance/run.php スクリプト名 ではなく php maintenance/スクリプト名.php を使用して実行する必要があります。

関連項目