class CompareParserCache extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "Parse random pages and compare output to cache.";
+ $this->addDescription( 'Parse random pages and compare output to cache.' );
$this->addOption( 'namespace', 'Page namespace number', true, true );
$this->addOption( 'maxpages', 'Number of pages to try', true, true );
}
$this->output( "Found cache entry found for '{$title->getPrefixedText()}'..." );
$oldHtml = trim( preg_replace( '#<!-- .+-->#Us', '', $parserOutputOld->getText() ) );
- $newHtml = trim( preg_replace( '#<!-- .+-->#Us', '',$parserOutputNew->getText() ) );
+ $newHtml = trim( preg_replace( '#<!-- .+-->#Us', '', $parserOutputNew->getText() ) );
$diff = wfDiff( $oldHtml, $newHtml );
if ( strlen( $diff ) ) {
$this->output( "differences found:\n\n$diff\n\n" );