diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
commit | c9aa36da061816dee256a979c2ff8d2ee41824d9 (patch) | |
tree | 29f7002b80ee984b488bd047dbbd80b36bf892e9 /includes/context/DerivativeContext.php | |
parent | b4274e0e33eafb5e9ead9d949ebf031a9fb8363b (diff) | |
parent | d1ba966140d7a60cd5ae4e8667ceb27c1a138592 (diff) |
Merge branch 'archwiki'
# Conflicts:
# skins/ArchLinux.php
# skins/ArchLinux/archlogo.gif
Diffstat (limited to 'includes/context/DerivativeContext.php')
-rw-r--r-- | includes/context/DerivativeContext.php | 58 |
1 files changed, 31 insertions, 27 deletions
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 @@ -66,6 +66,11 @@ class DerivativeContext extends ContextSource { private $skin; /** + * @var Config + */ + private $config; + + /** * Constructor * @param IContextSource $context Context to inherit from */ @@ -74,6 +79,28 @@ class DerivativeContext extends ContextSource { } /** + * 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 * * @param WebRequest $r @@ -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 ) ) { @@ -212,17 +236,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 - * * @param Language|string $l Language instance or language code * @throws MWException * @since 1.19 @@ -240,15 +253,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 * * @return Language @@ -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 ); } } |