Wrapper functions introduced for configuration, loaders refactured:
[mailer.git] / inc / extensions-functions.php
index 3a4c95efe82b5af7203e74eef869edc2084f821b..9228cf4f42c2b7fd99bd6040ac28d6f4a09e4cb2 100644 (file)
@@ -1910,6 +1910,30 @@ function addConfigAddSql ($columnName, $columnSql) {
        }
 }
 
+// Drop configuration entry if found for actual extension
+function addConfigDropSql ($columnName) {
+       // Is the column there?
+       if (isSqlTableColumnFound('{?_MYSQL_PREFIX?}_config', $columnName)) {
+               // Found, so add it
+               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` DROP `' . $columnName . '`');
+       } else {
+               // Add debug line, debug_report_bug() would cause some extenion updates fail
+               logDebugMessage(__FUNCTION__, __LINE__, 'Configuration entry ' . $columnName . ' not found.');
+       }
+}
+
+// Change configuration entry for actual extension
+function addConfigChangeSql ($oldColumnName, $newColumnName, $columnSql) {
+       // Is the old column there?
+       if (isSqlTableColumnFound('{?_MYSQL_PREFIX?}_config', $oldColumnName)) {
+               // Found so add it
+               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `' . $oldColumnName . '` `' . $newColumnName . '` ' . $columnSql);
+       } else {
+               // Add debug line, debug_report_bug() would cause some extenion updates fail
+               logDebugMessage(__FUNCTION__, __LINE__, 'Configuration entry ' . $oldColumnName . ' not found.');
+       }
+}
+
 // Enables/disables productive mode for current extension (used only while
 // registration).
 // @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'