手册:cleanupTitles.php

From mediawiki.org
This page is a translated version of the page Manual:CleanupTitles.php and the translation is 63% complete.
Outdated translations are marked like this.
MediaWiki版本:
1.6


Details

cleanupTitles.php是一个位于maintenance目录下的维护脚本,可以用于清除受损的、无法解析的标题。 所有的编辑将会记作名为“Conversion script”的用户贡献。 这一脚本对于某些用户在interwiki 表格中添加了新的跨wiki前缀(例如commandos:),从而导致主空间页面标题不明确(例如Commandos: Behind Enemy Lines)而无法访问。 同样,该脚本可用于处理$wgLegalTitleChars 中的更改,这些更改使以前有效的页面标题无法访问。 请注意,如果目标是将页面移入其适当的名称空间,则namespaceDupes.php 通常是一个更可取的选择。

另请注意,此脚本当前不支持解决编码问题(例如非UTF-8 NFC的页面)。

Options/Arguments

选项/参数 描述 Required?
--dry-run 执行试运行 Optional
--reporting-interval How often to print status line Optional

用法

php maintenance/cleanupTitles.php [ --dry-run| --reporting-interval ]


Checking for bad titles with dry-run

Terminal
$ php maintenance/cleanupTitles.php --dry-run

Checking for bad titles...
Processing page...
page 1 (main_Page) doesn't match self.
DRY RUN: would rename 1 (0,'main_Page') to (0,'Broken/Main_Page')
page 2 (saraswati_Maa) doesn't match self.
DRY RUN: would rename 2 (0,'saraswati_Maa') to (0,'Broken/Saraswati_Maa')
page 4 (abc) doesn't match self.
DRY RUN: would rename 4 (0,'abc') to (0,'Broken/Abc')
Finished page... 3 of 11 rows updated

Checking and fixing bad titles

Terminal
$ php maintenance/cleanupTitles.php

Checking and fixing bad titles...
Processing page...
page 1 (main_Page) doesn't match self.
renaming 1 (0,'main_Page') to (0,'Broken/Main_Page')
page 2 (saraswati_Maa) doesn't match self.
renaming 2 (0,'saraswati_Maa') to (0,'Broken/Saraswati_Maa')
page 4 (abc) doesn't match self.
renaming 4 (0,'abc') to (0,'Broken/Abc')
Finished page... 3 of 11 rows updated

被修复的页面将移动至移至Broken/<foo>标题(其中<foo>是受损标题的清理版本)

另见