* @ingroup Maintenance
*/
+use MediaWiki\MediaWikiServices;
+
require_once __DIR__ . '/Maintenance.php';
/**
return;
}
- global $wgContLang;
-
# counters etc
$numBadLinks = $curRowsRead = 0;
$res = $dbw->query( "SELECT COUNT(*) AS count FROM $links" );
$row = $dbw->fetchObject( $res );
$numRows = $row->count;
- $dbw->freeResult( $res );
if ( $numRows == 0 ) {
$this->output( "Updating schema (no rows to convert)...\n" );
foreach ( $res as $row ) {
$title = $row->cur_title;
if ( $row->cur_namespace ) {
- $title = $wgContLang->getNsText( $row->cur_namespace ) . ":$title";
+ $title = MediaWikiServices::getInstance()->getContentLanguage()->
+ getNsText( $row->cur_namespace ) . ":$title";
}
$ids[$title] = $row->cur_id;
$curRowsRead++;
}
}
}
- $dbw->freeResult( $res );
$dbw->bufferResults( true );
$this->output( "Finished loading IDs.\n\n" );
$this->performanceLog(
$numBadLinks++;
}
}
- $dbw->freeResult( $res );
# $this->output( "rowOffset: $rowOffset\ttuplesAdded: "
# . "$tuplesAdded\tnumBadLinks: $numBadLinks\n" );
if ( $tuplesAdded != 0 ) {
}
}
-$maintClass = "ConvertLinks";
+$maintClass = ConvertLinks::class;
require_once RUN_MAINTENANCE_IF_MAIN;