X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FconvertLinks.php;h=8cd029762ffcd435b63e465be9d20b6d77e9aaed;hb=228d796b1d6299ccd39418e85f40437292b47dd4;hp=15ca14b70afee78ccb5f8ecae8a64c03f11bfb02;hpb=53be5c92adab85c799754775e6b68c30fed6bf9c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/convertLinks.php b/maintenance/convertLinks.php index 15ca14b70a..8cd029762f 100644 --- a/maintenance/convertLinks.php +++ b/maintenance/convertLinks.php @@ -36,9 +36,9 @@ class ConvertLinks extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = - "Convert from the old links schema (string->ID) to the new schema (ID->ID)." - . "The wiki should be put into read-only mode while this script executes"; + $this->addDescription( + 'Convert from the old links schema (string->ID) to the new schema (ID->ID). ' + . 'The wiki should be put into read-only mode while this script executes' ); $this->addArg( 'logperformance', "Log performance to perfLogFilename.", false ); $this->addArg( @@ -148,7 +148,7 @@ class ConvertLinks extends Maintenance { $dbw->bufferResults( false ); $res = $dbw->query( "SELECT cur_namespace,cur_title,cur_id FROM $cur" ); - $ids = array(); + $ids = []; foreach ( $res as $row ) { $title = $row->cur_title; @@ -193,9 +193,9 @@ class ConvertLinks extends Maintenance { $sqlRead = $dbw->limitResult( $sqlRead, $linksConvInsertInterval, $rowOffset ); $res = $dbw->query( $sqlRead ); if ( $noKeys ) { - $sqlWrite = array( "INSERT INTO $links_temp (l_from,l_to) VALUES " ); + $sqlWrite = [ "INSERT INTO $links_temp (l_from,l_to) VALUES " ]; } else { - $sqlWrite = array( "INSERT IGNORE INTO $links_temp (l_from,l_to) VALUES " ); + $sqlWrite = [ "INSERT IGNORE INTO $links_temp (l_from,l_to) VALUES " ]; } $tuplesAdded = 0; # no tuples added to INSERT yet @@ -302,5 +302,5 @@ class ConvertLinks extends Maintenance { } } -$maintClass = "ConvertLinks"; +$maintClass = ConvertLinks::class; require_once RUN_MAINTENANCE_IF_MAIN;