From c1f9b1f7b1b77776192048005dcc66dcf3df2bfb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 27 Dec 2014 15:41:37 +0100 Subject: Update to MediaWiki 1.24.1 --- includes/context/ContextSource.php | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'includes/context/ContextSource.php') diff --git a/includes/context/ContextSource.php b/includes/context/ContextSource.php index e13cfa88..076504ec 100644 --- a/includes/context/ContextSource.php +++ b/includes/context/ContextSource.php @@ -34,16 +34,18 @@ abstract class ContextSource implements IContextSource { private $context; /** - * Get the RequestContext object + * Get the base IContextSource object * @since 1.18 - * @return RequestContext + * @return IContextSource */ public function getContext() { if ( $this->context === null ) { $class = get_class( $this ); - wfDebug( __METHOD__ . " ($class): called and \$context is null. Using RequestContext::getMain() for sanity\n" ); + wfDebug( __METHOD__ . " ($class): called and \$context is null. " . + "Using RequestContext::getMain() for sanity\n" ); $this->context = RequestContext::getMain(); } + return $this->context; } @@ -57,6 +59,16 @@ abstract class ContextSource implements IContextSource { $this->context = $context; } + /** + * Get the Config object + * + * @since 1.23 + * @return Config + */ + public function getConfig() { + return $this->getContext()->getConfig(); + } + /** * Get the WebRequest object * @@ -71,7 +83,7 @@ abstract class ContextSource implements IContextSource { * Get the Title object * * @since 1.18 - * @return Title + * @return Title|null */ public function getTitle() { return $this->getContext()->getTitle(); @@ -122,17 +134,6 @@ abstract class ContextSource implements IContextSource { return $this->getContext()->getUser(); } - /** - * Get the Language object - * - * @deprecated since 1.19 Use getLanguage instead - * @return Language - */ - public function getLang() { - wfDeprecated( __METHOD__, '1.19' ); - return $this->getLanguage(); - } - /** * Get the Language object * @@ -162,6 +163,7 @@ abstract class ContextSource implements IContextSource { */ public function msg( /* $args */ ) { $args = func_get_args(); + return call_user_func_array( array( $this->getContext(), 'msg' ), $args ); } @@ -169,7 +171,7 @@ abstract class ContextSource implements IContextSource { * Export the resolved user IP, HTTP headers, user ID, and session ID. * The result will be reasonably sized to allow for serialization. * - * @return Array + * @return array * @since 1.21 */ public function exportSession() { -- cgit v1.2.2