X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrebuildFileCache.php;h=fe3944c8764dce534ba854c8aede865800e3b996;hb=ffba23d177d5eee876bdc59cdf1b945281b18041;hp=3520279fc338e898a9b6cda0b134534f8f81a346;hpb=944b93ee740d491ec6353f3fa5a439db41de97b8;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/rebuildFileCache.php b/maintenance/rebuildFileCache.php index 3520279fc3..fe3944c876 100644 --- a/maintenance/rebuildFileCache.php +++ b/maintenance/rebuildFileCache.php @@ -41,7 +41,7 @@ class RebuildFileCache extends Maintenance { } public function finalSetup() { - global $wgDebugToolbar, $wgUseFileCache, $wgReadOnly; + global $wgDebugToolbar, $wgUseFileCache; $this->enabled = $wgUseFileCache; // Script will handle capturing output and saving it itself @@ -50,7 +50,8 @@ class RebuildFileCache extends Maintenance { // Has to be done before Setup.php initialize MWDebug $wgDebugToolbar = false; // Avoid DB writes (like enotif/counters) - $wgReadOnly = 'Building cache'; // avoid DB writes (like enotif/counters) + MediaWiki\MediaWikiServices::getInstance()->getReadOnlyMode() + ->setReason( 'Building cache' ); parent::finalSetup(); } @@ -77,7 +78,7 @@ class RebuildFileCache extends Maintenance { $this->output( "Building content page file cache from page {$start}!\n" ); $dbr = $this->getDB( DB_REPLICA ); - $overwrite = $this->getOption( 'overwrite', false ); + $overwrite = $this->hasOption( 'overwrite' ); $start = ( $start > 0 ) ? $start : $dbr->selectField( 'page', 'MIN(page_id)', false, __METHOD__ );