// allows to truncate or drop several tables at once } if ($_POST["truncate"]) { if ($_POST["tables"]) { $result = truncate_tables($_POST["tables"]); } $message = lang('Tables have been truncated.'); } elseif ($_POST["move"]) { $result = move_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]); $message = lang('Tables have been moved.'); } elseif ($_POST["copy"]) { $result = copy_tables((array) $_POST["tables"], (array) $_POST["views"], $_POST["target"]); $message = lang('Tables have been copied.'); } elseif ($_POST["drop"]) { if ($_POST["views"]) { $result = drop_views($_POST["views"]); } if ($result && $_POST["tables"]) { $result = drop_tables($_POST["tables"]); } $message = lang('Tables have been dropped.'); } elseif ($jush != "sql") { $result = $jush == "sqlite" ? queries("VACUUM") : apply_queries("VACUUM" . ($_POST["optimize"] ? "" : " ANALYZE"), $_POST["tables"]); $message = lang('Tables have been optimized.'); } elseif (!$_POST["tables"]) { $message = lang('No tables.'); } elseif ($result = queries(($_POST["optimize"] ? "OPTIMIZE" : ($_POST["check"] ? "CHECK" : ($_POST["repair"] ? "REPAIR" : "ANALYZE"))) . " TABLE " . implode(", ", array_map('idf_escape', $_POST["tables"])))) { while ($row = $result->fetch_assoc()) { $message .= "<b>" . h($row["Table"]) . "</b>: " . h($row["Msg_text"]) . "<br>"; } }
} $db = new database($db_type); switch ($db_type) { case 'mssql': @($conn_result = $db->connect(NO_DSN, $db_server, $db_admin_name, $db_admin_pass, $db_name)); break; case 'mysql': @($conn_result = $db->connect(NO_DSN, $db_server, $db_admin_name, $db_admin_pass, $db_name)); break; case 'postgres': @($conn_result = $db->connect(NO_DSN, $db_server, $tl_db_login, $tl_db_passwd, $db_name)); break; } // -------------------------------------------------------------------------------------------- if ($install && $conn_result['status'] != 0) { drop_views($db, $db_table_prefix, $db_type); drop_tables($db, $db_table_prefix, $db_type); } // -------------------------------------------------------------------------------------------- $sqlParser = new SqlParser($db, $db_type, $db_table_prefix); foreach ($a_sql_schema as $sql_schema) { foreach ($sql_schema as $sql_file) { echo "<br />Processing:" . $sql_file; $sqlParser->process($sql_file); } echo "<br />"; } // Now data migration must be done if needed if ($migration_process != '') { require_once $migration_functions_file; $migration_process($db, $tables);