X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcompareParsers.php;h=0d4b7b1c70f2fa218058207f7a2bfc7ea4efe221;hb=e3537bdc00244cefdaa34710be0fb0d920336ed8;hp=f2540c7afa5609f2d5f3d802860889b866698b79;hpb=4dc3ac1c375b3d2eb6172dfef8fdebe71b8c5f43;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/compareParsers.php b/maintenance/compareParsers.php index f2540c7afa..0d4b7b1c70 100644 --- a/maintenance/compareParsers.php +++ b/maintenance/compareParsers.php @@ -39,6 +39,18 @@ require_once __DIR__ . '/dumpIterator.php'; class CompareParsers extends DumpIterator { private $count = 0; + /** @var bool */ + private $saveFailed; + /** @var bool */ + private $stripParametersEnabled; + /** @var bool */ + private $showParsedOutput; + /** @var bool */ + private $showDiff; + /** @var ParserOptions */ + private $options; + /** @var int */ + private $failed; public function __construct() { parent::__construct(); @@ -95,9 +107,8 @@ class CompareParsers extends DumpIterator { $this->options = ParserOptions::newFromUser( $user ); if ( $this->hasOption( 'tidy' ) ) { - global $wgUseTidy; - if ( !$wgUseTidy ) { - $this->error( 'Tidy was requested but $wgUseTidy is not set in LocalSettings.php', true ); + if ( !MWTidy::isEnabled() ) { + $this->fatalError( 'Tidy was requested but $wgTidyConfig is not set in LocalSettings.php' ); } $this->options->setTidy( true ); } @@ -145,7 +156,9 @@ class CompareParsers extends DumpIterator { return; } - $text = strval( $content->getNativeData() ); + /** @var WikitextContent $content */ + '@phan-var WikitextContent $content'; + $text = strval( $content->getText() ); $output1 = $parser1->parse( $text, $title, $this->options ); $output2 = $parser2->parse( $text, $title, $this->options ); @@ -185,5 +198,5 @@ class CompareParsers extends DumpIterator { } } -$maintClass = "CompareParsers"; +$maintClass = CompareParsers::class; require_once RUN_MAINTENANCE_IF_MAIN;