Index: trunk/phase3/includes/SpecialPageFactory.php |
— | — | @@ -409,12 +409,12 @@ |
410 | 410 | * page, and true if it was successful. |
411 | 411 | * |
412 | 412 | * @param $title Title object |
413 | | - * @param $context RequestContext |
| 413 | + * @param $context IContextSource |
414 | 414 | * @param $including Bool output is being captured for use in {{special:whatever}} |
415 | 415 | * |
416 | 416 | * @return bool |
417 | 417 | */ |
418 | | - public static function executePath( Title &$title, RequestContext &$context, $including = false ) { |
| 418 | + public static function executePath( Title &$title, IContextSource &$context, $including = false ) { |
419 | 419 | wfProfileIn( __METHOD__ ); |
420 | 420 | |
421 | 421 | // @todo FIXME: Redirects broken due to this call |
— | — | @@ -485,11 +485,11 @@ |
486 | 486 | * normal request, and then restores them to their previous values after. |
487 | 487 | * |
488 | 488 | * @param $title Title |
489 | | - * @param $context RequestContext |
| 489 | + * @param $context IContextSource |
490 | 490 | * |
491 | 491 | * @return String: HTML fragment |
492 | 492 | */ |
493 | | - static function capturePath( Title $title, RequestContext $context ) { |
| 493 | + static function capturePath( Title $title, IContextSource $context ) { |
494 | 494 | global $wgOut, $wgTitle, $wgRequest, $wgUser, $wgLang; |
495 | 495 | |
496 | 496 | // Save current globals |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | */ |
25 | 25 | |
26 | 26 | /** |
27 | | - * @var RequestContext |
| 27 | + * @var IContextSource |
28 | 28 | */ |
29 | 29 | protected $mContext; |
30 | 30 | |
— | — | @@ -88,10 +88,10 @@ |
89 | 89 | * Create an Article object of the appropriate class for the given page. |
90 | 90 | * |
91 | 91 | * @param $title Title |
92 | | - * @param $context RequestContext |
| 92 | + * @param $context IContextSource |
93 | 93 | * @return Article object |
94 | 94 | */ |
95 | | - public static function newFromTitle( $title, RequestContext $context ) { |
| 95 | + public static function newFromTitle( $title, IContextSource $context ) { |
96 | 96 | if ( NS_MEDIA == $title->getNamespace() ) { |
97 | 97 | // FIXME: where should this go? |
98 | 98 | $title = Title::makeTitle( NS_FILE, $title->getDBkey() ); |
— | — | @@ -1856,7 +1856,7 @@ |
1857 | 1857 | /** |
1858 | 1858 | * Sets the context this Article is executed in |
1859 | 1859 | * |
1860 | | - * @param $context RequestContext |
| 1860 | + * @param $context IContextSource |
1861 | 1861 | * @since 1.18 |
1862 | 1862 | */ |
1863 | 1863 | public function setContext( $context ) { |
— | — | @@ -1866,11 +1866,11 @@ |
1867 | 1867 | /** |
1868 | 1868 | * Gets the context this Article is executed in |
1869 | 1869 | * |
1870 | | - * @return RequestContext |
| 1870 | + * @return IContextSource |
1871 | 1871 | * @since 1.18 |
1872 | 1872 | */ |
1873 | 1873 | public function getContext() { |
1874 | | - if ( $this->mContext instanceof RequestContext ) { |
| 1874 | + if ( $this->mContext instanceof IContextSource ) { |
1875 | 1875 | return $this->mContext; |
1876 | 1876 | } else { |
1877 | 1877 | wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" ); |
Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -102,7 +102,7 @@ |
103 | 103 | protected $mSubmitText; |
104 | 104 | protected $mSubmitTooltip; |
105 | 105 | |
106 | | - protected $mContext; // <! RequestContext |
| 106 | + protected $mContext; // <! IContextSource |
107 | 107 | protected $mTitle; |
108 | 108 | protected $mMethod = 'post'; |
109 | 109 | |
— | — | @@ -115,12 +115,12 @@ |
116 | 116 | /** |
117 | 117 | * Build a new HTMLForm from an array of field attributes |
118 | 118 | * @param $descriptor Array of Field constructs, as described above |
119 | | - * @param $context RequestContext available since 1.18, will become compulsory in 1.18. |
| 119 | + * @param $context IContextSource available since 1.18, will become compulsory in 1.18. |
120 | 120 | * Obviates the need to call $form->setTitle() |
121 | 121 | * @param $messagePrefix String a prefix to go in front of default messages |
122 | 122 | */ |
123 | | - public function __construct( $descriptor, /*RequestContext*/ $context = null, $messagePrefix = '' ) { |
124 | | - if( $context instanceof RequestContext ){ |
| 123 | + public function __construct( $descriptor, /*IContextSource*/ $context = null, $messagePrefix = '' ) { |
| 124 | + if( $context instanceof IContextSource ){ |
125 | 125 | $this->mContext = $context; |
126 | 126 | $this->mTitle = false; // We don't need them to set a title |
127 | 127 | $this->mMessagePrefix = $messagePrefix; |
— | — | @@ -638,10 +638,10 @@ |
639 | 639 | } |
640 | 640 | |
641 | 641 | /** |
642 | | - * @return RequestContext |
| 642 | + * @return IContextSource |
643 | 643 | */ |
644 | 644 | public function getContext(){ |
645 | | - return $this->mContext instanceof RequestContext |
| 645 | + return $this->mContext instanceof IContextSource |
646 | 646 | ? $this->mContext |
647 | 647 | : RequestContext::getMain(); |
648 | 648 | } |
Index: trunk/phase3/includes/revisiondelete/RevisionDeleteAbstracts.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | * to wrap bulk update operations. |
9 | 9 | */ |
10 | 10 | abstract class RevDel_List extends RevisionListBase { |
11 | | - function __construct( RequestContext $context, Title $title, array $ids ) { |
| 11 | + function __construct( IContextSource $context, Title $title, array $ids ) { |
12 | 12 | parent::__construct( $context, $title ); |
13 | 13 | $this->ids = $ids; |
14 | 14 | } |
Index: trunk/phase3/includes/RequestContext.php |
— | — | @@ -353,14 +353,14 @@ |
354 | 354 | abstract class ContextSource implements IContextSource { |
355 | 355 | |
356 | 356 | /** |
357 | | - * @var RequestContext |
| 357 | + * @var IContextSource |
358 | 358 | */ |
359 | 359 | private $context; |
360 | 360 | |
361 | 361 | /** |
362 | | - * Get the RequestContext object |
| 362 | + * Get the IContextSource object |
363 | 363 | * |
364 | | - * @return RequestContext |
| 364 | + * @return IContextSource |
365 | 365 | */ |
366 | 366 | public function getContext() { |
367 | 367 | if ( $this->context === null ) { |
— | — | @@ -372,11 +372,11 @@ |
373 | 373 | } |
374 | 374 | |
375 | 375 | /** |
376 | | - * Set the RequestContext object |
| 376 | + * Set the IContextSource object |
377 | 377 | * |
378 | | - * @param $context RequestContext |
| 378 | + * @param $context IContextSource |
379 | 379 | */ |
380 | | - public function setContext( RequestContext $context ) { |
| 380 | + public function setContext( IContextSource $context ) { |
381 | 381 | $this->context = $context; |
382 | 382 | } |
383 | 383 | |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -223,7 +223,7 @@ |
224 | 224 | * Instead a new RequestContext should be created and it will implicitly create |
225 | 225 | * a OutputPage tied to that context. |
226 | 226 | */ |
227 | | - function __construct( RequestContext $context = null ) { |
| 227 | + function __construct( IContextSource $context = null ) { |
228 | 228 | if ( $context === null ) { |
229 | 229 | # Extensions should use `new RequestContext` instead of `new OutputPage` now. |
230 | 230 | wfDeprecated( __METHOD__ ); |
Index: trunk/phase3/includes/logging/LogFormatter.php |
— | — | @@ -78,9 +78,9 @@ |
79 | 79 | |
80 | 80 | /** |
81 | 81 | * Replace the default context |
82 | | - * @param $context RequestContext |
| 82 | + * @param $context IContextSource |
83 | 83 | */ |
84 | | - public function setContext( RequestContext $context ) { |
| 84 | + public function setContext( IContextSource $context ) { |
85 | 85 | $this->context = $context; |
86 | 86 | } |
87 | 87 | |
Index: trunk/phase3/includes/Wiki.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | |
31 | 31 | /** |
32 | 32 | * TODO: fold $output, etc, into this |
33 | | - * @var RequestContext |
| 33 | + * @var IContextSource |
34 | 34 | */ |
35 | 35 | private $context; |
36 | 36 | |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | return $old; |
47 | 47 | } |
48 | 48 | |
49 | | - public function __construct( RequestContext $context = null ) { |
| 49 | + public function __construct( IContextSource $context = null ) { |
50 | 50 | if ( !$context ) { |
51 | 51 | $context = RequestContext::getMain(); |
52 | 52 | } |
— | — | @@ -256,10 +256,10 @@ |
257 | 257 | * |
258 | 258 | * @deprecated in 1.18; use Article::newFromTitle() instead |
259 | 259 | * @param $title Title |
260 | | - * @param $context RequestContext |
| 260 | + * @param $context IContextSource |
261 | 261 | * @return Article object |
262 | 262 | */ |
263 | | - public static function articleFromTitle( $title, RequestContext $context ) { |
| 263 | + public static function articleFromTitle( $title, IContextSource $context ) { |
264 | 264 | return Article::newFromTitle( $title, $context ); |
265 | 265 | } |
266 | 266 | |
Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -45,10 +45,10 @@ |
46 | 46 | /** |
47 | 47 | * Changeslist contructor |
48 | 48 | * |
49 | | - * @param $obj Skin or RequestContext |
| 49 | + * @param $obj Skin or IContextSource |
50 | 50 | */ |
51 | 51 | public function __construct( $obj ) { |
52 | | - if ( $obj instanceof RequestContext ) { |
| 52 | + if ( $obj instanceof IContextSource ) { |
53 | 53 | $this->setContext( $obj ); |
54 | 54 | $this->skin = $obj->getSkin(); |
55 | 55 | } else { |
— | — | @@ -74,10 +74,10 @@ |
75 | 75 | * Fetch an appropriate changes list class for the specified context |
76 | 76 | * Some users might want to use an enhanced list format, for instance |
77 | 77 | * |
78 | | - * @param $context RequestContext to use |
| 78 | + * @param $context IContextSource to use |
79 | 79 | * @return ChangesList|EnhancedChangesList|OldChangesList derivative |
80 | 80 | */ |
81 | | - public static function newFromContext( RequestContext $context ) { |
| 81 | + public static function newFromContext( IContextSource $context ) { |
82 | 82 | $user = $context->getUser(); |
83 | 83 | $sk = $context->getSkin(); |
84 | 84 | $list = null; |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -758,7 +758,7 @@ |
759 | 759 | |
760 | 760 | protected $mMaxFileSize = array(); |
761 | 761 | |
762 | | - public function __construct( array $options = array(), RequestContext $context = null ) { |
| 762 | + public function __construct( array $options = array(), IContextSource $context = null ) { |
763 | 763 | $this->mWatch = !empty( $options['watch'] ); |
764 | 764 | $this->mForReUpload = !empty( $options['forreupload'] ); |
765 | 765 | $this->mSessionKey = isset( $options['sessionkey'] ) |
Index: trunk/phase3/includes/RevisionList.php |
— | — | @@ -8,7 +8,7 @@ |
9 | 9 | */ |
10 | 10 | var $title; |
11 | 11 | /** |
12 | | - * @var RequestContext |
| 12 | + * @var IContextSource |
13 | 13 | */ |
14 | 14 | var $context; |
15 | 15 | |
— | — | @@ -16,10 +16,10 @@ |
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Construct a revision list for a given title |
20 | | - * @param $context RequestContext |
| 20 | + * @param $context IContextSource |
21 | 21 | * @param $title Title |
22 | 22 | */ |
23 | | - function __construct( RequestContext $context, Title $title ) { |
| 23 | + function __construct( IContextSource $context, Title $title ) { |
24 | 24 | $this->context = $context; |
25 | 25 | $this->title = $title; |
26 | 26 | } |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -1212,11 +1212,11 @@ |
1213 | 1213 | |
1214 | 1214 | /** |
1215 | 1215 | * @param $user User |
1216 | | - * @param $context RequestContext |
| 1216 | + * @param $context IContextSource |
1217 | 1217 | * @param $formClass string |
1218 | 1218 | * @return HtmlForm |
1219 | 1219 | */ |
1220 | | - static function getFormObject( $user, RequestContext $context, $formClass = 'PreferencesForm' ) { |
| 1220 | + static function getFormObject( $user, IContextSource $context, $formClass = 'PreferencesForm' ) { |
1221 | 1221 | $formDescriptor = Preferences::getPreferences( $user ); |
1222 | 1222 | $htmlForm = new $formClass( $formDescriptor, $context, 'prefs' ); |
1223 | 1223 | |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | |
59 | 59 | /** |
60 | 60 | * Current request context |
61 | | - * @var RequestContext |
| 61 | + * @var IContextSource |
62 | 62 | */ |
63 | 63 | protected $mContext; |
64 | 64 | |
— | — | @@ -226,12 +226,12 @@ |
227 | 227 | * page, and true if it was successful. |
228 | 228 | * |
229 | 229 | * @param $title Title object |
230 | | - * @param $context RequestContext |
| 230 | + * @param $context IContextSource |
231 | 231 | * @param $including Bool output is being captured for use in {{special:whatever}} |
232 | 232 | * @return Bool |
233 | 233 | * @deprecated since 1.18 call SpecialPageFactory method directly |
234 | 234 | */ |
235 | | - public static function executePath( &$title, RequestContext &$context, $including = false ) { |
| 235 | + public static function executePath( &$title, IContextSource &$context, $including = false ) { |
236 | 236 | return SpecialPageFactory::executePath( $title, $context, $including ); |
237 | 237 | } |
238 | 238 | |
— | — | @@ -592,7 +592,7 @@ |
593 | 593 | /** |
594 | 594 | * Sets the context this SpecialPage is executed in |
595 | 595 | * |
596 | | - * @param $context RequestContext |
| 596 | + * @param $context IContextSource |
597 | 597 | * @since 1.18 |
598 | 598 | */ |
599 | 599 | public function setContext( $context ) { |
— | — | @@ -602,11 +602,11 @@ |
603 | 603 | /** |
604 | 604 | * Gets the context this SpecialPage is executed in |
605 | 605 | * |
606 | | - * @return RequestContext |
| 606 | + * @return IContextSource |
607 | 607 | * @since 1.18 |
608 | 608 | */ |
609 | 609 | public function getContext() { |
610 | | - if ( $this->mContext instanceof RequestContext ) { |
| 610 | + if ( $this->mContext instanceof IContextSource ) { |
611 | 611 | return $this->mContext; |
612 | 612 | } else { |
613 | 613 | wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" ); |
Index: trunk/phase3/includes/Action.php |
— | — | @@ -32,8 +32,8 @@ |
33 | 33 | protected $page; |
34 | 34 | |
35 | 35 | /** |
36 | | - * RequestContext if specified; otherwise we'll use the Context from the Page |
37 | | - * @var RequestContext |
| 36 | + * IContextSource if specified; otherwise we'll use the Context from the Page |
| 37 | + * @var IContextSource |
38 | 38 | */ |
39 | 39 | protected $context; |
40 | 40 | |
— | — | @@ -96,11 +96,11 @@ |
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
100 | | - * Get the RequestContext in use here |
101 | | - * @return RequestContext |
| 100 | + * Get the IContextSource in use here |
| 101 | + * @return IContextSource |
102 | 102 | */ |
103 | 103 | protected final function getContext() { |
104 | | - if ( $this->context instanceof RequestContext ) { |
| 104 | + if ( $this->context instanceof IContextSource ) { |
105 | 105 | return $this->context; |
106 | 106 | } |
107 | 107 | return $this->page->getContext(); |