X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcompareParserCache.php;h=245b6131a666dacdb6fa6bcdb93b9058c8f46c30;hb=c292cfd90f1b9f2939b6bc1e19e15700a87a037c;hp=93fe6601e9ff51c757a8cc4872dbe4024e3cda05;hpb=d434013a98e7dd517067f5ca9c263b1d4d8bd6ee;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/compareParserCache.php b/maintenance/compareParserCache.php index 93fe6601e9..245b6131a6 100644 --- a/maintenance/compareParserCache.php +++ b/maintenance/compareParserCache.php @@ -27,7 +27,7 @@ require_once __DIR__ . '/Maintenance.php'; 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 ); } @@ -43,15 +43,15 @@ class CompareParserCache extends Maintenance { $withdiff = 0; while ( $pages-- > 0 ) { $row = $dbr->selectRow( 'page', '*', - array( + [ 'page_namespace' => $this->getOption( 'namespace' ), 'page_is_redirect' => 0, 'page_random >= ' . wfRandom() - ), + ], __METHOD__, - array( + [ 'ORDER BY' => 'page_random', - ) + ] ); if ( !$row ) { @@ -79,7 +79,7 @@ class CompareParserCache extends Maintenance { $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" );