+ protected function processRowToUppercase( $row ) {
+ global $wgContLang;
+
+ $current = Title::makeTitle( $row->page_namespace, $row->page_title );
+ $display = $current->getPrefixedText();
+ $lower = $row->page_title;
+ $upper = $wgContLang->ucfirst( $row->page_title );
+ if ( $upper == $lower ) {
+ $this->output( "\"$display\" already uppercase.\n" );
+
+ return $this->progress( 0 );
+ }
+
+ $target = Title::makeTitle( $row->page_namespace, $upper );
+ if ( $target->exists() ) {
+ // Prefix "CapsCleanup" to bypass the conflict
+ $target = Title::newFromText( __CLASS__ . '/' . $display );
+ }
+ $ok = $this->movePage(
+ $current,
+ $target,
+ 'Converting page title to first-letter uppercase',
+ false
+ );
+ if ( $ok ) {
+ $this->progress( 1 );
+ if ( $row->page_namespace == $this->namespace ) {
+ $talk = $target->getTalkPage();
+ $row->page_namespace = $talk->getNamespace();
+ if ( $talk->exists() ) {
+ return $this->processRowToUppercase( $row );
+ }
+ }
+ }
+
+ return $this->progress( 0 );
+ }
+
+ protected function processRowToLowercase( $row ) {