Index: trunk/phase3/maintenance/rebuildFileCache.php |
— | — | @@ -72,12 +72,14 @@ |
73 | 73 | foreach ( $res as $row ) { |
74 | 74 | $rebuilt = false; |
75 | 75 | $wgRequestTime = wfTime(); # bug 22852 |
| 76 | + $context = new RequestContext; |
76 | 77 | $wgTitle = Title::makeTitleSafe( $row->page_namespace, $row->page_title ); |
| 78 | + $context->setTitle( $wgTitle ); |
77 | 79 | if ( null == $wgTitle ) { |
78 | 80 | $this->output( "Page {$row->page_id} has bad title\n" ); |
79 | 81 | continue; // broken title? |
80 | 82 | } |
81 | | - $wgOut->setTitle( $wgTitle ); // set display title |
| 83 | + $wgOut = $context->output; // set display title |
82 | 84 | $wgUser->getSkin( $wgTitle ); // set skin title |
83 | 85 | $wgArticle = new Article( $wgTitle ); |
84 | 86 | // If the article is cacheable, then load it |
— | — | @@ -97,7 +99,6 @@ |
98 | 100 | @$wgOut->output(); // header notices |
99 | 101 | $wgUseFileCache = true; |
100 | 102 | ob_end_clean(); // clear buffer |
101 | | - $wgOut = new OutputPage(); // empty out any output page garbage |
102 | 103 | if ( $rebuilt ) |
103 | 104 | $this->output( "Re-cached page {$row->page_id}\n" ); |
104 | 105 | else |
Index: trunk/phase3/tests/phpunit/includes/parser/NewParserTest.php |
— | — | @@ -295,11 +295,11 @@ |
296 | 296 | $GLOBALS[$var] = $val; |
297 | 297 | } |
298 | 298 | |
299 | | - $langObj = Language::factory( $lang ); |
300 | | - $GLOBALS['wgLang'] = $langObj; |
301 | | - $GLOBALS['wgContLang'] = $langObj; |
| 299 | + $context = new RequestContext(); |
| 300 | + $GLOBALS['wgLang'] = $context->lang; |
| 301 | + $GLOBALS['wgContLang'] = $context->lang; |
302 | 302 | $GLOBALS['wgMemc'] = new EmptyBagOStuff; |
303 | | - $GLOBALS['wgOut'] = new OutputPage; |
| 303 | + $GLOBALS['wgOut'] = new $context->output; |
304 | 304 | |
305 | 305 | global $wgHooks; |
306 | 306 | |
Index: trunk/phase3/tests/parser/parserTest.inc |
— | — | @@ -680,11 +680,11 @@ |
681 | 681 | $GLOBALS[$var] = $val; |
682 | 682 | } |
683 | 683 | |
684 | | - $langObj = Language::factory( $lang ); |
685 | | - $GLOBALS['wgLang'] = $langObj; |
686 | | - $GLOBALS['wgContLang'] = $langObj; |
| 684 | + $context = new RequestContext(); |
| 685 | + $GLOBALS['wgLang'] = $context->lang; |
| 686 | + $GLOBALS['wgContLang'] = $context->lang; |
687 | 687 | $GLOBALS['wgMemc'] = new EmptyBagOStuff; |
688 | | - $GLOBALS['wgOut'] = new OutputPage; |
| 688 | + $GLOBALS['wgOut'] = new $context->output; |
689 | 689 | |
690 | 690 | global $wgHooks; |
691 | 691 | |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -221,6 +221,7 @@ |
222 | 222 | */ |
223 | 223 | function __construct( RequestContext $context = null ) { |
224 | 224 | if ( !isset($context) ) { |
| 225 | +var_dump('foo'); |
225 | 226 | # Extensions should use `new RequestContext` instead of `new OutputPage` now. |
226 | 227 | wfDeprecated( __METHOD__ ); |
227 | 228 | } |
Index: trunk/phase3/includes/api/ApiParse.php |
— | — | @@ -251,25 +251,23 @@ |
252 | 252 | } |
253 | 253 | |
254 | 254 | if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) { |
255 | | - $out = new OutputPage; |
256 | | - $out->setUser( $wgUser ); |
257 | | - $out->addParserOutputNoText( $p_result ); |
258 | | - $userSkin = $wgUser->getSkin(); |
| 255 | + $context = new RequestContext; |
| 256 | + $context->output->addParserOutputNoText( $p_result ); |
259 | 257 | |
260 | 258 | if ( isset( $prop['headitems'] ) ) { |
261 | 259 | $headItems = $this->formatHeadItems( $p_result->getHeadItems() ); |
262 | 260 | |
263 | | - $userSkin->setupUserCss( $out ); |
264 | | - $css = $this->formatCss( $out->buildCssLinksArray() ); |
| 261 | + $context->skin->setupUserCss( $context->output ); |
| 262 | + $css = $this->formatCss( $context->output->buildCssLinksArray() ); |
265 | 263 | |
266 | | - $scripts = array( $out->getHeadScripts( $userSkin ) ); |
| 264 | + $scripts = array( $context->output->getHeadScripts( $context->skin ) ); |
267 | 265 | |
268 | 266 | $result_array['headitems'] = array_merge( $headItems, $css, $scripts ); |
269 | 267 | } |
270 | 268 | |
271 | 269 | if ( isset( $prop['headhtml'] ) ) { |
272 | 270 | $result_array['headhtml'] = array(); |
273 | | - $result->setContent( $result_array['headhtml'], $out->headElement( $userSkin ) ); |
| 271 | + $result->setContent( $result_array['headhtml'], $context->output->headElement( $context->skin ) ); |
274 | 272 | } |
275 | 273 | } |
276 | 274 | |