手册:cleanupTitles.php
Appearance
| MediaWiki版本: | ≥ 1.6 |
| MediaWiki文件: cleanupTitles.php | |
|---|---|
| 位置: | maintenance/ |
| 源代码: | master • 1.45.3 • 1.44.5 • 1.43.8 |
| 类: | TitleCleanup |
Details
cleanupTitles.php是一个位于maintenance目录下的维护脚本,可以用于清除受损的、无法解析的标题。
这一脚本对于某些用户在interwiki表格中添加了新的跨wiki前缀(例如commandos:),从而导致主空间页面标题不明确(例如Commandos: Behind Enemy Lines)而无法访问。
同样,该脚本可用于处理$wgLegalTitleChars中的更改,这些更改使以前有效的页面标题无法访问。
请注意,如果目标是将页面移入其适当的名称空间,则namespaceDupes.php通常是一个更可取的选择。
Options/Arguments
| 选项 | 描述 | Required? |
|---|---|---|
| --dry-run | 执行试运行 | Optional |
| --reporting-interval | How often to print status line | Optional |
用法
php maintenance/run.php cleanupTitles [ --dry-run| --reporting-interval ]
在MediaWiki MediaWiki 1.39及更早版本中,您必须通过
php maintenance/脚本名称.php调用维护脚本,而不是php maintenance/run.php 脚本名称。Checking for bad titles with dry-run
Terminal
$ php maintenance/run.php cleanupTitles --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/run.php cleanupTitles 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>是受损标题的清理版本)