X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fbackup.inc;h=0fdd417fc392fe6b7560ce9054e8b852389e4790;hb=a5ea73070652d807afb780a5bd9c6614b5e5a872;hp=341a2992ff5ac02b25af58aba0530937b8271284;hpb=d75c150177fbc2c5a818ee6735d41596bb631a8a;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/backup.inc b/maintenance/backup.inc index 341a2992ff..0fdd417fc3 100644 --- a/maintenance/backup.inc +++ b/maintenance/backup.inc @@ -25,8 +25,8 @@ */ require_once __DIR__ . '/Maintenance.php'; -require_once __DIR__ . '/../includes/export/DumpFilter.php'; +use MediaWiki\MediaWikiServices; use Wikimedia\Rdbms\LoadBalancer; use Wikimedia\Rdbms\IDatabase; @@ -83,15 +83,15 @@ class BackupDumper extends Maintenance { $this->stderr = fopen( "php://stderr", "wt" ); // Built-in output and filter plugins - $this->registerOutput( 'file', 'DumpFileOutput' ); - $this->registerOutput( 'gzip', 'DumpGZipOutput' ); - $this->registerOutput( 'bzip2', 'DumpBZip2Output' ); - $this->registerOutput( 'dbzip2', 'DumpDBZip2Output' ); - $this->registerOutput( '7zip', 'Dump7ZipOutput' ); + $this->registerOutput( 'file', DumpFileOutput::class ); + $this->registerOutput( 'gzip', DumpGZipOutput::class ); + $this->registerOutput( 'bzip2', DumpBZip2Output::class ); + $this->registerOutput( 'dbzip2', DumpDBZip2Output::class ); + $this->registerOutput( '7zip', Dump7ZipOutput::class ); - $this->registerFilter( 'latest', 'DumpLatestFilter' ); - $this->registerFilter( 'notalk', 'DumpNotalkFilter' ); - $this->registerFilter( 'namespace', 'DumpNamespaceFilter' ); + $this->registerFilter( 'latest', DumpLatestFilter::class ); + $this->registerFilter( 'notalk', DumpNotalkFilter::class ); + $this->registerFilter( 'namespace', DumpNamespaceFilter::class ); // These three can be specified multiple times $this->addOption( 'plugin', 'Load a dump plugin class. Specify as [:].', @@ -324,7 +324,8 @@ class BackupDumper extends Maintenance { return $this->forcedDb; } - $this->lb = wfGetLBFactory()->newMainLB(); + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + $this->lb = $lbFactory->newMainLB(); $db = $this->lb->getConnection( DB_REPLICA, 'dump' ); // Discourage the server from disconnecting us if it takes a long time @@ -420,20 +421,3 @@ class BackupDumper extends Maintenance { } } } - -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(); - } -}