r97283 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97282‎ | r97283 | r97284 >
Date:15:01, 16 September 2011
Author:reedy
Status:ok
Tags:
Comment:
REL1_18 MFT r97159 where appropriate
Modified paths:
  • /branches/REL1_18/phase3/includes/Action.php (modified) (history)
  • /branches/REL1_18/phase3/includes/Article.php (modified) (history)
  • /branches/REL1_18/phase3/includes/ChangesList.php (modified) (history)
  • /branches/REL1_18/phase3/includes/HTMLForm.php (modified) (history)
  • /branches/REL1_18/phase3/includes/OutputPage.php (modified) (history)
  • /branches/REL1_18/phase3/includes/RequestContext.php (modified) (history)
  • /branches/REL1_18/phase3/includes/RevisionList.php (modified) (history)
  • /branches/REL1_18/phase3/includes/SpecialPage.php (modified) (history)
  • /branches/REL1_18/phase3/includes/SpecialPageFactory.php (modified) (history)
  • /branches/REL1_18/phase3/includes/Wiki.php (modified) (history)
  • /branches/REL1_18/phase3/includes/revisiondelete/RevisionDeleteAbstracts.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/includes/SpecialPageFactory.php
@@ -398,12 +398,12 @@
399399 * page, and true if it was successful.
400400 *
401401 * @param $title Title object
402 - * @param $context RequestContext
 402+ * @param $context IContextSource
