From: Domas Mituzas Date: Wed, 2 Aug 2006 18:48:30 +0000 (+0000) Subject: erghhhh X-Git-Tag: 1.31.0-rc.0~56097 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=ca6321d4c6f36dffb7ed323380786a6851472b76;p=lhc%2Fweb%2Fwiklou.git erghhhh --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index c34b7db1e6..9e4a453e85 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2047,4 +2047,18 @@ function wfGetPrecompiledData( $name ) { return false; } +function wfGetCaller( $level = 1 ) { + $backtrace = debug_backtrace(); + if ( isset( $backtrace[$level] ) ) { + if ( isset( $backtrace[$level]['class'] ) ) { + $caller = $backtrace[$level]['class'] . '::' . $backtrace[$level]['function']; + } else { + $caller = $backtrace[$level]['function']; + } + } else { + $caller = 'unknown'; + } + return $caller; +} + ?> diff --git a/includes/StubObject.php b/includes/StubObject.php index c54b114b7b..7225c24f13 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -49,7 +49,7 @@ class StubObject { if ( get_class( $GLOBALS[$this->mGlobal] ) != $this->mClass ) { $fname = __METHOD__.'-'.$this->mGlobal; wfProfileIn( $fname ); - $caller = Profiler::getCaller( $level ); + $caller = wfGetCaller( $level ); if ( ++$recursionLevel > 2 ) { throw new MWException( "Unstub loop detected on call of \${$this->mGlobal}->$name from $caller\n" ); }