* @version 1.0.2 (July 22, 2004) * @package AutoIndex */ class Display { /** * @var string HTML text to output */ private $contents; /** * @return string The HTML text of the list of function calls * @see debug_backtrace() */ public static function get_trace() { $list = '

Debug trace:'; foreach (debug_backtrace() as $arr) { $line = (isset($arr['line']) ? $arr['line'] : 'unknown'); $file = (isset($arr['file']) ? Item::get_basename($arr['file']) : 'unknown'); $type = (isset($arr['type']) ? $arr['type'] : ''); $class = (isset($arr['class']) ? $arr['class'] : ''); $function = (isset($arr['function']) ? $arr['function'] : 'unknown'); $list .= "\n
$file line $line ($class$type$function)"; } return $list . '

'; } /** * @param string $contents Sets the HTML contents */ public function __construct(&$contents) { $this -> contents = $contents; } /** * @return string The HTML output, using the template system */ public function __toString() { $header = new Template(GLOBAL_HEADER); $footer = new Template(GLOBAL_FOOTER); $output = $header -> __toString() . $this -> contents; if (DEBUG) { $output .= self::get_trace(); } return $output . $footer -> __toString(); } } ?>