PHP >= 5.4.0 started taking advantage of $limit optimization of wfDebugBacktrace(),
authorPlatonides <platonides@gmail.com>
Thu, 31 May 2012 15:29:43 +0000 (17:29 +0200)
committerPlatonides <platonides@gmail.com>
Thu, 31 May 2012 15:32:33 +0000 (17:32 +0200)
commit2e506c4809624c2a91e7798a38f2996e321cd95f
tree06b98ea87bd03db7cef8ed6ed7b23cde5d707d6f
parent9780085753d33f0c88600f0b7bbb6626fd97c89d
PHP >= 5.4.0 started taking advantage of $limit optimization of wfDebugBacktrace(),
which we weren't treating right.

* $limit in wfDebugBacktrace() is the number of returned frames,
we thus need to take into account the wfDebugBacktrace() frame, which
is sliced from debug_backtrace().

* wfGetCaller() needs to add a level for itself.

* MWDebug::warning() was logging itself as the warning issuer,
which is useless (the call a few lines before was right, though)
MWDebugTest.php changed accordingly.

* Removed double call to wfGetCaller( $callerOffset + 1 )

* Documented the meaning of wfGetCaller() parameter

* Added unit test

Change-Id: Ief50f4c810bad8b03bb2bf9dc6d945d9acb29851
includes/GlobalFunctions.php
includes/debug/Debug.php
tests/phpunit/includes/GlobalFunctions/wfGetCallerTest.php [new file with mode: 0644]
tests/phpunit/includes/debug/MWDebugTest.php