Use IDatabase type hints in /maintenance
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 30 Mar 2017 20:46:06 +0000 (13:46 -0700)
committerKrinkle <krinklemail@gmail.com>
Fri, 7 Apr 2017 23:37:41 +0000 (23:37 +0000)
Relatedly, move lockTables()/unlockTables() to IMaintainableDatabase

Change-Id: Ib53e9fa948deb2f9a70f0ce16c002613d0060bf9

20 files changed:
maintenance/Maintenance.php
maintenance/archives/upgradeLogging.php
maintenance/benchmarks/bench_delete_truncate.php
maintenance/convertUserOptions.php
maintenance/deleteOrphanedRevisions.php
maintenance/deleteRevision.php
maintenance/dumpIterator.php
maintenance/dumpTextPass.php
maintenance/fetchText.php
maintenance/namespaceDupes.php
maintenance/orphans.php
maintenance/populateContentModel.php
maintenance/populateRecentChangesSource.php
maintenance/rebuildImages.php
maintenance/rebuildtextindex.php
maintenance/refreshImageMetadata.php
maintenance/refreshLinks.php
maintenance/sql.php
maintenance/update.php
maintenance/updateCollation.php

index a8080c5..e5ba411 100644 (file)
@@ -40,6 +40,7 @@ use Wikimedia\Rdbms\IDatabase;
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\LBFactory;
 use MediaWiki\Logger\LoggerFactory;
 use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\LBFactory;
+use Wikimedia\Rdbms\IMaintainableDatabase;
 
 /**
  * Abstract maintenance class for quickly writing and churning out
 
 /**
  * Abstract maintenance class for quickly writing and churning out
@@ -106,7 +107,7 @@ abstract class Maintenance {
 
        /**
         * Used by getDB() / setDB()
 
        /**
         * Used by getDB() / setDB()
-        * @var Database
+        * @var IMaintainableDatabase
         */
        private $mDb = null;
 
         */
        private $mDb = null;
 
