]> git.mxchange.org Git - mailer.git/blobdiff - inc/install-functions.php
Fixes for installation phase
[mailer.git] / inc / install-functions.php
index 8ef45388ab1b3435d1ecbd357766ed548f39c324..0b5152c99c0c3fb34eaa878900c606a203dd2379 100644 (file)
@@ -54,7 +54,7 @@ function initInstaller () {
                'mysql_host'      => 'database_config',
                'mysql_dbase'     => 'database_config',
                'mysql_prefix'    => 'database_config',
-               'mysql_type'      => 'database_config',
+               'mysql_engine'      => 'database_config',
                'mysql_login'     => 'database_config',
                'mysql_password1' => 'database_config',
                'mysql_password2' => 'database_config',
@@ -179,7 +179,7 @@ function generateInstallerDatabaseTypeOptions () {
                '/ARRAY/',
                array('MyISAM', 'InnoDB'),
                array('{--INSTALLER_TABLE_TYPE_MYISAM--}', '{--INSTALLER_TABLE_TYPE_INNODB--}'),
-               getSession('mysql_type')
+               getSession('mysql_engine')
        );
 }
 
@@ -401,7 +401,7 @@ function isInstallerMysqlHostValid ($value) {
        return $isValid;
 }
 
-// Call-back function to check validity of 'mysql_type'
+// Call-back function to check validity of 'mysql_engine'
 function isInstallerMysqlTypeValid ($value) {
        // This value must be 'MyISAM' or 'InnoDB'
        $isValid = in_array($value, array('MyISAM', 'InnoDB'));
@@ -459,6 +459,11 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
                // Could not find database
                $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_SELECT_FAILED--}';
                array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_dbase');
+
+               // Disconnect here, we don't need idle database connections laying around
+               SQL_CLOSE(__FUNCTION__, __LINE__);
+
+               // Abort here
                return FALSE;
        } // END - if
 
@@ -467,18 +472,28 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
        setConfigEntry('_MYSQL_PREFIX', postRequestElement('mysql_prefix'));
 
        // Get an array of all supported engines
-       $engines = getArrayFromSupportedSqlEngines();
+       $engines = getArrayFromSupportedSqlEngines(postRequestElement('mysql_engine'));
 
        // Is this an array?
        if (!is_array($engines)) {
                // Something bad happened
                $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_ENGINES_SQL_ERROR--}';
-               array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
+               array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_engine');
+
+               // Disconnect here, we don't need idle database connections laying around
+               SQL_CLOSE(__FUNCTION__, __LINE__);
+
+               // Abort here
                return FALSE;
        } elseif (count($engines) == 0) {
                // No engine is active
                $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_NO_ENGINES_ACTIVE--}';
-               array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
+               array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_engine');
+
+               // Disconnect here, we don't need idle database connections laying around
+               SQL_CLOSE(__FUNCTION__, __LINE__);
+
+               // Abort here
                return FALSE;
        }
 
@@ -488,7 +503,7 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
                $engineValid = FALSE;
 
                // Is the engine there?
-               if (strtolower($engineArray['Engine']) == strtolower(postRequestElement('mysql_type'))) {
+               if (strtolower($engineArray['Engine']) == strtolower(postRequestElement('mysql_engine'))) {
                        // Okay, engine is found
                        $engineValid = TRUE;
                        break;
@@ -499,7 +514,12 @@ function isInstallerPostDatabaseConfigValid ($currentTab) {
        if ($engineValid === FALSE) {
                // Requested engine is not active
                $GLOBALS['installer_post_error'][$currentTab] = '{--INSTALLER_POST_DATABASE_ENGINE_UNSUPPORTED--}';
-               array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_type');
+               array_push($GLOBALS['installer_failed_fields'][$currentTab], 'mysql_engine');
+
+               // Disconnect here, we don't need idle database connections laying around
+               SQL_CLOSE(__FUNCTION__, __LINE__);
+
+               // Abort here
                return FALSE;
        } // END - if