follow-up r111342. Document the callerOffset paramter being used per CR.
authorBrian Wolff <bawolff@users.mediawiki.org>
Mon, 13 Feb 2012 20:29:41 +0000 (20:29 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Mon, 13 Feb 2012 20:29:41 +0000 (20:29 +0000)
includes/DeprecatedGlobal.php
includes/GlobalFunctions.php

index 6f3cdbd..39c5cab 100644 (file)
@@ -16,6 +16,18 @@ class DeprecatedGlobal extends StubObject {
        }
 
        function _newObject() {
+               /* Put the caller offset for wfDeprecated as 6, as
+                * that gives the function that uses this object, since:
+                * 1 = this function ( _newObject )
+                * 2 = StubObject::_unstub
+                * 3 = StubObject::_call
+                * 4 = StubObject::__call
+                * 5 = DeprecatedGlobal::<method of global called>
+                * 6 = Actual function using the global.
+                * Of course its theoretically possible to have other call
+                * sequences for this method, but that seems to be
+                * rather unlikely.
+                */
                wfDeprecated( '$' . $this->mGlobal, $this->mVersion, false, 6 );
                return $this->mRealValue;
        }
index be920fb..4312096 100644 (file)
@@ -1004,7 +1004,9 @@ function wfLogDBError( $text ) {
  * @param $function String
  * @param $version String|bool: Version of MediaWiki that the function was deprecated in (Added in 1.19).
  * @param $component String|bool: Added in 1.19.
- * @param $callerOffset integer: How far up the callstack is the original caller (Added in 1.20)
+ * @param $callerOffset integer: How far up the callstack is the original
+ *    caller. 2 = function that called the function that called
+ *    wfDeprecated (Added in 1.20) 
  * 
  * @return null
  */