X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FconvertLinks.php;h=59820a5a8fff57f4c33a6b7c1f3fa49489f3feb9;hb=243a466018d24415de27815cfae995865c45a66a;hp=8cd029762ffcd435b63e465be9d20b6d77e9aaed;hpb=220bda9175a18458449e9d754fb48830c1f76f25;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/convertLinks.php b/maintenance/convertLinks.php index 8cd029762f..59820a5a8f 100644 --- a/maintenance/convertLinks.php +++ b/maintenance/convertLinks.php @@ -21,6 +21,8 @@ * @ingroup Maintenance */ +use MediaWiki\MediaWikiServices; + require_once __DIR__ . '/Maintenance.php'; /** @@ -75,8 +77,6 @@ class ConvertLinks extends Maintenance { return; } - global $wgContLang; - # counters etc $numBadLinks = $curRowsRead = 0; @@ -126,7 +126,6 @@ class ConvertLinks extends Maintenance { $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" ); @@ -153,7 +152,8 @@ class ConvertLinks extends Maintenance { 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++; @@ -167,7 +167,6 @@ class ConvertLinks extends Maintenance { } } } - $dbw->freeResult( $res ); $dbw->bufferResults( true ); $this->output( "Finished loading IDs.\n\n" ); $this->performanceLog( @@ -213,7 +212,6 @@ class ConvertLinks extends Maintenance { $numBadLinks++; } } - $dbw->freeResult( $res ); # $this->output( "rowOffset: $rowOffset\ttuplesAdded: " # . "$tuplesAdded\tnumBadLinks: $numBadLinks\n" ); if ( $tuplesAdded != 0 ) {