403403 * @param $including Bool output is being captured for use in {{special:whatever}}
404404 *
405405 * @return bool
406406 */
407 - public static function executePath( Title &$title, RequestContext &$context, $including = false ) {
 407+ public static function executePath( Title &$title, IContextSource &$context, $including = false ) {
408408 wfProfileIn( __METHOD__ );
409409
410410 // @todo FIXME: Redirects broken due to this call
Property changes on: branches/REL1_18/phase3/includes/SpecialPageFactory.php
___________________________________________________________________
Modified: svn:mergeinfo
411411 Merged /trunk/phase3/includes/SpecialPageFactory.php:r97159
Index: branches/REL1_18/phase3/includes/Article.php
@@ -23,7 +23,7 @@
2424 */
2525
2626 /**
27 - * @var RequestContext
 27+ * @var IContextSource
2828 */
2929 protected $mContext;
3030
@@ -88,10 +88,10 @@
8989 * Create an Article object of the appropriate class for the given page.
9090 *
9191 * @param $title Title
92 - * @param $context RequestContext
 92+ * @param $context IContextSource
9393 * @return Article object
9494 */
95 - public static function newFromTitle( $title, RequestContext $context ) {
 95+ public static function newFromTitle( $title, IContextSource $context ) {
9696 if ( NS_MEDIA == $title->getNamespace() ) {
9797 // FIXME: where should this go?
9898 $title = Title::makeTitle( NS_FILE, $title->getDBkey() );
@@ -1852,7 +1852,7 @@
18531853 /**
18541854 * Sets the context this Article is executed in
18551855 *
1856 - * @param $context RequestContext
 1856+ * @param $context IContextSource
18571857 * @since 1.18
18581858 */
18591859 public function setContext( $context ) {
@@ -1862,11 +1862,11 @@
18631863 /**
18641864 * Gets the context this Article is executed in
18651865 *
1866 - * @return RequestContext
 1866+ * @return IContextSource
18671867 * @since 1.18
18681868 */
18691869 public function getContext() {
1870 - if ( $this->mContext instanceof RequestContext ) {
 1870+ if ( $this->mContext instanceof IContextSource ) {
18711871 return $this->mContext;
18721872 } else {
18731873 wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" );
Index: branches/REL1_18/phase3/includes/HTMLForm.php
@@ -102,7 +102,7 @@
103103 protected $mSubmitText;
104104 protected $mSubmitTooltip;
105105
106 - protected $mContext; // <! RequestContext
 106+ protected $mContext; // <! IContextSource
107107 protected $mTitle;
108108 protected $mMethod = 'post';
109109
@@ -115,12 +115,12 @@
116116 /**
117117 * Build a new HTMLForm from an array of field attributes
118118 * @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.
120120 * Obviates the need to call $form->setTitle()
121121 * @param $messagePrefix String a prefix to go in front of default messages
122122 */
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 ){
125125 $this->mContext = $context;
126126 $this->mTitle = false; // We don't need them to set a title
127127 $this->mMessagePrefix = $messagePrefix;
@@ -637,10 +637,10 @@
638638 }
639639
640640 /**
641 - * @return RequestContext
 641+ * @return IContextSource
642642 */
643643 public function getContext(){
644 - return $this->mContext instanceof RequestContext
 644+ return $this->mContext instanceof IContextSource
645645 ? $this->mContext
646646 : RequestContext::getMain();
647647 }
Index: branches/REL1_18/phase3/includes/revisiondelete/RevisionDeleteAbstracts.php
@@ -7,7 +7,7 @@
88 * to wrap bulk update operations.
99 */
1010 abstract class RevDel_List extends Rev_List {
11 - function __construct( RequestContext $context, Title $title, array $ids ) {
 11+ function __construct( IContextSource $context, Title $title, array $ids ) {
1212 parent::__construct( $context, $title );
1313 $this->ids = $ids;
1414 }
Index: branches/REL1_18/phase3/includes/RequestContext.php
@@ -306,14 +306,14 @@
307307 abstract class ContextSource implements IContextSource {
308308
309309 /**
310 - * @var RequestContext
 310+ * @var IContextSource
311311 */
312312 private $context;
313313
314314 /**
315 - * Get the RequestContext object
 315+ * Get the IContextSource object
316316 *
317 - * @return RequestContext
 317+ * @return IContextSource
318318 */
319319 public function getContext() {
320320 if ( $this->context === null ) {
@@ -325,11 +325,11 @@
326326 }
327327
328328 /**
329 - * Set the RequestContext object
 329+ * Set the IContextSource object
330330 *
331 - * @param $context RequestContext
 331+ * @param $context IContextSource
332332 */
333 - public function setContext( RequestContext $context ) {
 333+ public function setContext( IContextSource $context ) {
334334 $this->context = $context;
335335 }
336336
Index: branches/REL1_18/phase3/includes/OutputPage.php
@@ -225,7 +225,7 @@
226226 * Instead a new RequestContext should be created and it will implicitly create
227227 * a OutputPage tied to that context.
228228 */
229 - function __construct( RequestContext $context = null ) {
 229+ function __construct( IContextSource $context = null ) {
230230 $this->mContext = $context;
231231 }
232232
Property changes on: branches/REL1_18/phase3/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
233233 Merged /trunk/phase3/includes/OutputPage.php:r97159
Index: branches/REL1_18/phase3/includes/Wiki.php
@@ -29,7 +29,7 @@
3030
3131 /**
3232 * TODO: fold $output, etc, into this
33 - * @var RequestContext
 33+ * @var IContextSource
3434 */
3535 private $context;
3636
@@ -45,7 +45,7 @@
4646 return $old;
4747 }
4848
49 - public function __construct( RequestContext $context = null ) {
 49+ public function __construct( IContextSource $context = null ) {
5050 if ( !$context ) {
5151 $context = RequestContext::getMain();
5252 }
@@ -257,10 +257,10 @@
258258 *
259259 * @deprecated in 1.18; use Article::newFromTitle() instead
260260 * @param $title Title
261 - * @param $context RequestContext
 261+ * @param $context IContextSource
262262 * @return Article object
263263 */
264 - public static function articleFromTitle( $title, RequestContext $context ) {
 264+ public static function articleFromTitle( $title, IContextSource $context ) {
265265 return Article::newFromTitle( $title, $context );
266266 }
267267
Index: branches/REL1_18/phase3/includes/ChangesList.php
@@ -45,10 +45,10 @@
4646 /**
4747 * Changeslist contructor
4848 *
49 - * @param $obj Skin or RequestContext
 49+ * @param $obj Skin or IContextSource
5050 */
5151 public function __construct( $obj ) {
52 - if ( $obj instanceof RequestContext ) {
 52+ if ( $obj instanceof IContextSource ) {
5353 $this->setContext( $obj );
5454 $this->skin = $obj->getSkin();
5555 } else {
@@ -74,10 +74,10 @@
7575 * Fetch an appropriate changes list class for the specified context
7676 * Some users might want to use an enhanced list format, for instance
7777 *
78 - * @param $context RequestContext to use
 78+ * @param $context IContextSource to use
7979 * @return ChangesList|EnhancedChangesList|OldChangesList derivative
8080 */
81 - public static function newFromContext( RequestContext $context ) {
 81+ public static function newFromContext( IContextSource $context ) {
8282 $user = $context->getUser();
8383 $sk = $context->getSkin();
8484 $list = null;
Property changes on: branches/REL1_18/phase3/includes/ChangesList.php
___________________________________________________________________
Modified: svn:mergeinfo
8585 Merged /trunk/phase3/includes/ChangesList.php:r97159
Index: branches/REL1_18/phase3/includes/RevisionList.php
@@ -8,7 +8,7 @@
99 */
1010 var $title;
1111 /**
12 - * @var RequestContext
 12+ * @var IContextSource
1313 */
1414 var $context;
1515
@@ -16,10 +16,10 @@
1717
1818 /**
1919 * Construct a revision list for a given title
20 - * @param $context RequestContext
 20+ * @param $context IContextSource
2121 * @param $title Title
2222 */
23 - function __construct( RequestContext $context, Title $title ) {
 23+ function __construct( IContextSource $context, Title $title ) {
2424 $this->context = $context;
2525 $this->title = $title;
2626 }
Index: branches/REL1_18/phase3/includes/SpecialPage.php
@@ -57,7 +57,7 @@
5858
5959 /**
6060 * Current request context
61 - * @var RequestContext
 61+ * @var IContextSource
6262 */
6363 protected $mContext;
6464
@@ -226,12 +226,12 @@
227227 * page, and true if it was successful.
228228 *
229229 * @param $title Title object
230 - * @param $context RequestContext
 230+ * @param $context IContextSource
231231 * @param $including Bool output is being captured for use in {{special:whatever}}
232232 * @return Bool
233233 * @deprecated since 1.18 call SpecialPageFactory method directly
234234 */
235 - public static function executePath( &$title, RequestContext &$context, $including = false ) {
 235+ public static function executePath( &$title, IContextSource &$context, $including = false ) {
236236 return SpecialPageFactory::executePath( $title, $context, $including );
237237 }
238238
@@ -605,7 +605,7 @@
606606 /**
607607 * Sets the context this SpecialPage is executed in
608608 *
609 - * @param $context RequestContext
 609+ * @param $context IContextSource
610610 * @since 1.18
611611 */
612612 public function setContext( $context ) {
@@ -615,11 +615,11 @@
616616 /**
617617 * Gets the context this SpecialPage is executed in
618618 *
619 - * @return RequestContext
 619+ * @return IContextSource
620620 * @since 1.18
621621 */
622622 public function getContext() {
623 - if ( $this->mContext instanceof RequestContext ) {
 623+ if ( $this->mContext instanceof IContextSource ) {
624624 return $this->mContext;
625625 } else {
626626 wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" );
Property changes on: branches/REL1_18/phase3/includes/SpecialPage.php
___________________________________________________________________
Modified: svn:mergeinfo
627627 Merged /trunk/phase3/includes/SpecialPage.php:r97159
Index: branches/REL1_18/phase3/includes/Action.php
@@ -32,8 +32,8 @@
3333 protected $page;
3434
3535 /**
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
3838 */
3939 protected $context;
4040
@@ -96,11 +96,11 @@
9797 }
9898
9999 /**
100 - * Get the RequestContext in use here
101 - * @return RequestContext
 100+ * Get the IContextSource in use here
 101+ * @return IContextSource
102102 */
103103 protected final function getContext() {
104 - if ( $this->context instanceof RequestContext ) {
 104+ if ( $this->context instanceof IContextSource ) {
105105 return $this->context;
106106 }
107107 return $this->page->getContext();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97159Use IContextSource instead of RequestContext inside type hints and instanceof...dantman15:19, 15 September 2011

Status & tagging log