r90362 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90361‎ | r90362 | r90363 >
Date:20:15, 18 June 2011
Author:platonides
Status:resolved (Comments)
Tags:
Comment:
Follow up r90361
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1359,7 +1359,7 @@
13601360 *
13611361 * @return array of backtrace information
13621362 */
1363 -function wfDebugBacktrace() {
 1363+function wfDebugBacktrace( $limit = 0 ) {
13641364 static $disabled = null;
13651365
13661366 if( extension_loaded( 'Zend Optimizer' ) ) {
@@ -1381,7 +1381,7 @@
13821382 return array();
13831383 }
13841384
1385 - if ( version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
 1385+ if ( $limit && version_compare( PHP_VERSION, '5.4.0', '>=' ) ) {
13861386 return array_slice( debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT, 1 ), 1 );
13871387 } else {
13881388 return array_slice( debug_backtrace(), 1 );
@@ -1446,7 +1446,7 @@
14471447 * @return Bool|string
14481448 */
14491449 function wfGetCaller( $level = 2 ) {
1450 - $backtrace = wfDebugBacktrace();
 1450+ $backtrace = wfDebugBacktrace( $level );
14511451 if ( isset( $backtrace[$level] ) ) {
14521452 return wfFormatStackFrame( $backtrace[$level] );
14531453 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r95493Followup r90361, r90362...reedy16:40, 25 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90361There is a nice $limit parameter in PHP 5.4, but calling debug_backtrace on e...platonides20:11, 18 June 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   22:16, 21 June 2011

$limit isn't documented. And is it supposed to get passed down to debug_backtrace()?

Status & tagging log