Index: trunk/phase3/includes/SpecialPageFactory.php |
— | — | @@ -417,10 +417,10 @@ |
418 | 418 | $page = self::getPage( $name ); |
419 | 419 | // Nonexistent? |
420 | 420 | 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' ); |
425 | 425 | wfProfileOut( __METHOD__ ); |
426 | 426 | return false; |
427 | 427 | } |
— | — | @@ -434,17 +434,17 @@ |
435 | 435 | // the request. Such POST requests are possible for old extensions that |
436 | 436 | // generate self-links without being aware that their default name has |
437 | 437 | // 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(); |
440 | 440 | unset( $query['title'] ); |
441 | 441 | $query = wfArrayToCGI( $query ); |
442 | 442 | $title = $page->getTitle( $par ); |
443 | 443 | $url = $title->getFullUrl( $query ); |
444 | | - $context->getOutput()->redirect( $url ); |
| 444 | + $context->output->redirect( $url ); |
445 | 445 | wfProfileOut( __METHOD__ ); |
446 | 446 | return $title; |
447 | 447 | } else { |
448 | | - $context->setTitle( $page->getTitle() ); |
| 448 | + $context->title = $page->getTitle(); |
449 | 449 | } |
450 | 450 | |
451 | 451 | } elseif ( !$page->isIncludable() ) { |
Index: trunk/phase3/includes/StubObject.php |
— | — | @@ -148,6 +148,6 @@ |
149 | 149 | } |
150 | 150 | |
151 | 151 | function _newObject() { |
152 | | - return RequestContext::getMain()->getLang(); |
| 152 | + return RequestContext::getMain()->lang; |
153 | 153 | } |
154 | 154 | } |
Index: trunk/phase3/includes/RequestContext.php |
— | — | @@ -9,7 +9,7 @@ |
10 | 10 | * @file |
11 | 11 | */ |
12 | 12 | |
13 | | -class RequestContext implements IContextSource { |
| 13 | +class RequestContext { |
14 | 14 | |
15 | 15 | /** |
16 | 16 | * @var WebRequest |
— | — | @@ -242,134 +242,3 @@ |
243 | 243 | } |
244 | 244 | } |
245 | 245 | |
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 @@ |
48 | 48 | 'ConfEditor' => 'includes/ConfEditor.php', |
49 | 49 | 'ConfEditorParseError' => 'includes/ConfEditor.php', |
50 | 50 | 'ConfEditorToken' => 'includes/ConfEditor.php', |
51 | | - 'ContextSource' => 'includes/RequestContext.php', |
52 | 51 | 'Cookie' => 'includes/Cookie.php', |
53 | 52 | 'CookieJar' => 'includes/Cookie.php', |
54 | 53 | 'DiffHistoryBlob' => 'includes/HistoryBlob.php', |
— | — | @@ -116,7 +115,6 @@ |
117 | 116 | 'HTMLTextField' => 'includes/HTMLForm.php', |
118 | 117 | 'Http' => 'includes/HttpFunctions.php', |
119 | 118 | 'HttpRequest' => 'includes/HttpFunctions.old.php', |
120 | | - 'IContextSource' => 'includes/RequestContext.php', |
121 | 119 | 'IcuCollation' => 'includes/Collation.php', |
122 | 120 | 'ImageGallery' => 'includes/ImageGallery.php', |
123 | 121 | 'ImageHistoryList' => 'includes/ImagePage.php', |
Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -4,19 +4,25 @@ |
5 | 5 | * |
6 | 6 | * @internal documentation reviewed 15 Mar 2010 |
7 | 7 | */ |
8 | | -class MediaWiki extends ContextSource { |
| 8 | +class MediaWiki { |
9 | 9 | |
| 10 | + /** |
| 11 | + * TODO: fold $output, etc, into this |
| 12 | + * @var RequestContext |
| 13 | + */ |
| 14 | + private $context; |
| 15 | + |
10 | 16 | public function request( WebRequest $x = null ){ |
11 | | - return wfSetVar( $this->getRequest(), $x ); |
| 17 | + return wfSetVar( $this->context->request, $x ); |
12 | 18 | } |
13 | 19 | |
14 | 20 | public function output( OutputPage $x = null ){ |
15 | | - return wfSetVar( $this->getOutput(), $x ); |
| 21 | + return wfSetVar( $this->context->output, $x ); |
16 | 22 | } |
17 | 23 | |
18 | 24 | 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() ); |
21 | 27 | } |
22 | 28 | |
23 | 29 | /** |
— | — | @@ -27,10 +33,10 @@ |
28 | 34 | private function parseTitle() { |
29 | 35 | global $wgContLang; |
30 | 36 | |
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' ); |
33 | 39 | |
34 | | - if ( $this->getRequest()->getCheck( 'search' ) ) { |
| 40 | + if ( $this->context->request->getCheck( 'search' ) ) { |
35 | 41 | // Compatibility with old search URLs which didn't use Special:Search |
36 | 42 | // Just check for presence here, so blank requests still |
37 | 43 | // show the search page when using ugly URLs (bug 8054). |
— | — | @@ -51,8 +57,8 @@ |
52 | 58 | // For non-special titles, check for implicit titles |
53 | 59 | if ( is_null( $ret ) || $ret->getNamespace() != NS_SPECIAL ) { |
54 | 60 | // 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' ); |
57 | 63 | // Allow oldid to override a changed or missing title |
58 | 64 | if ( $oldid ) { |
59 | 65 | $rev = Revision::newFromId( $oldid ); |
— | — | @@ -71,10 +77,10 @@ |
72 | 78 | * @return Title |
73 | 79 | */ |
74 | 80 | 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(); |
77 | 83 | } |
78 | | - return $this->getContext()->getTitle(); |
| 84 | + return $this->context->title; |
79 | 85 | } |
80 | 86 | |
81 | 87 | /** |
— | — | @@ -93,60 +99,60 @@ |
94 | 100 | |
95 | 101 | wfProfileIn( __METHOD__ ); |
96 | 102 | |
97 | | - if ( $this->getRequest()->getVal( 'printable' ) === 'yes' ) { |
98 | | - $this->getOutput()->setPrintable(); |
| 103 | + if ( $this->context->request->getVal( 'printable' ) === 'yes' ) { |
| 104 | + $this->context->output->setPrintable(); |
99 | 105 | } |
100 | 106 | |
101 | 107 | wfRunHooks( 'BeforeInitialize', array( |
102 | | - $this->getTitle(), |
| 108 | + &$this->context->title, |
103 | 109 | null, |
104 | | - $this->getOutput(), |
105 | | - $this->getUser(), |
106 | | - $this->getRequest(), |
| 110 | + &$this->context->output, |
| 111 | + &$this->context->user, |
| 112 | + $this->context->request, |
107 | 113 | $this |
108 | 114 | ) ); |
109 | 115 | |
110 | 116 | // 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 ) { |
112 | 118 | throw new ErrorPageError( 'badtitle', 'badtitletext' ); |
113 | 119 | // If the user is not logged in, the Namespace:title of the article must be in |
114 | 120 | // the Read array in order for the user to see it. (We have to check here to |
115 | 121 | // 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(); |
118 | 124 | // 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' ); |
121 | 127 | if ( $rdfrom ) { |
122 | | - $url = $this->getTitle()->getFullURL( 'rdfrom=' . urlencode( $rdfrom ) ); |
| 128 | + $url = $this->context->title->getFullURL( 'rdfrom=' . urlencode( $rdfrom ) ); |
123 | 129 | } else { |
124 | | - $query = $this->getRequest()->getValues(); |
| 130 | + $query = $this->context->request->getValues(); |
125 | 131 | unset( $query['title'] ); |
126 | | - $url = $this->getTitle()->getFullURL( $query ); |
| 132 | + $url = $this->context->title->getFullURL( $query ); |
127 | 133 | } |
128 | 134 | // 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() ) { |
130 | 136 | // 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 ); |
132 | 138 | } else { |
133 | | - $this->getContext()->setTitle( new BadTitle ); |
| 139 | + $this->context->title = new BadTitle; |
134 | 140 | wfProfileOut( __METHOD__ ); |
135 | 141 | throw new ErrorPageError( 'badtitle', 'badtitletext' ); |
136 | 142 | } |
137 | 143 | // 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' ) ) ) ) |
141 | 147 | { |
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() ); |
144 | 150 | if ( $name ) { |
145 | | - $this->getContext()->setTitle( SpecialPage::getTitleFor( $name, $subpage ) ); |
| 151 | + $this->context->title = SpecialPage::getTitleFor( $name, $subpage ); |
146 | 152 | } |
147 | 153 | } |
148 | | - $targetUrl = $this->getTitle()->getFullURL(); |
| 154 | + $targetUrl = $this->context->title->getFullURL(); |
149 | 155 | // Redirect to canonical url, make it a 301 to allow caching |
150 | | - if ( $targetUrl == $this->getRequest()->getFullRequestURL() ) { |
| 156 | + if ( $targetUrl == $this->context->request->getFullRequestURL() ) { |
151 | 157 | $message = "Redirect loop detected!\n\n" . |
152 | 158 | "This means the wiki got confused about what page was " . |
153 | 159 | "requested; this sometimes happens when moving a wiki " . |
— | — | @@ -168,13 +174,13 @@ |
169 | 175 | } |
170 | 176 | wfHttpError( 500, "Internal error", $message ); |
171 | 177 | } 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' ); |
174 | 180 | } |
175 | 181 | // Special pages |
176 | | - } else if ( NS_SPECIAL == $this->getTitle()->getNamespace() ) { |
| 182 | + } else if ( NS_SPECIAL == $this->context->title->getNamespace() ) { |
177 | 183 | // 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 ); |
179 | 185 | } else { |
180 | 186 | // ...otherwise treat it as an article view. The article |
181 | 187 | // may be a redirect to another article or URL. |
— | — | @@ -184,7 +190,7 @@ |
185 | 191 | wfProfileOut( __METHOD__ ); |
186 | 192 | return $article; |
187 | 193 | } elseif ( is_string( $article ) ) { |
188 | | - $this->getOutput()->redirect( $article ); |
| 194 | + $this->context->output->redirect( $article ); |
189 | 195 | } else { |
190 | 196 | wfProfileOut( __METHOD__ ); |
191 | 197 | throw new MWException( "Shouldn't happen: MediaWiki::initializeArticle() returned neither an object nor a URL" ); |
— | — | @@ -215,7 +221,7 @@ |
216 | 222 | public function getAction() { |
217 | 223 | global $wgDisabledActions; |
218 | 224 | |
219 | | - $action = $this->getRequest()->getVal( 'action', 'view' ); |
| 225 | + $action = $this->context->request->getVal( 'action', 'view' ); |
220 | 226 | |
221 | 227 | // Check for disabled actions |
222 | 228 | if ( in_array( $action, $wgDisabledActions ) ) { |
— | — | @@ -225,7 +231,7 @@ |
226 | 232 | // Workaround for bug #20966: inability of IE to provide an action dependent |
227 | 233 | // on which submit button is clicked. |
228 | 234 | if ( $action === 'historysubmit' ) { |
229 | | - if ( $this->getRequest()->getBool( 'revisiondelete' ) ) { |
| 235 | + if ( $this->context->request->getBool( 'revisiondelete' ) ) { |
230 | 236 | return 'revisiondelete'; |
231 | 237 | } else { |
232 | 238 | return 'view'; |
— | — | @@ -248,21 +254,21 @@ |
249 | 255 | |
250 | 256 | wfProfileIn( __METHOD__ ); |
251 | 257 | |
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 ); |
254 | 260 | // NS_MEDIAWIKI has no redirects. |
255 | 261 | // 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 ) { |
257 | 263 | wfProfileOut( __METHOD__ ); |
258 | 264 | return $article; |
259 | 265 | } |
260 | 266 | // Namespace might change when using redirects |
261 | 267 | // Check for redirects ... |
262 | | - $file = ( $this->getTitle()->getNamespace() == NS_FILE ) ? $article->getFile() : null; |
| 268 | + $file = ( $this->context->title->getNamespace() == NS_FILE ) ? $article->getFile() : null; |
263 | 269 | 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 |
267 | 273 | // ... and the article is not a non-redirect image page with associated file |
268 | 274 | !( is_object( $file ) && $file->exists() && !$file->getRedirected() ) ) |
269 | 275 | { |
— | — | @@ -270,7 +276,7 @@ |
271 | 277 | $ignoreRedirect = $target = false; |
272 | 278 | |
273 | 279 | wfRunHooks( 'InitializeArticleMaybeRedirect', |
274 | | - array( $this->getTitle(), $this->getRequest(), &$ignoreRedirect, &$target, &$article ) ); |
| 280 | + array( &$this->context->title, &$this->context->request, &$ignoreRedirect, &$target, &$article ) ); |
275 | 281 | |
276 | 282 | // Follow redirects only for... redirects. |
277 | 283 | // If $target is set, then a hook wanted to redirect. |
— | — | @@ -286,16 +292,16 @@ |
287 | 293 | } |
288 | 294 | if ( is_object( $target ) ) { |
289 | 295 | // Rewrite environment to redirected article |
290 | | - $rarticle = Article::newFromTitle( $target, $this->getContext() ); |
| 296 | + $rarticle = Article::newFromTitle( $target, $this->context ); |
291 | 297 | $rarticle->loadPageData(); |
292 | 298 | if ( $rarticle->exists() || ( is_object( $file ) && !$file->isLocal() ) ) { |
293 | | - $rarticle->setRedirectedFrom( $this->getTitle() ); |
| 299 | + $rarticle->setRedirectedFrom( $this->context->title ); |
294 | 300 | $article = $rarticle; |
295 | | - $this->getContext()->setTitle( $target ); |
| 301 | + $this->context->title = $target; |
296 | 302 | } |
297 | 303 | } |
298 | 304 | } else { |
299 | | - $this->getContext()->setTitle( $article->getTitle() ); |
| 305 | + $this->context->title = $article->getTitle(); |
300 | 306 | } |
301 | 307 | } |
302 | 308 | wfProfileOut( __METHOD__ ); |
— | — | @@ -312,7 +318,7 @@ |
313 | 319 | $factory = wfGetLBFactory(); |
314 | 320 | $factory->commitMasterChanges(); |
315 | 321 | // Output everything! |
316 | | - $this->getOutput()->output(); |
| 322 | + $this->context->output->output(); |
317 | 323 | // Do any deferred jobs |
318 | 324 | wfDoUpdates( 'commit' ); |
319 | 325 | |
— | — | @@ -391,8 +397,8 @@ |
392 | 398 | wfProfileIn( __METHOD__ ); |
393 | 399 | |
394 | 400 | 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 ) ) ) |
397 | 403 | { |
398 | 404 | wfProfileOut( __METHOD__ ); |
399 | 405 | return; |
— | — | @@ -409,7 +415,7 @@ |
410 | 416 | |
411 | 417 | switch( $act ) { |
412 | 418 | case 'view': |
413 | | - $this->getOutput()->setSquidMaxage( $wgSquidMaxage ); |
| 419 | + $this->context->output->setSquidMaxage( $wgSquidMaxage ); |
414 | 420 | $article->view(); |
415 | 421 | break; |
416 | 422 | case 'raw': // includes JS/CSS |
— | — | @@ -436,25 +442,25 @@ |
437 | 443 | } |
438 | 444 | // Continue... |
439 | 445 | 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' ); |
445 | 451 | if ( !$wgUseExternalEditor || $act == 'submit' || $internal || |
446 | | - $section || $oldid || ( !$this->getUser()->getOption( 'externaleditor' ) && !$external ) ) { |
| 452 | + $section || $oldid || ( !$this->context->user->getOption( 'externaleditor' ) && !$external ) ) { |
447 | 453 | $editor = new EditPage( $article ); |
448 | 454 | $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' ); |
451 | 457 | $extedit = new ExternalEdit( $article, $mode ); |
452 | 458 | $extedit->edit(); |
453 | 459 | } |
454 | 460 | } |
455 | 461 | break; |
456 | 462 | 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 ); |
459 | 465 | } |
460 | 466 | $history = new HistoryPage( $article ); |
461 | 467 | $history->history(); |
— | — | @@ -466,7 +472,7 @@ |
467 | 473 | break; |
468 | 474 | default: |
469 | 475 | if ( wfRunHooks( 'UnknownAction', array( $act, $article ) ) ) { |
470 | | - $this->getOutput()->showErrorPage( 'nosuchaction', 'nosuchactiontext' ); |
| 476 | + $this->context->output->showErrorPage( 'nosuchaction', 'nosuchactiontext' ); |
471 | 477 | } |
472 | 478 | } |
473 | 479 | wfProfileOut( __METHOD__ ); |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -839,14 +839,14 @@ |
840 | 840 | // Redirect to a page title with possible query parameters |
841 | 841 | if ( $redirect instanceof Title ) { |
842 | 842 | $url = $redirect->getFullUrl( $query ); |
843 | | - $this->getOutput()->redirect( $url ); |
| 843 | + $this->getContext()->output->redirect( $url ); |
844 | 844 | wfProfileOut( __METHOD__ ); |
845 | 845 | return $redirect; |
846 | 846 | // Redirect to index.php with query parameters |
847 | 847 | } elseif ( $redirect === true ) { |
848 | 848 | global $wgScript; |
849 | 849 | $url = $wgScript . '?' . wfArrayToCGI( $query ); |
850 | | - $this->getOutput()->redirect( $url ); |
| 850 | + $this->getContext()->output->redirect( $url ); |
851 | 851 | wfProfileOut( __METHOD__ ); |
852 | 852 | return $redirect; |
853 | 853 | } else { |
Index: trunk/phase3/index.php |
— | — | @@ -130,14 +130,14 @@ |
131 | 131 | $cache = new HTMLFileCache( $wgTitle, $action ); |
132 | 132 | if ( $cache->isFileCacheGood( /* Assume up to date */ ) ) { |
133 | 133 | /* Check incoming headers to see if client has this cached */ |
134 | | - if ( !$context->getOutput()->checkLastModified( $cache->fileCacheTime() ) ) { |
| 134 | + if ( !$context->output->checkLastModified( $cache->fileCacheTime() ) ) { |
135 | 135 | $cache->loadFromFileCache(); |
136 | 136 | } |
137 | 137 | # Do any stats increment/watchlist stuff |
138 | 138 | $article = Article::newFromTitle( $wgTitle, $context ); |
139 | 139 | $article->viewUpdates(); |
140 | 140 | # Tell OutputPage that output is taken care of |
141 | | - $context->getOutput()->disable(); |
| 141 | + $context->output->disable(); |
142 | 142 | wfProfileOut( 'index.php-filecache' ); |
143 | 143 | $mediaWiki->finalCleanup(); |
144 | 144 | wfProfileOut( 'index.php' ); |