$this->setBatchSize( 100 );
}
+ /**
+ * @todo MAKE $wgArticle GO AWAY! This is the absolute LAST use in core
+ */
public function execute() {
global $wgUseFileCache, $wgDisableCounters, $wgContentNamespaces, $wgRequestTime;
- global $wgTitle, $wgArticle, $wgOut, $wgUser;
+ global $wgTitle, $wgArticle, $wgOut;
if ( !$wgUseFileCache ) {
$this->error( "Nothing to do -- \$wgUseFileCache is disabled.", true );
}
foreach ( $res as $row ) {
$rebuilt = false;
$wgRequestTime = wfTime(); # bug 22852
+ $context = new RequestContext;
$wgTitle = Title::makeTitleSafe( $row->page_namespace, $row->page_title );
+ $context->setTitle( $wgTitle );
if ( null == $wgTitle ) {
$this->output( "Page {$row->page_id} has bad title\n" );
continue; // broken title?
}
- $wgOut->setTitle( $wgTitle ); // set display title
- $wgUser->getSkin( $wgTitle ); // set skin title
+ $wgOut = $context->output; // set display title
$wgArticle = new Article( $wgTitle );
// If the article is cacheable, then load it
if ( $wgArticle->isFileCacheable() ) {
@$wgOut->output(); // header notices
$wgUseFileCache = true;
ob_end_clean(); // clear buffer
- $wgOut = new OutputPage(); // empty out any output page garbage
if ( $rebuilt )
$this->output( "Re-cached page {$row->page_id}\n" );
else
}
$blockStart += $this->mBatchSize;
$blockEnd += $this->mBatchSize;
- wfWaitForSlaves( 5 );
+ wfWaitForSlaves();
}
$this->output( "Done!\n" );