Merge "Add tags for undo edits"
[lhc/web/wiklou.git] / maintenance / backup.inc
index 38daf64..00dbd00 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 {
@@ -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 ) {
@@ -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 ) {
@@ -416,25 +418,4 @@ class BackupDumper extends Maintenance {
                        fwrite( $this->stderr, $string . "\n" );
                }
        }
-
-       function fatalError( $msg ) {
-               $this->error( "$msg\n", 1 );
-       }
-}
-
-class ExportProgressFilter extends DumpFilter {
-       function __construct( &$sink, &$progress ) {
-               parent::__construct( $sink );
-               $this->progress = $progress;
-       }
-
-       function writeClosePage( $string ) {
-               parent::writeClosePage( $string );
-               $this->progress->reportPage();
-       }
-
-       function writeRevision( $rev, $string ) {
-               parent::writeRevision( $rev, $string );
-               $this->progress->revCount();
-       }
 }