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/DerivativeContext.php | 58 ++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 27 deletions(-) (limited to 'includes/context/DerivativeContext.php') diff --git a/includes/context/DerivativeContext.php b/includes/context/DerivativeContext.php index fd9bf963..b8966f0c 100644 --- a/includes/context/DerivativeContext.php +++ b/includes/context/DerivativeContext.php @@ -65,6 +65,11 @@ class DerivativeContext extends ContextSource { */ private $skin; + /** + * @var Config + */ + private $config; + /** * Constructor * @param IContextSource $context Context to inherit from @@ -73,6 +78,28 @@ class DerivativeContext extends ContextSource { $this->setContext( $context ); } + /** + * Set the SiteConfiguration object + * + * @param Config $s + */ + public function setConfig( Config $s ) { + $this->config = $s; + } + + /** + * Get the Config object + * + * @return Config + */ + public function getConfig() { + if ( !is_null( $this->config ) ) { + return $this->config; + } else { + return $this->getContext()->getConfig(); + } + } + /** * Set the WebRequest object * @@ -100,17 +127,14 @@ class DerivativeContext extends ContextSource { * * @param Title $t */ - public function setTitle( $t ) { - if ( $t !== null && !$t instanceof Title ) { - throw new MWException( __METHOD__ . " expects an instance of Title" ); - } + public function setTitle( Title $t ) { $this->title = $t; } /** * Get the Title object * - * @return Title + * @return Title|null */ public function getTitle() { if ( !is_null( $this->title ) ) { @@ -209,17 +233,6 @@ class DerivativeContext extends ContextSource { } } - /** - * Set the Language object - * - * @deprecated since 1.19 Use setLanguage instead - * @param Language|string $l Language instance or language code - */ - public function setLang( $l ) { - wfDeprecated( __METHOD__, '1.19' ); - $this->setLanguage( $l ); - } - /** * Set the Language object * @@ -239,15 +252,6 @@ class DerivativeContext extends ContextSource { } } - /** - * @deprecated since 1.19 Use getLanguage instead - * @return Language - */ - public function getLang() { - wfDeprecated( __METHOD__, '1.19' ); - $this->getLanguage(); - } - /** * Get the Language object * @@ -292,12 +296,12 @@ class DerivativeContext extends ContextSource { * it would set only the original context, and not take * into account any changes. * - * @param String Message name - * @param Variable number of message arguments + * @param mixed $args,... Arguments to wfMessage * @return Message */ public function msg() { $args = func_get_args(); + return call_user_func_array( 'wfMessage', $args )->setContext( $this ); } } -- cgit v1.2.3-54-g00ecf