* (bug 32786) Fix backwards compatibility for extensions using 1.17's Database::newFr...
[lhc/web/wiklou.git] / includes / StubObject.php
index 1c5460b..3f6b8b1 100644 (file)
@@ -60,6 +60,7 @@ class StubObject {
 
        /**
         * Create a new object to replace this stub object.
+        * @return object
         */
        function _newObject() {
                return MWFunction::newObj( $this->mClass, $this->mParams );
@@ -89,9 +90,10 @@ class StubObject {
        function _unstub( $name = '_unstub', $level = 2 ) {
                static $recursionLevel = 0;
 
-               if ( !($GLOBALS[$this->mGlobal] instanceof StubObject) )
+               if ( !($GLOBALS[$this->mGlobal] instanceof StubObject) ) {
                        return $GLOBALS[$this->mGlobal]; // already unstubbed.
-               
+               }
+
                if ( get_class( $GLOBALS[$this->mGlobal] ) != $this->mClass ) {
                        $fname = __METHOD__.'-'.$this->mGlobal;
                        wfProfileIn( $fname );
@@ -110,6 +112,8 @@ class StubObject {
 /**
  * Stub object for the content language of this wiki. This object have to be in
  * $wgContLang global.
+ *
+ * @deprecated since 1.18
  */
 class StubContLang extends StubObject {
 
@@ -121,6 +125,9 @@ class StubContLang extends StubObject {
                return $this->_call( $name, $args );
        }
 
+       /**
+        * @return Language
+        */
        function _newObject() {
                global $wgLanguageCode;
                $obj = Language::factory( $wgLanguageCode );
@@ -145,7 +152,10 @@ class StubUserLang extends StubObject {
                return $this->_call( $name, $args );
        }
 
+       /**
+        * @return Language
+        */
        function _newObject() {
-               return RequestContext::getMain()->lang;
+               return RequestContext::getMain()->getLanguage();
        }
 }