Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -1004,7 +1004,9 @@ |
1005 | 1005 | * @param $function String |
1006 | 1006 | * @param $version String|bool: Version of MediaWiki that the function was deprecated in (Added in 1.19). |
1007 | 1007 | * @param $component String|bool: Added in 1.19. |
1008 | | - * @param $callerOffset integer: How far up the callstack is the original caller (Added in 1.20) |
| 1008 | + * @param $callerOffset integer: How far up the callstack is the original |
| 1009 | + * caller. 2 = function that called the function that called |
| 1010 | + * wfDeprecated (Added in 1.20) |
1009 | 1011 | * |
1010 | 1012 | * @return null |
1011 | 1013 | */ |
Index: trunk/phase3/includes/DeprecatedGlobal.php |
— | — | @@ -16,6 +16,18 @@ |
17 | 17 | } |
18 | 18 | |
19 | 19 | function _newObject() { |
| 20 | + /* Put the caller offset for wfDeprecated as 6, as |
| 21 | + * that gives the function that uses this object, since: |
| 22 | + * 1 = this function ( _newObject ) |
| 23 | + * 2 = StubObject::_unstub |
| 24 | + * 3 = StubObject::_call |
| 25 | + * 4 = StubObject::__call |
| 26 | + * 5 = DeprecatedGlobal::<method of global called> |
| 27 | + * 6 = Actual function using the global. |
| 28 | + * Of course its theoretically possible to have other call |
| 29 | + * sequences for this method, but that seems to be |
| 30 | + * rather unlikely. |
| 31 | + */ |
20 | 32 | wfDeprecated( '$' . $this->mGlobal, $this->mVersion, false, 6 ); |
21 | 33 | return $this->mRealValue; |
22 | 34 | } |