Refactor WPDB::get_caller() into wp_debug_backtrace_summary() and improve the functionality to provide enhanced context and a standardised default pretty format. Fixes #19589

git-svn-id: https://develop.svn.wordpress.org/trunk@19773 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood
2012-01-28 11:56:50 +00:00
parent 4b5b2e4658
commit b3a331887a
2 changed files with 41 additions and 10 deletions
+1 -10
View File
@@ -1545,16 +1545,7 @@ class wpdb {
* @return string The name of the calling function
*/
function get_caller() {
$trace = array_reverse( debug_backtrace() );
$caller = array();
foreach ( $trace as $call ) {
if ( isset( $call['class'] ) && __CLASS__ == $call['class'] )
continue; // Filter out wpdb calls.
$caller[] = isset( $call['class'] ) ? "{$call['class']}->{$call['function']}" : $call['function'];
}
return join( ', ', $caller );
return wp_debug_backtrace_summary( __CLASS__ );
}
/**