]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
Several code cleanups:
[mailer.git] / inc / extensions-functions.php
index ddc4afbb83003e7770d83a6d5b832693759dc35e..d1c46faf4268dd058cbff96565b9b3b3cff96954 100644 (file)
@@ -1349,19 +1349,19 @@ function initExtensionRuningUpdates () {
 
 // Getter for EXT_UPDATE_DEPENDS flag
 function getExtensionUpdateDependencies () {
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "currName=".getCurrentExtensionName());
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
        return $GLOBALS['ext_update_depends'][getCurrentExtensionName()];
 }
 
 // Getter for next iterator depency
 function getExtensionUpdateDependenciesIterator () {
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "currName=".getCurrentExtensionName());
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
        return ($GLOBALS['ext_update_depends'][getCurrentExtensionName()][getExtensionUpdateIterator()]);
 }
 
 // Counter for extension update depencies
 function countExtensionUpdateDependencies () {
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "currName=".getCurrentExtensionName());
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
        return count($GLOBALS['ext_update_depends'][getCurrentExtensionName()]);
 }
 
@@ -1382,7 +1382,7 @@ function removeExtensionDependency ($ext_name) {
 
 // Init iterator for update depencies
 function initExtensionUpdateIterator () {
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "currName=".getCurrentExtensionName());
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
        $GLOBALS['ext_depend_iterator'][getCurrentExtensionName()] = '0';
 }
 
@@ -1392,13 +1392,13 @@ function getExtensionUpdateIterator () {
        if (!isset($GLOBALS['ext_depend_iterator'][getCurrentExtensionName()])) initExtensionUpdateIterator();
 
        // Return it
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "currName=".getCurrentExtensionName().'/'.$GLOBALS['ext_depend_iterator'][getCurrentExtensionName()]);
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName().'/'.$GLOBALS['ext_depend_iterator'][getCurrentExtensionName()]);
        return $GLOBALS['ext_depend_iterator'][getCurrentExtensionName()];
 }
 
 // Increments the update iterator
 function incrementExtensionUpdateIterator () {
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "currName=".getCurrentExtensionName());
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'currName=' . getCurrentExtensionName());
        $GLOBALS['ext_depend_iterator'][getCurrentExtensionName()]++;
 }
 
@@ -1756,11 +1756,16 @@ function isExtensionFunctionFileReadable ($ext_name) {
 }
 
 // Adds a CREATE TABLE statement if the requested table is not there
-function addCreateTableSql ($tableName, $sql) {
+function addCreateTableSql ($tableName, $sql, $comment) {
        // Is the table not there?
        if (!isSqlTableCreated($tableName)) {
                // Is not found, so add it
-               addExtensionSql('CREATE TABLE `{?_MYSQL_PREFIX?}_' . $tableName . '` ' . $sql);
+               addExtensionSql('CREATE TABLE
+       `{?_MYSQL_PREFIX?}_' . $tableName . '` (' . $sql . ')
+ENGINE = {?_TABLE_TYPE?}
+CHARACTER SET utf8
+COLLATE utf8_general_ci
+COMMENT ' . "'" . $comment . "'");
        } else {
                // Is already there, which should not happen
                debug_report_bug(__FUNCTION__, __LINE__, 'The table ' . $tableName . ' is already created which should not happen.');