function error($message, $parser, $line = 0) { // if line argument is provided ==> display current line and line number global $err; global $line_buffer; global $log_hawxy_errors; global $error_skin; $myDeck = new HAW_deck($err[4]); if ($error_skin) { $myDeck->use_simulator("http://www.hawhaw.de/skin/error/skin.css"); } if ($line > 0) { // add line number to message $message = $err[10] . " " . $line . ": " . $message; } $myText2 = new HAW_text($message, HAW_TEXTFORMAT_BOLD); $myDeck->add_text($myText2); if ($line > 0) { // display wrong line $myRule = new HAW_rule(); $myDeck->add_rule($myRule); $wrong = new HAW_text($line_buffer[$line - 1]); $myDeck->add_text($wrong); } $myDeck->set_width("80%"); $myDeck->create_page(); xml_parser_free($parser); if ($log_hawxy_errors == true) { error_log("Hawxy error: " . $message); } exit; // there is nothing else to do }
{ if (!($dirhandle = @opendir($directory))) { return; } while (false !== ($filename = readdir($dirhandle))) { if ($filename != '.' && $filename != '..') { $filename = $directory . '/' . $filename; if (!unlink($filename)) { echo 'Error deleting ' . $filename; } } } } $db = NewADOConnection(CAMILA_DB_DSN); $page = new HAW_deck('DB Init (reset)'); $page->use_simulator(''); if (is_dir(CAMILA_TABLES_DIR)) { if ($dh = opendir(CAMILA_TABLES_DIR)) { while (($file = readdir($dh)) !== false) { if ($file != '.' && $file != '..' && substr($file, -3) == 'xml') { $result = create_table(CAMILA_TABLES_DIR . '/' . $file, CAMILA_APPLICATION_PREFIX, $db); if ($result['result'] == 2) { $text = new HAW_text($file . ' - OK'); } else { $text = new HAW_text($file . ' - KO - ' . $result['sql'], HAW_TEXTFORMAT_BOLD); } $page->add_text($text); } } closedir($dh); }