From 11f4db8b2ac2f122ce513b7f858aac85907aad54 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Mon, 13 Feb 2012 20:29:41 +0000 Subject: [PATCH] follow-up r111342. Document the callerOffset paramter being used per CR. --- includes/DeprecatedGlobal.php | 12 ++++++++++++ includes/GlobalFunctions.php | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/includes/DeprecatedGlobal.php b/includes/DeprecatedGlobal.php index 6f3cdbd2f2..39c5cabc56 100644 --- a/includes/DeprecatedGlobal.php +++ b/includes/DeprecatedGlobal.php @@ -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:: + * 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; } diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index be920fb6ae..4312096262 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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 */ -- 2.20.1