Esempio n. 1
0
/**
 * Get the name of the function which called this function
 * wfGetCaller( 1 ) is the function with the wfGetCaller() call (ie. __FUNCTION__)
 * wfGetCaller( 2 ) [default] is the caller of the function running wfGetCaller()
 * wfGetCaller( 3 ) is the parent of that.
 *
 * @param int $level
 * @return string
 */
function wfGetCaller($level = 2)
{
    $backtrace = wfDebugBacktrace($level + 1);
    if (isset($backtrace[$level])) {
        return wfFormatStackFrame($backtrace[$level]);
    } else {
        return 'unknown';
    }
}
Esempio n. 2
0
 /**
  * Mark this test as skipped. Puts extra information in the logs.
  *
  * @param string $message
  */
 public static function markTestSkipped($message = '')
 {
     $backtrace = wfDebugBacktrace(3);
     $entry = $backtrace[1];
     Wikia::log(wfFormatStackFrame($entry), false, "marked as skipped - {$message}");
     parent::markTestSkipped($message);
 }