* @copyright 2005 by gERD Schaufelberger * @package wombatSite * @subpackage debugger */ /** * Debugger_Html * * @version 1.0.0 * @package wombatSite * @subpackage debugger */ class wbDebugger_Html extends wbDebugger { /** * format string for output * * @abstract * @access public * @param string $var */ function sprint( $var ) { return nl2br( $var ); } /** * capture output of print_r to add it to debug info * * @access public * @param mixed &$var * @param string $type print_r|var_dump */ function sprint_r( &$var, $type = 'print_r' ) { ob_start(); echo '
';
		$type( $var );
		echo '
'; $tmp = ob_get_contents(); ob_end_clean(); return $tmp; } /** * echo debug messages * * * @access private * @param string $part named part * @return boolean $result true on success */ function printMessages( $part = null ) { if( !$this->_active ) { return true; } $empty = true; echo '
' . '' . '' . '
' . 'Debugger::Html
' . '[Wombat Web Bench http://wombat.exit0.net]' . '

'; if( $part != null ) { $parts = array( $part ); } else { $parts = array_keys( $this->_msg ); } foreach( $parts as $part ) { if( empty( $this->_msg[$part] ) ) { continue; } $empty = false; echo '
'; echo ''.$part.''; if( !empty( $this->_msg[$part] ) ) { echo ''; for( $i = 0; $i < count( $this->_msg[$part] ); ++$i ) { echo ''; $text = wordwrap( $this->_msg[$part][$i]['text'] ); $title = htmlspecialchars( $this->_msg[$part][$i]['title'] ); echo sprintf( "\n", $title, $text ); echo ''; } echo '
%s  : %s
'; } else { echo "--- empty log ---\n"; } echo '
' . "\n"; } if( $empty ) { echo '--- empty log ---
' . "\n"; return true; } echo '' . "\n"; return true; } } ?>