}
public function finalSetup() {
- global $wgDebugToolbar, $wgUseFileCache, $wgReadOnly;
+ global $wgDebugToolbar, $wgUseFileCache;
$this->enabled = $wgUseFileCache;
// Script will handle capturing output and saving it itself
// 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();
}
$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__ );
MediaWiki\suppressWarnings(); // header notices
// Cache ?action=view
- $wgRequestTime = microtime( true ); # bug 22852
+ $wgRequestTime = microtime( true ); # T24852
ob_start();
$article->view();
$context->getOutput()->output();
$viewHtml = ob_get_clean();
$viewCache->saveToFileCache( $viewHtml );
// Cache ?action=history
- $wgRequestTime = microtime( true ); # bug 22852
+ $wgRequestTime = microtime( true ); # T24852
ob_start();
Action::factory( 'history', $article, $context )->show();
$context->getOutput()->output();