Merge "Make doTestLockCalls() faster"
[lhc/web/wiklou.git] / maintenance / dumpIterator.php
index 707f4b3..20e9459 100644 (file)
@@ -34,9 +34,10 @@ require_once __DIR__ . '/Maintenance.php';
  * @ingroup Maintenance
  */
 abstract class DumpIterator extends Maintenance {
-
        private $count = 0;
        private $startTime;
+       /** @var string|bool|null */
+       private $from;
 
        public function __construct() {
                parent::__construct();
@@ -60,6 +61,7 @@ abstract class DumpIterator extends Maintenance {
                        $revision->setTitle( Title::newFromText(
                                rawurldecode( basename( $this->getOption( 'file' ), '.txt' ) )
                        ) );
+                       $this->from = false;
                        $this->handleRevision( $revision );
 
                        return;
@@ -105,7 +107,7 @@ abstract class DumpIterator extends Maintenance {
                if ( $this->getDbType() == Maintenance::DB_NONE ) {
                        global $wgUseDatabaseMessages, $wgLocalisationCacheConf, $wgHooks;
                        $wgUseDatabaseMessages = false;
-                       $wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
+                       $wgLocalisationCacheConf['storeClass'] = LCStoreNull::class;
                        $wgHooks['InterwikiLoadPrefix'][] = 'DumpIterator::disableInterwikis';
                }
        }
@@ -131,7 +133,7 @@ abstract class DumpIterator extends Maintenance {
                }
 
                $this->count++;
-               if ( isset( $this->from ) ) {
+               if ( $this->from !== false ) {
                        if ( $this->from != $title ) {
                                return;
                        }
@@ -146,12 +148,10 @@ abstract class DumpIterator extends Maintenance {
 
        /* Stub function for processing additional options */
        public function checkOptions() {
-               return;
        }
 
        /* Stub function for giving data about what was computed */
        public function conclusions() {
-               return;
        }
 
        /* Core function which does whatever the maintenance script is designed to do */
@@ -185,5 +185,5 @@ class SearchDump extends DumpIterator {
        }
 }
 
-$maintClass = "SearchDump";
+$maintClass = SearchDump::class;
 require_once RUN_MAINTENANCE_IF_MAIN;