arrErrorList[$this->errors]['command'] = $strCommand; $this->arrErrorList[$this->errors]['message'] = $strMessage; $this->arrErrorList[$this->errors]['line'] = $intLine; $this->arrErrorList[$this->errors]['file'] = basename( $strFile ); $this->errors++; } /** * * ErrorsAsHTML() * * @param - * * @return string string which contains a HTML table which can be used to echo out the errors * **/ function ErrorsAsHTML() { $strHTMLString = ""; $strWARNString = ""; $strHTMLhead = "\n" . " \n" . " \n" . " \n" . " \n" . " \n" . " \n"; $strHTMLfoot = "
FileLineCommandMessage
"; if( $this->errors > 0 ) { foreach( $this->arrErrorList as $arrLine ) { if( $arrLine['command'] == "WARN" ) { $strWARNString .= "WARNING: " . htmlspecialchars( $arrLine['message'] ) . "
\n"; } else { $strHTMLString .= " \n" . " " . htmlspecialchars( $arrLine['file'] ) . "\n" . " " . $arrLine['line'] . "\n" . " " . htmlspecialchars( $arrLine['command'] ) . "\n" . " " . htmlspecialchars( $arrLine['message'] ) . "\n" . " \n"; } } } if( !empty( $strHTMLString ) ) { $strHTMLString = $strWARNString . $strHTMLhead . $strHTMLString . $strHTMLfoot; } else { $strHTMLString = $strWARNString; } return $strHTMLString; } /** * * ErrorsExist() * * @param - * * @return true there are errors logged * false no errors logged * **/ function ErrorsExist() { if( $this->errors > 0 ) { return true; } else { return false; } } } ?>