Merge "Use our fork of less.php" into REL1_31
[lhc/web/wiklou.git] / maintenance / populateBacklinkNamespace.php
index eb82806..e2fd8b5 100644 (file)
@@ -52,13 +52,13 @@ class PopulateBacklinkNamespace extends LoggedUpdateMaintenance {
 
                $start = $this->getOption( 'lastUpdatedId' );
                if ( !$start ) {
-                       $start = $db->selectField( 'page', 'MIN(page_id)', false, __METHOD__ );
+                       $start = $db->selectField( 'page', 'MIN(page_id)', '', __METHOD__ );
                }
                if ( !$start ) {
                        $this->output( "Nothing to do." );
                        return false;
                }
-               $end = $db->selectField( 'page', 'MAX(page_id)', false, __METHOD__ );
+               $end = $db->selectField( 'page', 'MAX(page_id)', '', __METHOD__ );
                $batchSize = $this->getBatchSize();
 
                # Do remaining chunk
@@ -67,7 +67,7 @@ class PopulateBacklinkNamespace extends LoggedUpdateMaintenance {
                $blockEnd = $start + $batchSize - 1;
                while ( $blockEnd <= $end ) {
                        $this->output( "...doing page_id from $blockStart to $blockEnd\n" );
-                       $cond = "page_id BETWEEN $blockStart AND $blockEnd";
+                       $cond = "page_id BETWEEN " . (int)$blockStart . " AND " . (int)$blockEnd;
                        $res = $db->select( 'page', [ 'page_id', 'page_namespace' ], $cond, __METHOD__ );
                        foreach ( $res as $row ) {
                                $db->update( 'pagelinks',
@@ -94,5 +94,5 @@ class PopulateBacklinkNamespace extends LoggedUpdateMaintenance {
        }
 }
 
-$maintClass = "PopulateBacklinkNamespace";
+$maintClass = PopulateBacklinkNamespace::class;
 require_once RUN_MAINTENANCE_IF_MAIN;