dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fcb0de5
)
Use IContextSource instead of RequestContext inside type hints and instanceof checks...
author
Daniel Friesen
<dantman@users.mediawiki.org>
Thu, 15 Sep 2011 15:19:49 +0000
(15:19 +0000)
committer
Daniel Friesen
<dantman@users.mediawiki.org>
Thu, 15 Sep 2011 15:19:49 +0000
(15:19 +0000)
14 files changed:
includes/Action.php
patch
|
blob
|
history
includes/Article.php
patch
|
blob
|
history
includes/ChangesList.php
patch
|
blob
|
history
includes/HTMLForm.php
patch
|
blob
|
history
includes/OutputPage.php
patch
|
blob
|
history
includes/Preferences.php
patch
|
blob
|
history
includes/RequestContext.php
patch
|
blob
|
history
includes/RevisionList.php
patch
|
blob
|
history
includes/SpecialPage.php
patch
|
blob
|
history
includes/SpecialPageFactory.php
patch
|
blob
|
history
includes/Wiki.php
patch
|
blob
|
history
includes/logging/LogFormatter.php
patch
|
blob
|
history
includes/revisiondelete/RevisionDeleteAbstracts.php
patch
|
blob
|
history
includes/specials/SpecialUpload.php
patch
|
blob
|
history
diff --git
a/includes/Action.php
b/includes/Action.php
index
e836098
..
b165721
100644
(file)
--- a/
includes/Action.php
+++ b/
includes/Action.php
@@
-32,8
+32,8
@@
abstract class Action {
protected $page;
/**
protected $page;
/**
- *
RequestContext
if specified; otherwise we'll use the Context from the Page
- * @var
RequestContext
+ *
IContextSource
if specified; otherwise we'll use the Context from the Page
+ * @var
IContextSource
*/
protected $context;
*/
protected $context;
@@
-96,11
+96,11
@@
abstract class Action {
}
/**
}
/**
- * Get the
RequestContext
in use here
- * @return
RequestContext
+ * Get the
IContextSource
in use here
+ * @return
IContextSource
*/
protected final function getContext() {
*/
protected final function getContext() {
- if ( $this->context instanceof
RequestContext
) {
+ if ( $this->context instanceof
IContextSource
) {
return $this->context;
}
return $this->page->getContext();
return $this->context;
}
return $this->page->getContext();
diff --git
a/includes/Article.php
b/includes/Article.php
index
e453b37
..
3dcef85
100644
(file)
--- a/
includes/Article.php
+++ b/
includes/Article.php
@@
-23,7
+23,7
@@
class Article extends Page {
*/
/**
*/
/**
- * @var
RequestContext
+ * @var
IContextSource
*/
protected $mContext;
*/
protected $mContext;
@@
-88,10
+88,10
@@
class Article extends Page {
* Create an Article object of the appropriate class for the given page.
*
* @param $title Title
* Create an Article object of the appropriate class for the given page.
*
* @param $title Title
- * @param $context
RequestContext
+ * @param $context
IContextSource
* @return Article object
*/
* @return Article object
*/
- public static function newFromTitle( $title,
RequestContext
$context ) {
+ public static function newFromTitle( $title,
IContextSource
$context ) {
if ( NS_MEDIA == $title->getNamespace() ) {
// FIXME: where should this go?
$title = Title::makeTitle( NS_FILE, $title->getDBkey() );
if ( NS_MEDIA == $title->getNamespace() ) {
// FIXME: where should this go?
$title = Title::makeTitle( NS_FILE, $title->getDBkey() );
@@
-1856,7
+1856,7
@@
class Article extends Page {
/**
* Sets the context this Article is executed in
*
/**
* Sets the context this Article is executed in
*
- * @param $context
RequestContext
+ * @param $context
IContextSource
* @since 1.18
*/
public function setContext( $context ) {
* @since 1.18
*/
public function setContext( $context ) {
@@
-1866,11
+1866,11
@@
class Article extends Page {
/**
* Gets the context this Article is executed in
*
/**
* Gets the context this Article is executed in
*
- * @return
RequestContext
+ * @return
IContextSource
* @since 1.18
*/
public function getContext() {
* @since 1.18
*/
public function getContext() {
- if ( $this->mContext instanceof
RequestContext
) {
+ if ( $this->mContext instanceof
IContextSource
) {
return $this->mContext;
} else {
wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" );
return $this->mContext;
} else {
wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" );
diff --git
a/includes/ChangesList.php
b/includes/ChangesList.php
index
bb36ce9
..
fe40cd4
100644
(file)
--- a/
includes/ChangesList.php
+++ b/
includes/ChangesList.php
@@
-45,10
+45,10
@@
class ChangesList extends ContextSource {
/**
* Changeslist contructor
*
/**
* Changeslist contructor
*
- * @param $obj Skin or
RequestContext
+ * @param $obj Skin or
IContextSource
*/
public function __construct( $obj ) {
*/
public function __construct( $obj ) {
- if ( $obj instanceof
RequestContext
) {
+ if ( $obj instanceof
IContextSource
) {
$this->setContext( $obj );
$this->skin = $obj->getSkin();
} else {
$this->setContext( $obj );
$this->skin = $obj->getSkin();
} else {
@@
-74,10
+74,10
@@
class ChangesList extends ContextSource {
* Fetch an appropriate changes list class for the specified context
* Some users might want to use an enhanced list format, for instance
*
* Fetch an appropriate changes list class for the specified context
* Some users might want to use an enhanced list format, for instance
*
- * @param $context
RequestContext
to use
+ * @param $context
IContextSource
to use
* @return ChangesList|EnhancedChangesList|OldChangesList derivative
*/
* @return ChangesList|EnhancedChangesList|OldChangesList derivative
*/
- public static function newFromContext(
RequestContext
$context ) {
+ public static function newFromContext(
IContextSource
$context ) {
$user = $context->getUser();
$sk = $context->getSkin();
$list = null;
$user = $context->getUser();
$sk = $context->getSkin();
$list = null;
diff --git
a/includes/HTMLForm.php
b/includes/HTMLForm.php
index
da84fc3
..
c8279bc
100644
(file)
--- a/
includes/HTMLForm.php
+++ b/
includes/HTMLForm.php
@@
-102,7
+102,7
@@
class HTMLForm {
protected $mSubmitText;
protected $mSubmitTooltip;
protected $mSubmitText;
protected $mSubmitTooltip;
- protected $mContext; // <!
RequestContext
+ protected $mContext; // <!
IContextSource
protected $mTitle;
protected $mMethod = 'post';
protected $mTitle;
protected $mMethod = 'post';
@@
-115,12
+115,12
@@
class HTMLForm {
/**
* Build a new HTMLForm from an array of field attributes
* @param $descriptor Array of Field constructs, as described above
/**
* Build a new HTMLForm from an array of field attributes
* @param $descriptor Array of Field constructs, as described above
- * @param $context
RequestContext
available since 1.18, will become compulsory in 1.18.
+ * @param $context
IContextSource
available since 1.18, will become compulsory in 1.18.
* Obviates the need to call $form->setTitle()
* @param $messagePrefix String a prefix to go in front of default messages
*/
* Obviates the need to call $form->setTitle()
* @param $messagePrefix String a prefix to go in front of default messages
*/
- public function __construct( $descriptor, /*
RequestContext
*/ $context = null, $messagePrefix = '' ) {
- if( $context instanceof
RequestContext
){
+ public function __construct( $descriptor, /*
IContextSource
*/ $context = null, $messagePrefix = '' ) {
+ if( $context instanceof
IContextSource
){
$this->mContext = $context;
$this->mTitle = false; // We don't need them to set a title
$this->mMessagePrefix = $messagePrefix;
$this->mContext = $context;
$this->mTitle = false; // We don't need them to set a title
$this->mMessagePrefix = $messagePrefix;
@@
-638,10
+638,10
@@
class HTMLForm {
}
/**
}
/**
- * @return
RequestContext
+ * @return
IContextSource
*/
public function getContext(){
*/
public function getContext(){
- return $this->mContext instanceof
RequestContext
+ return $this->mContext instanceof
IContextSource
? $this->mContext
: RequestContext::getMain();
}
? $this->mContext
: RequestContext::getMain();
}
diff --git
a/includes/OutputPage.php
b/includes/OutputPage.php
index
7760d15
..
8a97061
100644
(file)
--- a/
includes/OutputPage.php
+++ b/
includes/OutputPage.php
@@
-223,7
+223,7
@@
class OutputPage extends ContextSource {
* Instead a new RequestContext should be created and it will implicitly create
* a OutputPage tied to that context.
*/
* Instead a new RequestContext should be created and it will implicitly create
* a OutputPage tied to that context.
*/
- function __construct(
RequestContext
$context = null ) {
+ function __construct(
IContextSource
$context = null ) {
if ( $context === null ) {
# Extensions should use `new RequestContext` instead of `new OutputPage` now.
wfDeprecated( __METHOD__ );
if ( $context === null ) {
# Extensions should use `new RequestContext` instead of `new OutputPage` now.
wfDeprecated( __METHOD__ );
diff --git
a/includes/Preferences.php
b/includes/Preferences.php
index
9f4e5b2
..
a955b6f
100644
(file)
--- a/
includes/Preferences.php
+++ b/
includes/Preferences.php
@@
-1212,11
+1212,11
@@
class Preferences {
/**
* @param $user User
/**
* @param $user User
- * @param $context
RequestContext
+ * @param $context
IContextSource
* @param $formClass string
* @return HtmlForm
*/
* @param $formClass string
* @return HtmlForm
*/
- static function getFormObject( $user,
RequestContext
$context, $formClass = 'PreferencesForm' ) {
+ static function getFormObject( $user,
IContextSource
$context, $formClass = 'PreferencesForm' ) {
$formDescriptor = Preferences::getPreferences( $user );
$htmlForm = new $formClass( $formDescriptor, $context, 'prefs' );
$formDescriptor = Preferences::getPreferences( $user );
$htmlForm = new $formClass( $formDescriptor, $context, 'prefs' );
diff --git
a/includes/RequestContext.php
b/includes/RequestContext.php
index
e3a19a3
..
298ab27
100644
(file)
--- a/
includes/RequestContext.php
+++ b/
includes/RequestContext.php
@@
-353,14
+353,14
@@
class RequestContext implements IContextSource {
abstract class ContextSource implements IContextSource {
/**
abstract class ContextSource implements IContextSource {
/**
- * @var
RequestContext
+ * @var
IContextSource
*/
private $context;
/**
*/
private $context;
/**
- * Get the
RequestContext
object
+ * Get the
IContextSource
object
*
*
- * @return
RequestContext
+ * @return
IContextSource
*/
public function getContext() {
if ( $this->context === null ) {
*/
public function getContext() {
if ( $this->context === null ) {
@@
-372,11
+372,11
@@
abstract class ContextSource implements IContextSource {
}
/**
}
/**
- * Set the
RequestContext
object
+ * Set the
IContextSource
object
*
*
- * @param $context
RequestContext
+ * @param $context
IContextSource
*/
*/
- public function setContext(
RequestContext
$context ) {
+ public function setContext(
IContextSource
$context ) {
$this->context = $context;
}
$this->context = $context;
}
diff --git
a/includes/RevisionList.php
b/includes/RevisionList.php
index
dfb85ee
..
215b663
100644
(file)
--- a/
includes/RevisionList.php
+++ b/
includes/RevisionList.php
@@
-8,7
+8,7
@@
abstract class RevisionListBase {
*/
var $title;
/**
*/
var $title;
/**
- * @var
RequestContext
+ * @var
IContextSource
*/
var $context;
*/
var $context;
@@
-16,10
+16,10
@@
abstract class RevisionListBase {
/**
* Construct a revision list for a given title
/**
* Construct a revision list for a given title
- * @param $context
RequestContext
+ * @param $context
IContextSource
* @param $title Title
*/
* @param $title Title
*/
- function __construct(
RequestContext
$context, Title $title ) {
+ function __construct(
IContextSource
$context, Title $title ) {
$this->context = $context;
$this->title = $title;
}
$this->context = $context;
$this->title = $title;
}
diff --git
a/includes/SpecialPage.php
b/includes/SpecialPage.php
index
0a52d75
..
b943b51
100644
(file)
--- a/
includes/SpecialPage.php
+++ b/
includes/SpecialPage.php
@@
-57,7
+57,7
@@
class SpecialPage {
/**
* Current request context
/**
* Current request context
- * @var
RequestContext
+ * @var
IContextSource
*/
protected $mContext;
*/
protected $mContext;
@@
-226,12
+226,12
@@
class SpecialPage {
* page, and true if it was successful.
*
* @param $title Title object
* page, and true if it was successful.
*
* @param $title Title object
- * @param $context
RequestContext
+ * @param $context
IContextSource
* @param $including Bool output is being captured for use in {{special:whatever}}
* @return Bool
* @deprecated since 1.18 call SpecialPageFactory method directly
*/
* @param $including Bool output is being captured for use in {{special:whatever}}
* @return Bool
* @deprecated since 1.18 call SpecialPageFactory method directly
*/
- public static function executePath( &$title,
RequestContext
&$context, $including = false ) {
+ public static function executePath( &$title,
IContextSource
&$context, $including = false ) {
return SpecialPageFactory::executePath( $title, $context, $including );
}
return SpecialPageFactory::executePath( $title, $context, $including );
}
@@
-592,7
+592,7
@@
class SpecialPage {
/**
* Sets the context this SpecialPage is executed in
*
/**
* Sets the context this SpecialPage is executed in
*
- * @param $context
RequestContext
+ * @param $context
IContextSource
* @since 1.18
*/
public function setContext( $context ) {
* @since 1.18
*/
public function setContext( $context ) {
@@
-602,11
+602,11
@@
class SpecialPage {
/**
* Gets the context this SpecialPage is executed in
*
/**
* Gets the context this SpecialPage is executed in
*
- * @return
RequestContext
+ * @return
IContextSource
* @since 1.18
*/
public function getContext() {
* @since 1.18
*/
public function getContext() {
- if ( $this->mContext instanceof
RequestContext
) {
+ if ( $this->mContext instanceof
IContextSource
) {
return $this->mContext;
} else {
wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" );
return $this->mContext;
} else {
wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" );
diff --git
a/includes/SpecialPageFactory.php
b/includes/SpecialPageFactory.php
index
86c0bce
..
210c218
100644
(file)
--- a/
includes/SpecialPageFactory.php
+++ b/
includes/SpecialPageFactory.php
@@
-409,12
+409,12
@@
class SpecialPageFactory {
* page, and true if it was successful.
*
* @param $title Title object
* page, and true if it was successful.
*
* @param $title Title object
- * @param $context
RequestContext
+ * @param $context
IContextSource
* @param $including Bool output is being captured for use in {{special:whatever}}
*
* @return bool
*/
* @param $including Bool output is being captured for use in {{special:whatever}}
*
* @return bool
*/
- public static function executePath( Title &$title,
RequestContext
&$context, $including = false ) {
+ public static function executePath( Title &$title,
IContextSource
&$context, $including = false ) {
wfProfileIn( __METHOD__ );
// @todo FIXME: Redirects broken due to this call
wfProfileIn( __METHOD__ );
// @todo FIXME: Redirects broken due to this call
@@
-485,11
+485,11
@@
class SpecialPageFactory {
* normal request, and then restores them to their previous values after.
*
* @param $title Title
* normal request, and then restores them to their previous values after.
*
* @param $title Title
- * @param $context
RequestContext
+ * @param $context
IContextSource
*
* @return String: HTML fragment
*/
*
* @return String: HTML fragment
*/
- static function capturePath( Title $title,
RequestContext
$context ) {
+ static function capturePath( Title $title,
IContextSource
$context ) {
global $wgOut, $wgTitle, $wgRequest, $wgUser, $wgLang;
// Save current globals
global $wgOut, $wgTitle, $wgRequest, $wgUser, $wgLang;
// Save current globals
diff --git
a/includes/Wiki.php
b/includes/Wiki.php
index
ca8584b
..
985d951
100644
(file)
--- a/
includes/Wiki.php
+++ b/
includes/Wiki.php
@@
-29,7
+29,7
@@
class MediaWiki {
/**
* TODO: fold $output, etc, into this
/**
* TODO: fold $output, etc, into this
- * @var
RequestContext
+ * @var
IContextSource
*/
private $context;
*/
private $context;
@@
-45,7
+45,7
@@
class MediaWiki {
return $old;
}
return $old;
}
- public function __construct(
RequestContext
$context = null ) {
+ public function __construct(
IContextSource
$context = null ) {
if ( !$context ) {
$context = RequestContext::getMain();
}
if ( !$context ) {
$context = RequestContext::getMain();
}
@@
-256,10
+256,10
@@
class MediaWiki {
*
* @deprecated in 1.18; use Article::newFromTitle() instead
* @param $title Title
*
* @deprecated in 1.18; use Article::newFromTitle() instead
* @param $title Title
- * @param $context
RequestContext
+ * @param $context
IContextSource
* @return Article object
*/
* @return Article object
*/
- public static function articleFromTitle( $title,
RequestContext
$context ) {
+ public static function articleFromTitle( $title,
IContextSource
$context ) {
return Article::newFromTitle( $title, $context );
}
return Article::newFromTitle( $title, $context );
}
diff --git
a/includes/logging/LogFormatter.php
b/includes/logging/LogFormatter.php
index
4efda39
..
2e86f04
100644
(file)
--- a/
includes/logging/LogFormatter.php
+++ b/
includes/logging/LogFormatter.php
@@
-78,9
+78,9
@@
class LogFormatter {
/**
* Replace the default context
/**
* Replace the default context
- * @param $context
RequestContext
+ * @param $context
IContextSource
*/
*/
- public function setContext(
RequestContext
$context ) {
+ public function setContext(
IContextSource
$context ) {
$this->context = $context;
}
$this->context = $context;
}
diff --git
a/includes/revisiondelete/RevisionDeleteAbstracts.php
b/includes/revisiondelete/RevisionDeleteAbstracts.php
index
81d4449
..
dc7af19
100644
(file)
--- a/
includes/revisiondelete/RevisionDeleteAbstracts.php
+++ b/
includes/revisiondelete/RevisionDeleteAbstracts.php
@@
-7,7
+7,7
@@
* to wrap bulk update operations.
*/
abstract class RevDel_List extends RevisionListBase {
* to wrap bulk update operations.
*/
abstract class RevDel_List extends RevisionListBase {
- function __construct(
RequestContext
$context, Title $title, array $ids ) {
+ function __construct(
IContextSource
$context, Title $title, array $ids ) {
parent::__construct( $context, $title );
$this->ids = $ids;
}
parent::__construct( $context, $title );
$this->ids = $ids;
}
diff --git
a/includes/specials/SpecialUpload.php
b/includes/specials/SpecialUpload.php
index
860fd45
..
0bf52ec
100644
(file)
--- a/
includes/specials/SpecialUpload.php
+++ b/
includes/specials/SpecialUpload.php
@@
-758,7
+758,7
@@
class UploadForm extends HTMLForm {
protected $mMaxFileSize = array();
protected $mMaxFileSize = array();
- public function __construct( array $options = array(),
RequestContext
$context = null ) {
+ public function __construct( array $options = array(),
IContextSource
$context = null ) {
$this->mWatch = !empty( $options['watch'] );
$this->mForReUpload = !empty( $options['forreupload'] );
$this->mSessionKey = isset( $options['sessionkey'] )
$this->mWatch = !empty( $options['watch'] );
$this->mForReUpload = !empty( $options['forreupload'] );
$this->mSessionKey = isset( $options['sessionkey'] )