X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions-functions.php;h=9228cf4f42c2b7fd99bd6040ac28d6f4a09e4cb2;hp=3a4c95efe82b5af7203e74eef869edc2084f821b;hb=c6e62b16b4474ead6b180a5b9648906459d846da;hpb=ec9f020e34a9f2029a2ea0969564dda015beca8a diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index 3a4c95efe8..9228cf4f42 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -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'