*/
require_once __DIR__ . '/Maintenance.php';
-require_once __DIR__ . '/../includes/export/DumpFilter.php';
+
+use Wikimedia\Rdbms\LoadBalancer;
+use Wikimedia\Rdbms\IDatabase;
/**
* @ingroup Dump Maintenance
/**
* The dependency-injected database to use.
*
- * @var DatabaseBase|null
+ * @var IDatabase|null
*
* @see self::setDB
*/
$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 {
* @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 ) {
* 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 ) {
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();
- }
}