Manual:nukeNS.php
From Linux Web Expert
<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.10
<translate> MediaWiki version:</translate> |
MediaWiki ファイル: nukeNS.php | |
---|---|
場所: | maintenance/ |
ソース コード: | master • 1.41.1 • 1.40.3 • 1.39.7 |
クラス: | NukeNS |
詳細
nukeNS.php file is a maintenance script to remove all pages with only one revision (by default) from the MediaWiki namespace , without flooding recent changes, deletion logs, etc. It has originally been added to remove the content of unchanged interface texts from the MediaWiki namespace, but it can be used to basically delete all pages from any namespace.
オプション/引数
オプション | 説明 | 必須かどうか |
---|---|---|
--delete | Actually delete the pages and their revisions. Without this option, the script works in dry-run mode. | <translate> Optional</translate> |
--ns | Namespace to delete from. Defaults to the MediaWiki: namespace. You must provide the namespace number, not the name. See Manual:名前空間 for a list. | <translate> Optional</translate> |
--all | Delete pages regardless of revision count. With this option, not only pages with only one single revision, but also pages with more than one revision will be deleted. | <translate> Optional</translate> |
使用法
php maintenance/nukeNS.php [ --delete| --ns| --all ]
Checking potential deletion
Terminal
$ php maintenance/nukeNS.php --ns 6 delete: File:Screenshot 2022-03-11 at 1.47.10 PM.png delete: File:Screenshot 2022-03-11 at 3.58.05 PM.png delete: File:Screenshot 2022-03-11 at 3.58.12 PM.png To update the database, run the script with the --delete option.
Making deletion
Terminal
$ php maintenance/nukeNS.php --ns 6 --delete delete: File:Screenshot 2022-03-11 at 1.47.10 PM.png delete: File:Screenshot 2022-03-11 at 3.58.05 PM.png delete: File:Screenshot 2022-03-11 at 3.58.12 PM.png Searching for active text records via contents table...done. Searching for inactive text records...done. 0 inactive items found.