X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FfixDefaultJsonContentPages.php;h=460b553455e2f0ee37135870d04e8bf7b1dce787;hb=22ac82f4cd7960735339d23865fce21665ea9c17;hp=232151b8787c4101b2256d98e6775159d68d36ba;hpb=58cb1f824ac75c3b58ba19d1e88c1b38f9dc1fab;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/fixDefaultJsonContentPages.php b/maintenance/fixDefaultJsonContentPages.php index 232151b878..d3d76acf49 100644 --- a/maintenance/fixDefaultJsonContentPages.php +++ b/maintenance/fixDefaultJsonContentPages.php @@ -21,6 +21,8 @@ * @ingroup Maintenance */ +use MediaWiki\Revision\RevisionRecord; + require_once __DIR__ . '/Maintenance.php'; /** @@ -47,7 +49,7 @@ class FixDefaultJsonContentPages extends LoggedUpdateMaintenance { return true; } - $dbr = $this->getDB( DB_SLAVE ); + $dbr = $this->getDB( DB_REPLICA ); $namespaces = [ NS_MEDIAWIKI => $dbr->buildLike( $dbr->anyString(), '.json' ), NS_USER => $dbr->buildLike( $dbr->anyString(), '/', $dbr->anyString(), '.json' ), @@ -64,12 +66,12 @@ class FixDefaultJsonContentPages extends LoggedUpdateMaintenance { 'page_id > ' . $dbr->addQuotes( $lastPage ) ], __METHOD__, - [ 'ORDER BY' => 'page_id', 'LIMIT' => $this->mBatchSize ] + [ 'ORDER BY' => 'page_id', 'LIMIT' => $this->getBatchSize() ] ); foreach ( $rows as $row ) { $this->handleRow( $row ); } - } while ( $rows->numRows() >= $this->mBatchSize ); + } while ( $rows->numRows() >= $this->getBatchSize() ); } return true; @@ -79,7 +81,7 @@ class FixDefaultJsonContentPages extends LoggedUpdateMaintenance { $title = Title::makeTitle( $row->page_namespace, $row->page_title ); $this->output( "Processing {$title} ({$row->page_id})...\n" ); $rev = Revision::newFromTitle( $title ); - $content = $rev->getContent( Revision::RAW ); + $content = $rev->getContent( RevisionRecord::RAW ); $dbw = $this->getDB( DB_MASTER ); if ( $content instanceof JsonContent ) { if ( $content->isValid() ) { @@ -124,5 +126,5 @@ class FixDefaultJsonContentPages extends LoggedUpdateMaintenance { } } -$maintClass = 'FixDefaultJsonContentPages'; +$maintClass = FixDefaultJsonContentPages::class; require_once RUN_MAINTENANCE_IF_MAIN;