dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Rename testBug25702() to testPrefixNormalizationSearchBug()"
[lhc/web/wiklou.git]
/
maintenance
/
cleanupCaps.php
diff --git
a/maintenance/cleanupCaps.php
b/maintenance/cleanupCaps.php
index
1a47ac4
..
6234db4
100644
(file)
--- a/
maintenance/cleanupCaps.php
+++ b/
maintenance/cleanupCaps.php
@@
-7,7
+7,7
@@
* --dry-run don't actually try moving them
*
* Copyright © 2005 Brion Vibber <brion@pobox.com>
* --dry-run don't actually try moving them
*
* Copyright © 2005 Brion Vibber <brion@pobox.com>
- * http://www.mediawiki.org/
+ * http
s
://www.mediawiki.org/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-37,6
+37,9
@@
require_once __DIR__ . '/cleanupTable.inc';
* @ingroup Maintenance
*/
class CapsCleanup extends TableCleanup {
* @ingroup Maintenance
*/
class CapsCleanup extends TableCleanup {
+
+ private $user;
+
public function __construct() {
parent::__construct();
$this->mDescription = "Script to cleanup capitalization";
public function __construct() {
parent::__construct();
$this->mDescription = "Script to cleanup capitalization";
@@
-44,13
+47,13
@@
class CapsCleanup extends TableCleanup {
}
public function execute() {
}
public function execute() {
- global $wgCapitalLinks
, $wgUser
;
+ global $wgCapitalLinks;
if ( $wgCapitalLinks ) {
$this->error( "\$wgCapitalLinks is on -- no need for caps links cleanup.", true );
}
if ( $wgCapitalLinks ) {
$this->error( "\$wgCapitalLinks is on -- no need for caps links cleanup.", true );
}
- $
wgU
ser = User::newFromName( 'Conversion script' );
+ $
this->u
ser = User::newFromName( 'Conversion script' );
$this->namespace = intval( $this->getOption( 'namespace', 0 ) );
$this->dryrun = $this->hasOption( 'dry-run' );
$this->namespace = intval( $this->getOption( 'namespace', 0 ) );
$this->dryrun = $this->hasOption( 'dry-run' );
@@
-71,6
+74,7
@@
class CapsCleanup extends TableCleanup {
$lower = $wgContLang->lcfirst( $row->page_title );
if ( $upper == $lower ) {
$this->output( "\"$display\" already lowercase.\n" );
$lower = $wgContLang->lcfirst( $row->page_title );
if ( $upper == $lower ) {
$this->output( "\"$display\" already lowercase.\n" );
+
return $this->progress( 0 );
}
return $this->progress( 0 );
}
@@
-78,6
+82,7
@@
class CapsCleanup extends TableCleanup {
$targetDisplay = $target->getPrefixedText();
if ( $target->exists() ) {
$this->output( "\"$display\" skipped; \"$targetDisplay\" already exists\n" );
$targetDisplay = $target->getPrefixedText();
if ( $target->exists() ) {
$this->output( "\"$display\" skipped; \"$targetDisplay\" already exists\n" );
+
return $this->progress( 0 );
}
return $this->progress( 0 );
}
@@
-85,7
+90,9
@@
class CapsCleanup extends TableCleanup {
$this->output( "\"$display\" -> \"$targetDisplay\": DRY RUN, NOT MOVED\n" );
$ok = true;
} else {
$this->output( "\"$display\" -> \"$targetDisplay\": DRY RUN, NOT MOVED\n" );
$ok = true;
} else {
- $ok = $current->moveTo( $target, false, 'Converting page titles to lowercase' );
+ $mp = new MovePage( $current, $target );
+ $status = $mp->move( $this->user, 'Converting page titles to lowercase', true );
+ $ok = $status->isOK() ? 'OK' : $status->getWikiText();
$this->output( "\"$display\" -> \"$targetDisplay\": $ok\n" );
}
if ( $ok === true ) {
$this->output( "\"$display\" -> \"$targetDisplay\": $ok\n" );
}
if ( $ok === true ) {
@@
-98,6
+105,7
@@
class CapsCleanup extends TableCleanup {
}
}
}
}
}
}
+
return $this->progress( 0 );
}
}
return $this->progress( 0 );
}
}