Merge "Improve "selfmove" message's wording"
[lhc/web/wiklou.git] / maintenance / backup.inc
index db3af92..f1cd2b9 100644 (file)
@@ -25,7 +25,9 @@
  */
 
 require_once __DIR__ . '/Maintenance.php';
-require_once __DIR__ . '/../includes/export/DumpFilter.php';
+
+use Wikimedia\Rdbms\LoadBalancer;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * @ingroup Dump Maintenance
@@ -60,7 +62,7 @@ class BackupDumper extends Maintenance {
        /**
         * The dependency-injected database to use.
         *
-        * @var DatabaseBase|null
+        * @var IDatabase|null
         *
         * @see self::setDB
         */
@@ -163,7 +165,7 @@ class BackupDumper extends Maintenance {
                                        $val = explode( ':', $param );
 
                                        if ( count( $val ) === 1 ) {
-                                               $this->loadPlugin( $val[0] );
+                                               $this->loadPlugin( $val[0], '' );
                                        } elseif ( count( $val ) === 2 ) {
                                                $this->loadPlugin( $val[0], $val[1] );
                                        } else {
@@ -302,7 +304,7 @@ class BackupDumper extends Maintenance {
 
                $dbr = $this->forcedDb;
                if ( $this->forcedDb === null ) {
-                       $dbr = wfGetDB( DB_SLAVE );
+                       $dbr = wfGetDB( DB_REPLICA );
                }
                $this->maxCount = $dbr->selectField( $table, "MAX($field)", '', __METHOD__ );
                $this->startTime = microtime( true );
@@ -314,7 +316,7 @@ class BackupDumper extends Maintenance {
         * @todo Fixme: the --server parameter is currently not respected, as it
         * doesn't seem terribly easy to ask the load balancer for a particular
         * connection by name.
-        * @return DatabaseBase
+        * @return IDatabase
         */
        function backupDb() {
                if ( $this->forcedDb !== null ) {
@@ -322,7 +324,7 @@ class BackupDumper extends Maintenance {
                }
 
                $this->lb = wfGetLBFactory()->newMainLB();
-               $db = $this->lb->getConnection( DB_SLAVE, 'dump' );
+               $db = $this->lb->getConnection( DB_REPLICA, 'dump' );
 
                // Discourage the server from disconnecting us if it takes a long time
                // to read out the big ol' batch query.
@@ -335,7 +337,7 @@ class BackupDumper extends Maintenance {
         * Force the dump to use the provided database connection for database
         * operations, wherever possible.
         *
-        * @param DatabaseBase|null $db (Optional) the database connection to use. If null, resort to
+        * @param IDatabase|null $db (Optional) the database connection to use. If null, resort to
         *   use the globally provided ways to get database connections.
         */
        function setDB( IDatabase $db = null ) {