return ($GLOBALS['cache_array']['extension']['ext_func'][$ext_name] == 'Y');
}
+// Adds a CREATE TABLE statement if the requested table is not there
+function addCreateTableSql ($tableName, $sql) {
+ // Is the table not there?
+ if (!isSqlTableCreated($tableName)) {
+ // Is not found, so add it
+ addExtensionSql('CREATE TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '` ' . $sql);
+ } else {
+ // Is already there, which should not happen
+ debug_report_bug(__FUNCTION__, __LINE__, 'The table ' . $tableName . ' is already created which should not happen.');
+ }
+}
+
// Adds a DROP TABLE statement if the requested tabled is there
-function addDropTableSql ($table) {
+function addDropTableSql ($tableName) {
// Is the table there?
- if (isSqlTableCreated($table)) {
+ if (isSqlTableCreated($tableName)) {
// Then add it, non-existing tables can be ignored because it will
// happen with every newly installed extension.
- addExtensionSql('DROP TABLE `{?_MYSQL_PREFIX?}_' . $table . '`');
+ addExtensionSql('DROP TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '`');
+
+ // Mark it as gone
+ $GLOBALS['isSqlTableCreated'][$tableName] = false;
} // END - if
}