diff -r acf6f55bf023 -r dd659f6ba891 install.php --- a/install.php Tue Jun 26 22:01:17 2007 -0400 +++ b/install.php Wed Jun 27 00:59:42 2007 -0400 @@ -1044,11 +1044,45 @@ // Not anymore!! :-D // $schema = str_replace('{{BETA_VERSION}}', ENANO_BETA_VERSION, $schema); - if(isset($_POST['wiki_mode'])) $schema = str_replace('{{WIKI_MODE}}', '1', $schema); - else $schema = str_replace('{{WIKI_MODE}}', '0', $schema); + if(isset($_POST['wiki_mode'])) + { + $schema = str_replace('{{WIKI_MODE}}', '1', $schema); + } + else + { + $schema = str_replace('{{WIKI_MODE}}', '0', $schema); + } // Build an array of queries + $schema = explode("\n", $schema); + + foreach ( $schema as $i => $sql ) + { + $query =& $schema[$i]; + $t = trim($query); + if ( empty($t) || preg_match('/^(\#|--)/i', $t) ) + { + unset($schema[$i]); + unset($query); + } + } + + $schema = array_values($schema); + $schema = implode("\n", $schema); $schema = explode(";\n", $schema); + + foreach ( $schema as $i => $sql ) + { + $query =& $schema[$i]; + if ( substr($query, ( strlen($query) - 1 ), 1 ) != ';' ) + { + $query .= ';'; + } + } + + // echo '
' . htmlspecialchars(print_r($schema, true)) . ''; + // break; + echo 'done!