r111415 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111414‎ | r111415 | r111416 >
Date:20:29, 13 February 2012
Author:bawolff
Status:ok
Tags:
Comment:
follow-up r111342. Document the callerOffset paramter being used per CR.
Modified paths:
  • /trunk/phase3/includes/DeprecatedGlobal.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1004,7 +1004,9 @@
10051005 * @param $function String
10061006 * @param $version String|bool: Version of MediaWiki that the function was deprecated in (Added in 1.19).
10071007 * @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)
10091011 *
10101012 * @return null
10111013 */
Index: trunk/phase3/includes/DeprecatedGlobal.php
@@ -16,6 +16,18 @@
1717 }
1818
1919 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+ */
2032 wfDeprecated( '$' . $this->mGlobal, $this->mVersion, false, 6 );
2133 return $this->mRealValue;
2234 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111342Give a warning when people use $wgArticle. Add's a class that can be used to ...bawolff00:19, 13 February 2012

Status & tagging log