Index: trunk/phase3/maintenance/rebuildFileCache.php |
— | — | @@ -86,16 +86,21 @@ |
87 | 87 | $dbw->begin(); // for any changes |
88 | 88 | foreach ( $res as $row ) { |
89 | 89 | $rebuilt = false; |
90 | | - $wgRequestTime = wfTime(); # bug 22852 |
91 | | - $context = new RequestContext; |
| 90 | + $wgRequestTime = microtime( true ); # bug 22852 |
| 91 | + |
92 | 92 | $wgTitle = Title::makeTitleSafe( $row->page_namespace, $row->page_title ); |
93 | | - $context->setTitle( $wgTitle ); |
94 | 93 | if ( null == $wgTitle ) { |
95 | 94 | $this->output( "Page {$row->page_id} has bad title\n" ); |
96 | 95 | continue; // broken title? |
97 | 96 | } |
| 97 | + |
| 98 | + $context = new RequestContext; |
| 99 | + $context->setTitle( $wgTitle ); |
| 100 | + $article = Article::newFromTitle( $wgTitle, $context ); |
| 101 | + $context->setWikiPage( $article->getPage() ); |
| 102 | + |
98 | 103 | $wgOut = $context->getOutput(); // set display title |
99 | | - $article = new Article( $wgTitle ); |
| 104 | + |
100 | 105 | // If the article is cacheable, then load it |
101 | 106 | if ( $article->isFileCacheable() ) { |
102 | 107 | $cache = HTMLFileCache::newFromTitle( $wgTitle, 'view' ); |