@@ -206,7 +207,7 @@ abstract class Maintenance {
         * @param string $description The description of the param to show on --help
         * @param bool $required Is the param required?
         * @param bool $withArg Is an argument required with this option?
         * @param string $description The description of the param to show on --help
         * @param bool $required Is the param required?
         * @param bool $withArg Is an argument required with this option?
-        * @param string $shortName Character to use as short name
+        * @param string|bool $shortName Character to use as short name
         * @param bool $multiOccurrence Can this option be passed multiple times?
         */
        protected function addOption( $name, $description, $required = false,
         * @param bool $multiOccurrence Can this option be passed multiple times?
         */
        protected function addOption( $name, $description, $required = false,
@@ -1243,7 +1244,7 @@ abstract class Maintenance {
         * @param integer $db DB index (DB_REPLICA/DB_MASTER)
         * @param array $groups; default: empty array
         * @param string|bool $wiki; default: current wiki
         * @param integer $db DB index (DB_REPLICA/DB_MASTER)
         * @param array $groups; default: empty array
         * @param string|bool $wiki; default: current wiki
-        * @return Database
+        * @return IMaintainableDatabase
         */
        protected function getDB( $db, $groups = [], $wiki = false ) {
                if ( is_null( $this->mDb ) ) {
         */
        protected function getDB( $db, $groups = [], $wiki = false ) {
                if ( is_null( $this->mDb ) ) {
@@ -1256,7 +1257,7 @@ abstract class Maintenance {
        /**
         * Sets database object to be returned by getDB().
         *
        /**
         * Sets database object to be returned by getDB().
         *
-        * @param IDatabase $db Database object to be used
+        * @param IDatabase $db
         */
        public function setDB( IDatabase $db ) {
                $this->mDb = $db;
         */
        public function setDB( IDatabase $db ) {
                $this->mDb = $db;
@@ -1318,7 +1319,7 @@ abstract class Maintenance {
 
        /**
         * Lock the search index
 
        /**
         * Lock the search index
-        * @param Database &$db
+        * @param IMaintainableDatabase &$db
         */
        private function lockSearchindex( $db ) {
                $write = [ 'searchindex' ];
         */
        private function lockSearchindex( $db ) {
                $write = [ 'searchindex' ];
@@ -1336,7 +1337,7 @@ abstract class Maintenance {
 
        /**
         * Unlock the tables
 
        /**
         * Unlock the tables
-        * @param Database &$db
+        * @param IMaintainableDatabase &$db
         */
        private function unlockSearchindex( $db ) {
                $db->unlockTables( __CLASS__ . '::' . __METHOD__ );
         */
        private function unlockSearchindex( $db ) {
                $db->unlockTables( __CLASS__ . '::' . __METHOD__ );
@@ -1345,7 +1346,7 @@ abstract class Maintenance {
        /**
         * Unlock and lock again
         * Since the lock is low-priority, queued reads will be able to complete
        /**
         * Unlock and lock again
         * Since the lock is low-priority, queued reads will be able to complete
-        * @param Database &$db
+        * @param IMaintainableDatabase &$db
         */
        private function relockSearchindex( $db ) {
                $this->unlockSearchindex( $db );
         */
        private function relockSearchindex( $db ) {
                $this->unlockSearchindex( $db );
@@ -1356,7 +1357,7 @@ abstract class Maintenance {
         * Perform a search index update with locking
         * @param int $maxLockTime The maximum time to keep the search index locked.
         * @param string $callback The function that will update the function.
         * Perform a search index update with locking
         * @param int $maxLockTime The maximum time to keep the search index locked.
         * @param string $callback The function that will update the function.
-        * @param Database $dbw
+        * @param IMaintainableDatabase $dbw
         * @param array $results
         */
        public function updateSearchIndex( $maxLockTime, $callback, $dbw, $results ) {
         * @param array $results
         */
        public function updateSearchIndex( $maxLockTime, $callback, $dbw, $results ) {
@@ -1392,7 +1393,7 @@ abstract class Maintenance {
 
        /**
         * Update the searchindex table for a given pageid
 
        /**
         * Update the searchindex table for a given pageid
-        * @param Database $dbw A database write handle
+        * @param IDatabase $dbw A database write handle
         * @param int $pageId The page ID to update.
         * @return null|string
         */
         * @param int $pageId The page ID to update.
         * @return null|string
         */
index 0beff7c..13362e0 100644 (file)
@@ -23,6 +23,8 @@
 
 require __DIR__ . '/../commandLine.inc';
 
 
 require __DIR__ . '/../commandLine.inc';
 
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
 /**
  * Maintenance script that upgrade for log_id/log_deleted fields in a
  * replication-safe way.
 /**
  * Maintenance script that upgrade for log_id/log_deleted fields in a
  * replication-safe way.
@@ -32,7 +34,7 @@ require __DIR__ . '/../commandLine.inc';
 class UpdateLogging {
 
        /**
 class UpdateLogging {
 
        /**
-        * @var Database
+        * @var IMaintainableDatabase
         */
        public $dbw;
        public $batchSize = 1000;
         */
        public $dbw;
        public $batchSize = 1000;
index 2a8d79a..2369d99 100644 (file)
@@ -23,6 +23,9 @@
 
 require_once __DIR__ . '/Benchmarker.php';
 
 
 require_once __DIR__ . '/Benchmarker.php';
 
+use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
 /**
  * Maintenance script that benchmarks SQL DELETE vs SQL TRUNCATE.
  *
 /**
  * Maintenance script that benchmarks SQL DELETE vs SQL TRUNCATE.
  *
@@ -69,7 +72,7 @@ class BenchmarkDeleteTruncate extends Benchmarker {
        }
 
        /**
        }
 
        /**
-        * @param Database $dbw
+        * @param IDatabase $dbw
         * @return void
         */
        private function insertData( $dbw ) {
         * @return void
         */
        private function insertData( $dbw ) {
@@ -82,7 +85,7 @@ class BenchmarkDeleteTruncate extends Benchmarker {
        }
 
        /**
        }
 
        /**
-        * @param Database $dbw
+        * @param IDatabase $dbw
         * @return void
         */
        private function delete( $dbw ) {
         * @return void
         */
        private function delete( $dbw ) {
@@ -90,7 +93,7 @@ class BenchmarkDeleteTruncate extends Benchmarker {
        }
 
        /**
        }
 
        /**
-        * @param Database $dbw
+        * @param IMaintainableDatabase $dbw
         * @return void
         */
        private function truncate( $dbw ) {
         * @return void
         */
        private function truncate( $dbw ) {
index 70f3654..675d069 100644 (file)
@@ -24,6 +24,7 @@
 require_once __DIR__ . '/Maintenance.php';
 
 use Wikimedia\Rdbms\ResultWrapper;
 require_once __DIR__ . '/Maintenance.php';
 
 use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Maintenance script to convert user options to the new `user_properties` table.
 
 /**
  * Maintenance script to convert user options to the new `user_properties` table.
@@ -76,7 +77,7 @@ class ConvertUserOptions extends Maintenance {
 
        /**
         * @param ResultWrapper $res
 
        /**
         * @param ResultWrapper $res
-        * @param Database $dbw
+        * @param IDatabase $dbw
         * @return null|int
         */
        function convertOptionBatch( $res, $dbw ) {
         * @return null|int
         */
        function convertOptionBatch( $res, $dbw ) {
index df496d4..e99f2b0 100644 (file)
@@ -26,6 +26,8 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Wikimedia\Rdbms\IDatabase;
+
 /**
  * Maintenance script that deletes revisions which refer to a nonexisting page.
  *
 /**
  * Maintenance script that deletes revisions which refer to a nonexisting page.
  *
@@ -83,7 +85,7 @@ class DeleteOrphanedRevisions extends Maintenance {
         * Do this inside a transaction
         *
         * @param array $id Array of revision id values
         * Do this inside a transaction
         *
         * @param array $id Array of revision id values
-        * @param Database $dbw Database class (needs to be a master)
+        * @param IDatabase $dbw Master DB handle
         */
        private function deleteRevs( $id, &$dbw ) {
                if ( !is_array( $id ) ) {
         */
        private function deleteRevs( $id, &$dbw ) {
                if ( !is_array( $id ) ) {
index 0111ac5..3abbdab 100644 (file)
@@ -86,7 +86,6 @@ class DeleteRevision extends Maintenance {
                                );
                                $dbw->delete( 'revision', [ 'rev_id' => $revID ] );
                                if ( $pageLatest == $revID ) {
                                );
                                $dbw->delete( 'revision', [ 'rev_id' => $revID ] );
                                if ( $pageLatest == $revID ) {
-                                       // Database integrity
                                        $newLatest = $dbw->selectField(
                                                'revision',
                                                'rev_id',
                                        $newLatest = $dbw->selectField(
                                                'revision',
                                                'rev_id',
index 9f983c1..6dbad94 100644 (file)
@@ -117,7 +117,7 @@ abstract class DumpIterator extends Maintenance {
        /**
         * Callback function for each revision, child classes should override
         * processRevision instead.
        /**
         * Callback function for each revision, child classes should override
         * processRevision instead.
-        * @param Database $rev
+        * @param WikiRevision $rev
         */
        public function handleRevision( $rev ) {
                $title = $rev->getTitle();
         */
        public function handleRevision( $rev ) {
                $title = $rev->getTitle();
index 5d92eec..581f0d7 100644 (file)
@@ -27,7 +27,7 @@
 require_once __DIR__ . '/backup.inc';
 require_once __DIR__ . '/../includes/export/WikiExporter.php';
 
 require_once __DIR__ . '/backup.inc';
 require_once __DIR__ . '/../includes/export/WikiExporter.php';
 
-use Wikimedia\Rdbms\LoadBalancer;
+use Wikimedia\Rdbms\IMaintainableDatabase;
 
 /**
  * @ingroup Maintenance
 
 /**
  * @ingroup Maintenance
@@ -88,7 +88,7 @@ class TextPassDumper extends BackupDumper {
        protected $checkpointFiles = [];
 
        /**
        protected $checkpointFiles = [];
 
        /**
-        * @var Database
+        * @var IMaintainableDatabase
         */
        protected $db;
 
         */
        protected $db;
 
index 9dee6e5..9c5a375 100644 (file)
@@ -24,6 +24,8 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Wikimedia\Rdbms\IDatabase;
+
 /**
  * Maintenance script used to fetch page text in a subprocess.
  *
 /**
  * Maintenance script used to fetch page text in a subprocess.
  *
@@ -71,7 +73,7 @@ class FetchText extends Maintenance {
 
        /**
         * May throw a database error if, say, the server dies during query.
 
        /**
         * May throw a database error if, say, the server dies during query.
-        * @param Database $db
+        * @param IDatabase $db
         * @param int $id The old_id
         * @return string
         */
         * @param int $id The old_id
         * @return string
         */
index 80e8011..0bd627f 100644 (file)
  * @ingroup Maintenance
  */
 
  * @ingroup Maintenance
  */
 
+require_once __DIR__ . '/Maintenance.php';
+
 use MediaWiki\Linker\LinkTarget;
 use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\ResultWrapper;
 use MediaWiki\Linker\LinkTarget;
 use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\ResultWrapper;
-
-require_once __DIR__ . '/Maintenance.php';
+use Wikimedia\Rdbms\IMaintainableDatabase;
 
 /**
  * Maintenance script that checks for articles to fix after
 
 /**
  * Maintenance script that checks for articles to fix after
@@ -39,7 +40,7 @@ require_once __DIR__ . '/Maintenance.php';
 class NamespaceConflictChecker extends Maintenance {
 
        /**
 class NamespaceConflictChecker extends Maintenance {
 
        /**
-        * @var Database
+        * @var IMaintainableDatabase
         */
        protected $db;
 
         */
        protected $db;
 
index 2da8830..e36c5b6 100644 (file)
@@ -30,6 +30,8 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
 /**
  * Maintenance script that looks for 'orphan' revisions hooked to pages which
  * don't exist and 'childless' pages with no revisions.
 /**
  * Maintenance script that looks for 'orphan' revisions hooked to pages which
  * don't exist and 'childless' pages with no revisions.
@@ -56,7 +58,7 @@ class Orphans extends Maintenance {
 
        /**
         * Lock the appropriate tables for the script
 
        /**
         * Lock the appropriate tables for the script
-        * @param Database $db
+        * @param IMaintainableDatabase $db
         * @param string[] $extraTable The name of any extra tables to lock (eg: text)
         */
        private function lockTables( $db, $extraTable = [] ) {
         * @param string[] $extraTable The name of any extra tables to lock (eg: text)
         */
        private function lockTables( $db, $extraTable = [] ) {
index b41e0e0..7d83180 100644 (file)
 
 require_once __DIR__ . '/Maintenance.php';
 
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Wikimedia\Rdbms\IDatabase;
+
 /**
  * Usage:
  *  populateContentModel.php --ns=1 --table=page
  */
 class PopulateContentModel extends Maintenance {
        protected $wikiId;
 /**
  * Usage:
  *  populateContentModel.php --ns=1 --table=page
  */
 class PopulateContentModel extends Maintenance {
        protected $wikiId;
-
+       /** @var WANObjectCache */
        protected $wanCache;
 
        public function __construct() {
        protected $wanCache;
 
        public function __construct() {
@@ -78,7 +80,7 @@ class PopulateContentModel extends Maintenance {
                $this->wanCache->delete( $revisionKey );
        }
 
                $this->wanCache->delete( $revisionKey );
        }
 
-       private function updatePageRows( Database $dbw, $pageIds, $model ) {
+       private function updatePageRows( IDatabase $dbw, $pageIds, $model ) {
                $count = count( $pageIds );
                $this->output( "Setting $count rows to $model..." );
                $dbw->update(
                $count = count( $pageIds );
                $this->output( "Setting $count rows to $model..." );
                $dbw->update(
@@ -91,7 +93,7 @@ class PopulateContentModel extends Maintenance {
                $this->output( "done.\n" );
        }
 
                $this->output( "done.\n" );
        }
 
-       protected function populatePage( Database $dbw, $ns ) {
+       protected function populatePage( IDatabase $dbw, $ns ) {
                $toSave = [];
                $lastId = 0;
                $nsCondition = $ns === 'all' ? [] : [ 'page_namespace' => $ns ];
                $toSave = [];
                $lastId = 0;
                $nsCondition = $ns === 'all' ? [] : [ 'page_namespace' => $ns ];
@@ -123,7 +125,7 @@ class PopulateContentModel extends Maintenance {
                }
        }
 
                }
        }
 
-       private function updateRevisionOrArchiveRows( Database $dbw, $ids, $model, $table ) {
+       private function updateRevisionOrArchiveRows( IDatabase $dbw, $ids, $model, $table ) {
                $prefix = $table === 'archive' ? 'ar' : 'rev';
                $model_column = "{$prefix}_content_model";
                $format_column = "{$prefix}_content_format";
                $prefix = $table === 'archive' ? 'ar' : 'rev';
                $model_column = "{$prefix}_content_model";
                $format_column = "{$prefix}_content_format";
@@ -142,7 +144,7 @@ class PopulateContentModel extends Maintenance {
                $this->output( "done.\n" );
        }
 
                $this->output( "done.\n" );
        }
 
-       protected function populateRevisionOrArchive( Database $dbw, $table, $ns ) {
+       protected function populateRevisionOrArchive( IDatabase $dbw, $table, $ns ) {
                $prefix = $table === 'archive' ? 'ar' : 'rev';
                $model_column = "{$prefix}_content_model";
                $format_column = "{$prefix}_content_format";
                $prefix = $table === 'archive' ? 'ar' : 'rev';
                $model_column = "{$prefix}_content_model";
                $format_column = "{$prefix}_content_format";
index ac87cf3..5d5da89 100644 (file)
@@ -23,6 +23,8 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Wikimedia\Rdbms\IDatabase;
+
 /**
  * Maintenance script to populate the rc_source field.
  *
 /**
  * Maintenance script to populate the rc_source field.
  *
@@ -83,7 +85,7 @@ class PopulateRecentChangesSource extends LoggedUpdateMaintenance {
                return __CLASS__;
        }
 
                return __CLASS__;
        }
 
-       protected function buildUpdateCondition( Database $dbw ) {
+       protected function buildUpdateCondition( IDatabase $dbw ) {
                $rcNew = $dbw->addQuotes( RC_NEW );
                $rcSrcNew = $dbw->addQuotes( RecentChange::SRC_NEW );
                $rcEdit = $dbw->addQuotes( RC_EDIT );
                $rcNew = $dbw->addQuotes( RC_NEW );
                $rcSrcNew = $dbw->addQuotes( RecentChange::SRC_NEW );
                $rcEdit = $dbw->addQuotes( RC_EDIT );
index 6aa1f37..966864e 100644 (file)
@@ -32,6 +32,8 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
 /**
  * Maintenance script to update image metadata records.
  *
 /**
  * Maintenance script to update image metadata records.
  *
@@ -40,7 +42,7 @@ require_once __DIR__ . '/Maintenance.php';
 class ImageBuilder extends Maintenance {
 
        /**
 class ImageBuilder extends Maintenance {
 
        /**
-        * @var Database
+        * @var IMaintainableDatabase
         */
        protected $dbw;
 
         */
        protected $dbw;
 
index b7f0762..e4bb60e 100644 (file)
@@ -27,6 +27,8 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
 /**
  * Maintenance script that rebuilds search index table from scratch.
  *
 /**
  * Maintenance script that rebuilds search index table from scratch.
  *
@@ -36,7 +38,7 @@ class RebuildTextIndex extends Maintenance {
        const RTI_CHUNK_SIZE = 500;
 
        /**
        const RTI_CHUNK_SIZE = 500;
 
        /**
-        * @var Database
+        * @var IMaintainableDatabase
         */
        private $db;
 
         */
        private $db;
 
index 372c352..b557f3d 100644 (file)
@@ -29,6 +29,9 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
 /**
  * Maintenance script to refresh image metadata fields.
  *
 /**
  * Maintenance script to refresh image metadata fields.
  *
@@ -37,7 +40,7 @@ require_once __DIR__ . '/Maintenance.php';
 class RefreshImageMetadata extends Maintenance {
 
        /**
 class RefreshImageMetadata extends Maintenance {
 
        /**
-        * @var Database
+        * @var IMaintainableDatabase
         */
        protected $dbw;
 
         */
        protected $dbw;
 
@@ -205,7 +208,7 @@ class RefreshImageMetadata extends Maintenance {
        }
 
        /**
        }
 
        /**
-        * @param Database $dbw
+        * @param IDatabase $dbw
         * @return array
         */
        function getConditions( $dbw ) {
         * @return array
         */
        function getConditions( $dbw ) {
index 67f7780..a6cd548 100644 (file)
@@ -390,7 +390,7 @@ class RefreshLinks extends Maintenance {
         * By specifying a null $start or $end, it is also possible to create
         * half-bounded or unbounded intervals using this function.
         *
         * By specifying a null $start or $end, it is also possible to create
         * half-bounded or unbounded intervals using this function.
         *
-        * @param IDatabase $db Database connection
+        * @param IDatabase $db
         * @param string $var Field name
         * @param mixed $start First value to include or null
         * @param mixed $end Last value to include or null
         * @param string $var Field name
         * @param mixed $start First value to include or null
         * @param mixed $end Last value to include or null
index b03620d..70f9aaa 100644 (file)
@@ -77,7 +77,7 @@ class MwSql extends Maintenance {
                        $index = DB_MASTER;
                }
 
                        $index = DB_MASTER;
                }
 
-               /** @var Database $db DB handle for the appropriate cluster/wiki */
+               /** @var IDatabase $db DB handle for the appropriate cluster/wiki */
                $db = $lb->getConnection( $index, [], $wiki );
                if ( $replicaDB != '' && $db->getLBInfo( 'master' ) !== null ) {
                        $this->error( "The server selected ({$db->getServer()}) is not a replica DB.", 1 );
                $db = $lb->getConnection( $index, [], $wiki );
                if ( $replicaDB != '' && $db->getLBInfo( 'master' ) !== null ) {
                        $this->error( "The server selected ({$db->getServer()}) is not a replica DB.", 1 );
index d96cecd..5f705ba 100755 (executable)
@@ -27,6 +27,8 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
 /**
  * Maintenance script to run database schema updates.
  *
 /**
  * Maintenance script to run database schema updates.
  *
@@ -145,7 +147,7 @@ class UpdateMediaWiki extends Maintenance {
 
                $this->output( "Going to run database updates for " . wfWikiID() . "\n" );
                if ( $db->getType() === 'sqlite' ) {
 
                $this->output( "Going to run database updates for " . wfWikiID() . "\n" );
                if ( $db->getType() === 'sqlite' ) {
-                       /** @var Database|DatabaseSqlite $db */
+                       /** @var IMaintainableDatabase|DatabaseSqlite $db */
                        $this->output( "Using SQLite file: '{$db->getDbFilePath()}'\n" );
                }
                $this->output( "Depending on the size of your database this may take a while!\n" );
                        $this->output( "Using SQLite file: '{$db->getDbFilePath()}'\n" );
                }
                $this->output( "Depending on the size of your database this may take a while!\n" );
index e70a176..84fc2d2 100644 (file)
@@ -26,6 +26,8 @@
 
 require_once __DIR__ . '/Maintenance.php';
 
 
 require_once __DIR__ . '/Maintenance.php';
 
+use Wikimedia\Rdbms\IDatabase;
+
 /**
  * Maintenance script that will find all rows in the categorylinks table
  * whose collation is out-of-date.
 /**
  * Maintenance script that will find all rows in the categorylinks table
  * whose collation is out-of-date.
@@ -242,7 +244,7 @@ TEXT
         * Return an SQL expression selecting rows which sort above the given row,
         * assuming an ordering of cl_collation, cl_to, cl_type, cl_from
         * @param stdClass $row
         * Return an SQL expression selecting rows which sort above the given row,
         * assuming an ordering of cl_collation, cl_to, cl_type, cl_from
         * @param stdClass $row
-        * @param Database $dbw
+        * @param IDatabase $dbw
         * @return string
         */
        function getBatchCondition( $row, $dbw ) {
         * @return string
         */
        function getBatchCondition( $row, $dbw ) {