X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdumpTextPass.php;h=512910c49b8bb19e3e3c487177f5f7ed1ee4bfdc;hb=2ec769193eec7084c49ed4b4de04fbf023cb5d91;hp=57e09a71aeef0fd40a1a57b9e178fbb2a531ab24;hpb=39f0f919c5708f4c672a8eb7e0891f50bf16883e;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpTextPass.php b/maintenance/dumpTextPass.php index 57e09a71ae..512910c49b 100644 --- a/maintenance/dumpTextPass.php +++ b/maintenance/dumpTextPass.php @@ -24,10 +24,11 @@ * @ingroup Maintenance */ -require_once __DIR__ . '/backup.inc'; +require_once __DIR__ . '/includes/BackupDumper.php'; require_once __DIR__ . '/7zip.inc'; require_once __DIR__ . '/../includes/export/WikiExporter.php'; +use MediaWiki\MediaWikiServices; use Wikimedia\Rdbms\IMaintainableDatabase; /** @@ -99,7 +100,7 @@ class TextPassDumper extends BackupDumper { protected $db; /** - * @param array $args For backward compatibility + * @param array|null $args For backward compatibility */ function __construct( $args = null ) { parent::__construct(); @@ -126,6 +127,7 @@ TEXT 'first pageid written for the first %s (required) and the last pageid written for the ' . 'second %s if it exists.', false, true, false, true ); // This can be specified multiple times $this->addOption( 'quiet', 'Don\'t dump status reports to stderr.' ); + $this->addOption( 'full', 'Dump all revisions of every page' ); $this->addOption( 'current', 'Base ETA on number of pages in database instead of all revisions' ); $this->addOption( 'spawn', 'Spawn a subprocess for loading text records' ); $this->addOption( 'buffersize', 'Buffer size in bytes to use for reading the stub. ' . @@ -218,7 +220,8 @@ TEXT // individually retrying at different layers of code. try { - $this->lb = wfGetLBFactory()->newMainLB(); + $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); + $this->lb = $lbFactory->newMainLB(); } catch ( Exception $e ) { throw new MWException( __METHOD__ . " rotating DB failed to obtain new load balancer (" . $e->getMessage() . ")" ); @@ -703,7 +706,6 @@ TEXT * @throws MWException */ private function getTextDb( $id ) { - global $wgContLang; if ( !isset( $this->db ) ) { throw new MWException( __METHOD__ . "No database available" ); } @@ -716,7 +718,8 @@ TEXT return false; } $stripped = str_replace( "\r", "", $text ); - $normalized = $wgContLang->normalize( $stripped ); + $normalized = MediaWikiServices::getInstance()->getContentLanguage()-> + normalize( $stripped ); return $normalized; } @@ -795,8 +798,6 @@ TEXT } private function getTextSpawnedOnce( $id ) { - global $wgContLang; - $ok = fwrite( $this->spawnWrite, "$id\n" ); // $this->progress( ">> $id" ); if ( !$ok ) { @@ -851,7 +852,8 @@ TEXT // Do normalization in the dump thread... $stripped = str_replace( "\r", "", $text ); - $normalized = $wgContLang->normalize( $stripped ); + $normalized = MediaWikiServices::getInstance()->getContentLanguage()-> + normalize( $stripped ); return $normalized; }