r89430 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89429‎ | r89430 | r89431 >
Date:18:48, 3 June 2011
Author:brion
Status:ok (Comments)
Tags:
Comment:
Provisional revert of r89406, r89414: reference-related warnings need cleanup before applying code like this

Per CR http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89406#c17545 :
'Here is a third one: Strict Standards: Only variables should be passed by reference in /www/sandwiki/includes/Wiki.php on line 177 '

Offending bit is this:
- SpecialPageFactory::executePath( $this->context->title, $this->context );
+ SpecialPageFactory::executePath( $this->getTitle(), $this->getContext() );

That function demands reference paramters for $title and $context, which is being violated here where we now pass function return values:

public static function executePath( Title &$title, RequestContext &$context, $including = false ) {

The $title does sometimes get replaced within the function body, but $context does not appear to ever be replaced (its *contents* are modified, which does not require passing by reference)
If replacing it is something it should be doing, then we need to be able to replace it upstream presumably, so $this->getTitle() probably isn't appropriate.
The $context probably should have the reference simply removed.
Modified paths:
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/RequestContext.php (modified) (history)
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialPageFactory.php (modified) (history)
  • /trunk/phase3/includes/StubObject.php (modified) (history)
  • /trunk/phase3/includes/Wiki.php (modified) (history)
  • /trunk/phase3/index.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialPageFactory.php
@@ -417,10 +417,10 @@
418418 $page = self::getPage( $name );
419419 // Nonexistent?
420420 if ( !$page ) {
421 - $context->getOutput()->setArticleRelated( false );
422 - $context->getOutput()->setRobotPolicy( 'noindex,nofollow' );
423 - $context->getOutput()->setStatusCode( 404 );
424 - $context->getOutput()->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' );
 421+ $context->output->setArticleRelated( false );
 422+ $context->output->setRobotPolicy( 'noindex,nofollow' );
 423+ $context->output->setStatusCode( 404 );
 424+ $context->output->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' );
425425 wfProfileOut( __METHOD__ );
426426 return false;
427427 }
@@ -434,17 +434,17 @@
435435 // the request. Such POST requests are possible for old extensions that
436436 // generate self-links without being aware that their default name has
437437 // changed.
438 - if ( $name != $page->getLocalName() && !$context->getRequest()->wasPosted() ) {
439 - $query = $context->getRequest()->getQueryValues();
 438+ if ( $name != $page->getLocalName() && !$context->request->wasPosted() ) {
 439+ $query = $context->request->getQueryValues();
440440 unset( $query['title'] );
441441 $query = wfArrayToCGI( $query );
442442 $title = $page->getTitle( $par );
443443 $url = $title->getFullUrl( $query );
444 - $context->getOutput()->redirect( $url );
 444+ $context->output->redirect( $url );
445445 wfProfileOut( __METHOD__ );
446446 return $title;
447447 } else {
448 - $context->setTitle( $page->getTitle() );
 448+ $context->title = $page->getTitle();
449449 }
450450
451451 } elseif ( !$page->isIncludable() ) {
Index: trunk/phase3/includes/StubObject.php
@@ -148,6 +148,6 @@
149149 }
150150
151151 function _newObject() {
152 - return RequestContext::getMain()->getLang();
 152+ return RequestContext::getMain()->lang;
153153 }
154154 }
Index: trunk/phase3/includes/RequestContext.php
@@ -9,7 +9,7 @@
1010 * @file
1111 */
1212
13 -class RequestContext implements IContextSource {
 13+class RequestContext {
1414
1515 /**
1616 * @var WebRequest
@@ -242,134 +242,3 @@
243243 }
244244 }
245245
246 -/**
247 - * Interface for objects which can provide a context on request.
248 - */
249 -interface IContextSource {
250 -
251 - /**
252 - * Get the WebRequest object
253 - *
254 - * @return WebRequest
255 - */
256 - public function getRequest();
257 -
258 - /**
259 - * Get the Title object
260 - *
261 - * @return Title
262 - */
263 - public function getTitle();
264 -
265 - /**
266 - * Get the OutputPage object
267 - *
268 - * @return OutputPage object
269 - */
270 - public function getOutput();
271 -
272 - /**
273 - * Get the User object
274 - *
275 - * @return User
276 - */
277 - public function getUser();
278 -
279 - /**
280 - * Get the Language object
281 - *
282 - * @return Language
283 - */
284 - public function getLang();
285 -
286 - /**
287 - * Get the Skin object
288 - *
289 - * @return Skin
290 - */
291 - public function getSkin();
292 -}
293 -
294 -/**
295 - * The simplest way of implementing IContextSource is to hold a RequestContext as a
296 - * member variable and provide accessors to it.
297 - */
298 -abstract class ContextSource implements IContextSource {
299 -
300 - /**
301 - * @var RequestContext
302 - */
303 - private $context;
304 -
305 - /**
306 - * Get the RequestContext object
307 - *
308 - * @return RequestContext
309 - */
310 - public function getContext() {
311 - return $this->context;
312 - }
313 -
314 - /**
315 - * Set the RequestContext object
316 - *
317 - * @param $context RequestContext
318 - */
319 - public function setContext( RequestContext $context ) {
320 - $this->context = $context;
321 - }
322 -
323 - /**
324 - * Get the WebRequest object
325 - *
326 - * @return WebRequest
327 - */
328 - public function getRequest() {
329 - return $this->context->getRequest();
330 - }
331 -
332 - /**
333 - * Get the Title object
334 - *
335 - * @return Title
336 - */
337 - public function getTitle() {
338 - return $this->context->getTitle();
339 - }
340 -
341 - /**
342 - * Get the OutputPage object
343 - *
344 - * @return OutputPage object
345 - */
346 - public function getOutput() {
347 - return $this->context->getOutput();
348 - }
349 -
350 - /**
351 - * Get the User object
352 - *
353 - * @return User
354 - */
355 - public function getUser() {
356 - return $this->context->getUser();
357 - }
358 -
359 - /**
360 - * Get the Language object
361 - *
362 - * @return Language
363 - */
364 - public function getLang() {
365 - return $this->context->getLang();
366 - }
367 -
368 - /**
369 - * Get the Skin object
370 - *
371 - * @return Skin
372 - */
373 - public function getSkin() {
374 - return $this->context->getSkin();
375 - }
376 -}
\ No newline at end of file
Index: trunk/phase3/includes/AutoLoader.php
@@ -47,7 +47,6 @@
4848 'ConfEditor' => 'includes/ConfEditor.php',
4949 'ConfEditorParseError' => 'includes/ConfEditor.php',
5050 'ConfEditorToken' => 'includes/ConfEditor.php',
51 - 'ContextSource' => 'includes/RequestContext.php',
5251 'Cookie' => 'includes/Cookie.php',
5352 'CookieJar' => 'includes/Cookie.php',
5453 'DiffHistoryBlob' => 'includes/HistoryBlob.php',
@@ -116,7 +115,6 @@
117116 'HTMLTextField' => 'includes/HTMLForm.php',
118117 'Http' => 'includes/HttpFunctions.php',
119118 'HttpRequest' => 'includes/HttpFunctions.old.php',
120 - 'IContextSource' => 'includes/RequestContext.php',
121119 'IcuCollation' => 'includes/Collation.php',
122120 'ImageGallery' => 'includes/ImageGallery.php',
123121 'ImageHistoryList' => 'includes/ImagePage.php',
Index: trunk/phase3/includes/Wiki.php
@@ -4,19 +4,25 @@
55 *
66 * @internal documentation reviewed 15 Mar 2010
77 */
8 -class MediaWiki extends ContextSource {
 8+class MediaWiki {
99
 10+ /**
 11+ * TODO: fold $output, etc, into this
 12+ * @var RequestContext
 13+ */
 14+ private $context;
 15+
1016 public function request( WebRequest $x = null ){
11 - return wfSetVar( $this->getRequest(), $x );
 17+ return wfSetVar( $this->context->request, $x );
1218 }
1319
1420 public function output( OutputPage $x = null ){
15 - return wfSetVar( $this->getOutput(), $x );
 21+ return wfSetVar( $this->context->output, $x );
1622 }
1723
1824 public function __construct( RequestContext $context ){
19 - $this->setContext( $context );
20 - $this->getContext()->setTitle( $this->parseTitle() );
 25+ $this->context = $context;
 26+ $this->context->setTitle( $this->parseTitle() );
2127 }
2228
2329 /**
@@ -27,10 +33,10 @@
2834 private function parseTitle() {
2935 global $wgContLang;
3036
31 - $curid = $this->getRequest()->getInt( 'curid' );
32 - $title = $this->getRequest()->getVal( 'title' );
 37+ $curid = $this->context->request->getInt( 'curid' );
 38+ $title = $this->context->request->getVal( 'title' );
3339
34 - if ( $this->getRequest()->getCheck( 'search' ) ) {
 40+ if ( $this->context->request->getCheck( 'search' ) ) {
3541 // Compatibility with old search URLs which didn't use Special:Search
3642 // Just check for presence here, so blank requests still
3743 // show the search page when using ugly URLs (bug 8054).
@@ -51,8 +57,8 @@
5258 // For non-special titles, check for implicit titles
5359 if ( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) {
5460 // We can have urls with just ?diff=,?oldid= or even just ?diff=
55 - $oldid = $this->getRequest()->getInt( 'oldid' );
56 - $oldid = $oldid ? $oldid : $this->getRequest()->getInt( 'diff' );
 61+ $oldid = $this->context->request->getInt( 'oldid' );
 62+ $oldid = $oldid ? $oldid : $this->context->request->getInt( 'diff' );
5763 // Allow oldid to override a changed or missing title
5864 if ( $oldid ) {
5965 $rev = Revision::newFromId( $oldid );
@@ -71,10 +77,10 @@
7278 * @return Title
7379 */
7480 public function getTitle(){
75 - if( $this->getContext()->getTitle() === null ){
76 - $this->getContext()->setTitle( $this->parseTitle() );
 81+ if( $this->context->title === null ){
 82+ $this->context->title = $this->parseTitle();
7783 }
78 - return $this->getContext()->getTitle();
 84+ return $this->context->title;
7985 }
8086
8187 /**
@@ -93,60 +99,60 @@
94100
95101 wfProfileIn( __METHOD__ );
96102
97 - if ( $this->getRequest()->getVal( 'printable' ) === 'yes' ) {
98 - $this->getOutput()->setPrintable();
 103+ if ( $this->context->request->getVal( 'printable' ) === 'yes' ) {
 104+ $this->context->output->setPrintable();
99105 }
100106
101107 wfRunHooks( 'BeforeInitialize', array(
102 - $this->getTitle(),
 108+ &$this->context->title,
103109 null,
104 - $this->getOutput(),
105 - $this->getUser(),
106 - $this->getRequest(),
 110+ &$this->context->output,
 111+ &$this->context->user,
 112+ $this->context->request,
107113 $this
108114 ) );
109115
110116 // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty.
111 - if ( $this->getTitle() instanceof BadTitle ) {
 117+ if ( $this->context->title instanceof BadTitle ) {
112118 throw new ErrorPageError( 'badtitle', 'badtitletext' );
113119 // If the user is not logged in, the Namespace:title of the article must be in
114120 // the Read array in order for the user to see it. (We have to check here to
115121 // catch special pages etc. We check again in Article::view())
116 - } else if ( !$this->getTitle()->userCanRead() ) {
117 - $this->getOutput()->loginToUse();
 122+ } else if ( !$this->context->title->userCanRead() ) {
 123+ $this->context->output->loginToUse();
118124 // Interwiki redirects
119 - } else if ( $this->getTitle()->getInterwiki() != '' ) {
120 - $rdfrom = $this->getRequest()->getVal( 'rdfrom' );
 125+ } else if ( $this->context->title->getInterwiki() != '' ) {
 126+ $rdfrom = $this->context->request->getVal( 'rdfrom' );
121127 if ( $rdfrom ) {
122 - $url = $this->getTitle()->getFullURL( 'rdfrom=' . urlencode( $rdfrom ) );
 128+ $url = $this->context->title->getFullURL( 'rdfrom=' . urlencode( $rdfrom ) );
123129 } else {
124 - $query = $this->getRequest()->getValues();
 130+ $query = $this->context->request->getValues();
125131 unset( $query['title'] );
126 - $url = $this->getTitle()->getFullURL( $query );
 132+ $url = $this->context->title->getFullURL( $query );
127133 }
128134 // Check for a redirect loop
129 - if ( !preg_match( '/^' . preg_quote( $wgServer, '/' ) . '/', $url ) && $this->getTitle()->isLocal() ) {
 135+ if ( !preg_match( '/^' . preg_quote( $wgServer, '/' ) . '/', $url ) && $this->context->title->isLocal() ) {
130136 // 301 so google et al report the target as the actual url.
131 - $this->getOutput()->redirect( $url, 301 );
 137+ $this->context->output->redirect( $url, 301 );
132138 } else {
133 - $this->getContext()->setTitle( new BadTitle );
 139+ $this->context->title = new BadTitle;
134140 wfProfileOut( __METHOD__ );
135141 throw new ErrorPageError( 'badtitle', 'badtitletext' );
136142 }
137143 // Redirect loops, no title in URL, $wgUsePathInfo URLs, and URLs with a variant
138 - } else if ( $this->getRequest()->getVal( 'action', 'view' ) == 'view' && !$this->getRequest()->wasPosted()
139 - && ( $this->getRequest()->getVal( 'title' ) === null || $this->getTitle()->getPrefixedDBKey() != $this->getRequest()->getVal( 'title' ) )
140 - && !count( array_diff( array_keys( $this->getRequest()->getValues() ), array( 'action', 'title' ) ) ) )
 144+ } else if ( $this->context->request->getVal( 'action', 'view' ) == 'view' && !$this->context->request->wasPosted()
 145+ && ( $this->context->request->getVal( 'title' ) === null || $this->context->title->getPrefixedDBKey() != $this->context->request->getVal( 'title' ) )
 146+ && !count( array_diff( array_keys( $this->context->request->getValues() ), array( 'action', 'title' ) ) ) )
141147 {
142 - if ( $this->getTitle()->getNamespace() == NS_SPECIAL ) {
143 - list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $this->getTitle()->getDBkey() );
 148+ if ( $this->context->title->getNamespace() == NS_SPECIAL ) {
 149+ list( $name, $subpage ) = SpecialPageFactory::resolveAlias( $this->context->title->getDBkey() );
144150 if ( $name ) {
145 - $this->getContext()->setTitle( SpecialPage::getTitleFor( $name, $subpage ) );
 151+ $this->context->title = SpecialPage::getTitleFor( $name, $subpage );
146152 }
147153 }
148 - $targetUrl = $this->getTitle()->getFullURL();
 154+ $targetUrl = $this->context->title->getFullURL();
149155 // Redirect to canonical url, make it a 301 to allow caching
150 - if ( $targetUrl == $this->getRequest()->getFullRequestURL() ) {
 156+ if ( $targetUrl == $this->context->request->getFullRequestURL() ) {
151157 $message = "Redirect loop detected!\n\n" .
152158 "This means the wiki got confused about what page was " .
153159 "requested; this sometimes happens when moving a wiki " .
@@ -168,13 +174,13 @@
169175 }
170176 wfHttpError( 500, "Internal error", $message );
171177 } else {
172 - $this->getOutput()->setSquidMaxage( 1200 );
173 - $this->getOutput()->redirect( $targetUrl, '301' );
 178+ $this->context->output->setSquidMaxage( 1200 );
 179+ $this->context->output->redirect( $targetUrl, '301' );
174180 }
175181 // Special pages
176 - } else if ( NS_SPECIAL == $this->getTitle()->getNamespace() ) {
 182+ } else if ( NS_SPECIAL == $this->context->title->getNamespace() ) {
177183 // actions that need to be made when we have a special pages
178 - SpecialPageFactory::executePath( $this->getTitle(), $this->getContext() );
 184+ SpecialPageFactory::executePath( $this->context->title, $this->context );
179185 } else {
180186 // ...otherwise treat it as an article view. The article
181187 // may be a redirect to another article or URL.
@@ -184,7 +190,7 @@
185191 wfProfileOut( __METHOD__ );
186192 return $article;
187193 } elseif ( is_string( $article ) ) {
188 - $this->getOutput()->redirect( $article );
 194+ $this->context->output->redirect( $article );
189195 } else {
190196 wfProfileOut( __METHOD__ );
191197 throw new MWException( "Shouldn't happen: MediaWiki::initializeArticle() returned neither an object nor a URL" );
@@ -215,7 +221,7 @@
216222 public function getAction() {
217223 global $wgDisabledActions;
218224
219 - $action = $this->getRequest()->getVal( 'action', 'view' );
 225+ $action = $this->context->request->getVal( 'action', 'view' );
220226
221227 // Check for disabled actions
222228 if ( in_array( $action, $wgDisabledActions ) ) {
@@ -225,7 +231,7 @@
226232 // Workaround for bug #20966: inability of IE to provide an action dependent
227233 // on which submit button is clicked.
228234 if ( $action === 'historysubmit' ) {
229 - if ( $this->getRequest()->getBool( 'revisiondelete' ) ) {
 235+ if ( $this->context->request->getBool( 'revisiondelete' ) ) {
230236 return 'revisiondelete';
231237 } else {
232238 return 'view';
@@ -248,21 +254,21 @@
249255
250256 wfProfileIn( __METHOD__ );
251257
252 - $action = $this->getRequest()->getVal( 'action', 'view' );
253 - $article = Article::newFromTitle( $this->getTitle(), $this->getContext() );
 258+ $action = $this->context->request->getVal( 'action', 'view' );
 259+ $article = Article::newFromTitle( $this->context->title, $this->context );
254260 // NS_MEDIAWIKI has no redirects.
255261 // It is also used for CSS/JS, so performance matters here...
256 - if ( $this->getTitle()->getNamespace() == NS_MEDIAWIKI ) {
 262+ if ( $this->context->title->getNamespace() == NS_MEDIAWIKI ) {
257263 wfProfileOut( __METHOD__ );
258264 return $article;
259265 }
260266 // Namespace might change when using redirects
261267 // Check for redirects ...
262 - $file = ( $this->getTitle()->getNamespace() == NS_FILE ) ? $article->getFile() : null;
 268+ $file = ( $this->context->title->getNamespace() == NS_FILE ) ? $article->getFile() : null;
263269 if ( ( $action == 'view' || $action == 'render' ) // ... for actions that show content
264 - && !$this->getRequest()->getVal( 'oldid' ) && // ... and are not old revisions
265 - !$this->getRequest()->getVal( 'diff' ) && // ... and not when showing diff
266 - $this->getRequest()->getVal( 'redirect' ) != 'no' && // ... unless explicitly told not to
 270+ && !$this->context->request->getVal( 'oldid' ) && // ... and are not old revisions
 271+ !$this->context->request->getVal( 'diff' ) && // ... and not when showing diff
 272+ $this->context->request->getVal( 'redirect' ) != 'no' && // ... unless explicitly told not to
267273 // ... and the article is not a non-redirect image page with associated file
268274 !( is_object( $file ) && $file->exists() && !$file->getRedirected() ) )
269275 {
@@ -270,7 +276,7 @@
271277 $ignoreRedirect = $target = false;
272278
273279 wfRunHooks( 'InitializeArticleMaybeRedirect',
274 - array( $this->getTitle(), $this->getRequest(), &$ignoreRedirect, &$target, &$article ) );
 280+ array( &$this->context->title, &$this->context->request, &$ignoreRedirect, &$target, &$article ) );
275281
276282 // Follow redirects only for... redirects.
277283 // If $target is set, then a hook wanted to redirect.
@@ -286,16 +292,16 @@
287293 }
288294 if ( is_object( $target ) ) {
289295 // Rewrite environment to redirected article
290 - $rarticle = Article::newFromTitle( $target, $this->getContext() );
 296+ $rarticle = Article::newFromTitle( $target, $this->context );
291297 $rarticle->loadPageData();
292298 if ( $rarticle->exists() || ( is_object( $file ) && !$file->isLocal() ) ) {
293 - $rarticle->setRedirectedFrom( $this->getTitle() );
 299+ $rarticle->setRedirectedFrom( $this->context->title );
294300 $article = $rarticle;
295 - $this->getContext()->setTitle( $target );
 301+ $this->context->title = $target;
296302 }
297303 }
298304 } else {
299 - $this->getContext()->setTitle( $article->getTitle() );
 305+ $this->context->title = $article->getTitle();
300306 }
301307 }
302308 wfProfileOut( __METHOD__ );
@@ -312,7 +318,7 @@
313319 $factory = wfGetLBFactory();
314320 $factory->commitMasterChanges();
315321 // Output everything!
316 - $this->getOutput()->output();
 322+ $this->context->output->output();
317323 // Do any deferred jobs
318324 wfDoUpdates( 'commit' );
319325
@@ -391,8 +397,8 @@
392398 wfProfileIn( __METHOD__ );
393399
394400 if ( !wfRunHooks( 'MediaWikiPerformAction', array(
395 - $this->getOutput(), $article, $this->getTitle(),
396 - $this->getUser(), $this->getRequest(), $this ) ) )
 401+ $this->context->output, $article, $this->context->title,
 402+ $this->context->user, $this->context->request, $this ) ) )
397403 {
398404 wfProfileOut( __METHOD__ );
399405 return;
@@ -409,7 +415,7 @@
410416
411417 switch( $act ) {
412418 case 'view':
413 - $this->getOutput()->setSquidMaxage( $wgSquidMaxage );
 419+ $this->context->output->setSquidMaxage( $wgSquidMaxage );
414420 $article->view();
415421 break;
416422 case 'raw': // includes JS/CSS
@@ -436,25 +442,25 @@
437443 }
438444 // Continue...
439445 case 'edit':
440 - if ( wfRunHooks( 'CustomEditor', array( $article, $this->getUser() ) ) ) {
441 - $internal = $this->getRequest()->getVal( 'internaledit' );
442 - $external = $this->getRequest()->getVal( 'externaledit' );
443 - $section = $this->getRequest()->getVal( 'section' );
444 - $oldid = $this->getRequest()->getVal( 'oldid' );
 446+ if ( wfRunHooks( 'CustomEditor', array( $article, $this->context->user ) ) ) {
 447+ $internal = $this->context->request->getVal( 'internaledit' );
 448+ $external = $this->context->request->getVal( 'externaledit' );
 449+ $section = $this->context->request->getVal( 'section' );
 450+ $oldid = $this->context->request->getVal( 'oldid' );
445451 if ( !$wgUseExternalEditor || $act == 'submit' || $internal ||
446 - $section || $oldid || ( !$this->getUser()->getOption( 'externaleditor' ) && !$external ) ) {
 452+ $section || $oldid || ( !$this->context->user->getOption( 'externaleditor' ) && !$external ) ) {
447453 $editor = new EditPage( $article );
448454 $editor->submit();
449 - } elseif ( $wgUseExternalEditor && ( $external || $this->getUser()->getOption( 'externaleditor' ) ) ) {
450 - $mode = $this->getRequest()->getVal( 'mode' );
 455+ } elseif ( $wgUseExternalEditor && ( $external || $this->context->user->getOption( 'externaleditor' ) ) ) {
 456+ $mode = $this->context->request->getVal( 'mode' );
451457 $extedit = new ExternalEdit( $article, $mode );
452458 $extedit->edit();
453459 }
454460 }
455461 break;
456462 case 'history':
457 - if ( $this->getRequest()->getFullRequestURL() == $this->getTitle()->getInternalURL( 'action=history' ) ) {
458 - $this->getOutput()->setSquidMaxage( $wgSquidMaxage );
 463+ if ( $this->context->request->getFullRequestURL() == $this->context->title->getInternalURL( 'action=history' ) ) {
 464+ $this->context->output->setSquidMaxage( $wgSquidMaxage );
459465 }
460466 $history = new HistoryPage( $article );
461467 $history->history();
@@ -466,7 +472,7 @@
467473 break;
468474 default:
469475 if ( wfRunHooks( 'UnknownAction', array( $act, $article ) ) ) {
470 - $this->getOutput()->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
 476+ $this->context->output->showErrorPage( 'nosuchaction', 'nosuchactiontext' );
471477 }
472478 }
473479 wfProfileOut( __METHOD__ );
Index: trunk/phase3/includes/SpecialPage.php
@@ -839,14 +839,14 @@
840840 // Redirect to a page title with possible query parameters
841841 if ( $redirect instanceof Title ) {
842842 $url = $redirect->getFullUrl( $query );
843 - $this->getOutput()->redirect( $url );
 843+ $this->getContext()->output->redirect( $url );
844844 wfProfileOut( __METHOD__ );
845845 return $redirect;
846846 // Redirect to index.php with query parameters
847847 } elseif ( $redirect === true ) {
848848 global $wgScript;
849849 $url = $wgScript . '?' . wfArrayToCGI( $query );
850 - $this->getOutput()->redirect( $url );
 850+ $this->getContext()->output->redirect( $url );
851851 wfProfileOut( __METHOD__ );
852852 return $redirect;
853853 } else {
Index: trunk/phase3/index.php
@@ -130,14 +130,14 @@
131131 $cache = new HTMLFileCache( $wgTitle, $action );
132132 if ( $cache->isFileCacheGood( /* Assume up to date */ ) ) {
133133 /* Check incoming headers to see if client has this cached */
134 - if ( !$context->getOutput()->checkLastModified( $cache->fileCacheTime() ) ) {
 134+ if ( !$context->output->checkLastModified( $cache->fileCacheTime() ) ) {
135135 $cache->loadFromFileCache();
136136 }
137137 # Do any stats increment/watchlist stuff
138138 $article = Article::newFromTitle( $wgTitle, $context );
139139 $article->viewUpdates();
140140 # Tell OutputPage that output is taken care of
141 - $context->getOutput()->disable();
 141+ $context->output->disable();
142142 wfProfileOut( 'index.php-filecache' );
143143 $mediaWiki->finalCleanup();
144144 wfProfileOut( 'index.php' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r89794Recommit SpecialPage.php and SpecialPageFactory.php parts of r89406 (removal ...ialex20:00, 9 June 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r89406Start unpicking r85288 (magic __get() accessor for RequestContext). Instead,...happy-melon10:54, 3 June 2011
r89414Follow-up r89406 CR: another use of RequestContext::__get()happy-melon14:36, 3 June 2011

Comments

#Comment by Platonides (talk | contribs)   14:07, 18 June 2011

This seems to have been reverted again?

Status & tagging log