X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdumpTextPass.php;h=e1df1f1a1661c18be0d5a51a9c8812313b30279e;hb=cd789d78b8073fa04983ad284e8e7cebe4296e6e;hp=57e09a71aeef0fd40a1a57b9e178fbb2a531ab24;hpb=51e40a712f2f2eb57216b26a16c91d14f74d5cf2;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpTextPass.php b/maintenance/dumpTextPass.php index 57e09a71ae..e1df1f1a16 100644 --- a/maintenance/dumpTextPass.php +++ b/maintenance/dumpTextPass.php @@ -28,6 +28,7 @@ require_once __DIR__ . '/backup.inc'; 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(); @@ -218,7 +219,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 +705,6 @@ TEXT * @throws MWException */ private function getTextDb( $id ) { - global $wgContLang; if ( !isset( $this->db ) ) { throw new MWException( __METHOD__ . "No database available" ); } @@ -716,7 +717,8 @@ TEXT return false; } $stripped = str_replace( "\r", "", $text ); - $normalized = $wgContLang->normalize( $stripped ); + $normalized = MediaWikiServices::getInstance()->getContentLanguage()-> + normalize( $stripped ); return $normalized; } @@ -795,8 +797,6 @@ TEXT } private function getTextSpawnedOnce( $id ) { - global $wgContLang; - $ok = fwrite( $this->spawnWrite, "$id\n" ); // $this->progress( ">> $id" ); if ( !$ok ) { @@ -851,7 +851,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; }