cfg
8/21/2013 - 4:50 PM

ugly

ugly

<?php
function cfg_get_stack() {
  $bt = debug_backtrace();
	$stack = array();
	array_shift($bt);
	foreach( $bt as $item ) {
		$str = '';
		if( isset($item['file']) )
			$str .= basename($item['file']);

		if( isset($item['line']) )
			$str.= ':' . $item['line'];

		if( isset($item['function']) )
			$str.= ' ' . $item['function'];

		if( !empty($str) )
			$stack[] = $str;
	}

	return $stack;
}