summaryrefslogtreecommitdiff
path: root/includes/context/ContextSource.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/context/ContextSource.php')
-rw-r--r--includes/context/ContextSource.php34
1 files changed, 18 insertions, 16 deletions
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;
}
@@ -58,6 +60,16 @@ abstract class ContextSource implements IContextSource {
}
/**
+ * Get the Config object
+ *
+ * @since 1.23
+ * @return Config
+ */
+ public function getConfig() {
+ return $this->getContext()->getConfig();
+ }
+
+ /**
* Get the WebRequest object
*
* @since 1.18
@@ -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();
@@ -125,17 +137,6 @@ abstract class ContextSource implements IContextSource {
/**
* 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
- *
* @since 1.19
* @return Language
*/
@@ -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() {