add wfGetAllCallers(), utility function for some occasional profiling magic
authorDomas Mituzas <midom@users.mediawiki.org>
Mon, 14 Aug 2006 21:34:57 +0000 (21:34 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Mon, 14 Aug 2006 21:34:57 +0000 (21:34 +0000)
includes/GlobalFunctions.php

index dc299f6..0de411a 100644 (file)
@@ -2073,4 +2073,15 @@ function wfGetCaller( $level = 2 ) {
        return $caller;
 }
 
+/** Return a string consisting all callers in stack, somewhat useful sometimes for profiling specific points */
+function wfGetAllCallers() {
+       return implode('/', array_map(
+               create_function('$frame',' 
+                       return isset( $frame["class"] )?
+                               $frame["class"]."::".$frame["function"]:
+                               $frame["function"]; 
+                       '),
+               array_reverse(debug_backtrace())));
+}
+
 ?>