Merge "Begin exposing SiteConfiguration via site contexts"
[lhc/web/wiklou.git] / includes / context / ContextSource.php
index e13cfa8..186b8e6 100644 (file)
@@ -41,9 +41,11 @@ abstract class ContextSource implements 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 SiteConfiguration object
+        *
+        * @since 1.23
+        * @return SiteConfiguration
+        */
+       public function getConfig() {
+               return $this->getContext()->getConfig();
+       }
+
        /**
         * Get the WebRequest object
         *
@@ -130,6 +142,7 @@ abstract class ContextSource implements IContextSource {
         */
        public function getLang() {
                wfDeprecated( __METHOD__, '1.19' );
+
                return $this->getLanguage();
        }
 
@@ -162,6 +175,7 @@ abstract class ContextSource implements IContextSource {
         */
        public function msg( /* $args */ ) {
                $args = func_get_args();
+
                return call_user_func_array( array( $this->getContext(), 'msg' ), $args );
        }