]> git.mxchange.org Git - mailer.git/commitdiff
Fixes for installation phase
authorRoland Häder <roland@mxchange.org>
Thu, 8 Nov 2012 22:42:13 +0000 (22:42 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 8 Nov 2012 22:42:13 +0000 (22:42 +0000)
.gitattributes
inc/ajax/ajax_installer.php
inc/db/lib-mysql3.php
inc/install-functions.php
inc/language/install_de.php
templates/de/html/install/install_header.tpl [new file with mode: 0644]
templates/de/html/install/install_page2.tpl
templates/de/html/install/install_page_database_config.tpl

index b758bbec432c566d3045c67a6b071405555fec21..a1f294a5e6860634398671b72d3dbd88638421c7 100644 (file)
@@ -1816,6 +1816,7 @@ templates/de/html/install/install_fatal_row.tpl svneol=native#text/plain
 templates/de/html/install/install_fatal_table.tpl svneol=native#text/plain
 templates/de/html/install/install_finished.tpl svneol=native#text/plain
 templates/de/html/install/install_footer.tpl svneol=native#text/plain
+templates/de/html/install/install_header.tpl -text
 templates/de/html/install/install_main_ajax.tpl svneol=native#text/plain
 templates/de/html/install/install_main_plain.tpl svneol=native#text/plain
 templates/de/html/install/install_menu.tpl svneol=native#text/plain
index d6041f458c1aae399de680d296ecc30352c5ef8e..f6fd6e781108444c5aeeed2a8682bf851727d944 100644 (file)
@@ -333,10 +333,10 @@ function doAjaxPrepareInstallerDatabaseConfig () {
                setSession('mysql_pass2', '');
        } // END - if
 
-       // Is 'mysql_type' not set?
-       if (!isSessionVariableSet('mysql_type')) {
+       // Is 'mysql_engine' not set?
+       if (!isSessionVariableSet('mysql_engine')) {
                // Then set it directly
-               setSession('mysql_type', 'MyISAM');
+               setSession('mysql_engine', 'MyISAM');
        } // END - if
 }
 
index d586a0aebe46452c2b443ded6a804cf381612d41..8715bc7b4a796de68afc2fa102a5526dc515936c 100644 (file)
@@ -718,7 +718,7 @@ function getLastSqlError () {
 }
 
 // Gets an array (or false if none is found) from all supported engines
-function getArrayFromSupportedSqlEngines ($support = 'YES') {
+function getArrayFromSupportedSqlEngines ($requestedEngine = 'ALL') {
        // Init array
        $engines = array();
 
@@ -726,16 +726,19 @@ function getArrayFromSupportedSqlEngines ($support = 'YES') {
        $result = SQL_QUERY('SHOW ENGINES', __FUNCTION__, __LINE__);
 
        // Are there entries? (Bad if not)
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Load all and check for active entries
                while ($content = SQL_FETCHARRAY($result)) {
+                       // Debug message
+                       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'support=' . $requestedEngine . ',Engine=' . $content['Engine'] . ',Support=' . $content['Support']);
+
                        // Is this supported?
-                       if (($support == 'ALL') || ($content['Support'] == $support)) {
+                       if ((($requestedEngine == 'ALL') || ($content['Engine'] == $requestedEngine)) && (in_array($content['Support'], array('YES', 'DEFAULT')))) {
                                // Add it
                                array_push($engines, $content);
                        } elseif (isDebugModeEnabled()) {
                                // Log it away in debug mode
-                               logDebugMessage(__FUNCTION__, __LINE__, 'Engine ' . $content['Engine'] . ' is not supported (' . $content['Supported'] . ' - ' . $support . ')');
+                               logDebugMessage(__FUNCTION__, __LINE__, 'Engine ' . $content['Engine'] . ' is not supported (' . $content['Supported'] . ' - ' . $requestedEngine . ')');
                        }
                } // END - if
        } else {
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
 
index a392326f63746b7483908244ae5d4b883a5e63b0..c3cfb87c0081072e77ead02331ceda53e5658649 100644 (file)
@@ -103,8 +103,8 @@ addMessages(array(
        'INSTALLER_MYSQL_HOST' => "Server-Hostname:",
        'INSTALLER_MYSQL_DBASE' => "Datenbank:",
        'INSTALLER_MYSQL_PREFIX' => "Pr&auml;fix f&uuml;r alle Tabellen:",
-       'INSTALLER_MYSQL_TABLE_TYPE' => "Tabellentyp:",
-       'INSTALLER_MYSQL_TABLE_TYPE_NOTICE' => "MyISAM ist meistens ausreichend.",
+       'INSTALLER_MYSQL_ENGINE' => "Tabellentyp:",
+       'INSTALLER_MYSQL_ENGINE_NOTICE' => "MyISAM ist meistens ausreichend.",
        'INSTALLER_TABLE_TYPE_MYISAM' => "MyISAM (langsamer, da Tabelle gelockt wird)",
        'INSTALLER_TABLE_TYPE_INNODB' => "InnoDB (schneller, da zweilenweis gelockt wird)",
        'INSTALLER_MYSQL_LOGIN' => "Ihr Loginname:",
@@ -169,7 +169,7 @@ addMessages(array(
        'INSTALLER_CHANGED_ELEMENT_MYSQL_HOST' => "Sie haben den Hostnamen f&uuml;r die Datenbankverbindung ge&auml;ndert.",
        'INSTALLER_CHANGED_ELEMENT_MYSQL_DBASE' => "Sie haben den Datenbanknamen f&uuml;r die Datenbankverbindung ge&auml;ndert.",
        'INSTALLER_CHANGED_ELEMENT_MYSQL_PREFIX' => "Sie haben den Tabellenpr&auml;fix f&uuml;r die Datenbankverbindung ge&auml;ndert.",
-       'INSTALLER_CHANGED_ELEMENT_MYSQL_TYPE' => "Sie haben den Tabellentyp f&uuml;r die Datenbankverbindung ge&auml;ndert.",
+       'INSTALLER_CHANGED_ELEMENT_MYSQL_ENGINE' => "Sie haben die Datenbank-Engine f&uuml;r die Datenbankverbindung ge&auml;ndert.",
        'INSTALLER_CHANGED_ELEMENT_MYSQL_LOGIN' => "Sie haben den Login f&uuml;r die Datenbankverbindung ge&auml;ndert.",
        'INSTALLER_CHANGED_ELEMENT_MYSQL_PASSWORD1' => "Sie haben das Passwort f&uuml;r die Datenbankverbindung ge&auml;ndert.",
        'INSTALLER_CHANGED_ELEMENT_MYSQL_PASSWORD2' => "Sie haben die Passwortwiederholung f&uuml;r die Datenbankverbindung ge&auml;ndert.",
diff --git a/templates/de/html/install/install_header.tpl b/templates/de/html/install/install_header.tpl
new file mode 100644 (file)
index 0000000..11f5d85
--- /dev/null
@@ -0,0 +1 @@
+<!-- @DEPRECATED //-->
index 63e66ccfa39170c1a72d9b87159a9de9d29b5158..92e29759f28f9daf8c83c2ef07273af4924ae2e6 100644 (file)
@@ -30,7 +30,7 @@
                </td>
        </tr>
        <tr>
-               <td align="right" class="install_right">{--INSTALLER_MYSQL_TABLE_TYPE--}</td>
+               <td align="right" class="install_right">{--INSTALLER_MYSQL_ENGINE--}</td>
                <td align="left">
                        <select name="mysql[type]" size="1">
                                <option value="MyISAM">{--INSTALLER_TABLE_TYPE_MYISAM--}</option>
index 58576759f98144b9c5c777237295ea51193cc7f9..337c06af2ac94dd1cb1abc7459bfbc242d3b4d1d 100644 (file)
        </div>
 
        <div class="table_row">
-               <label class="install_label" for="mysql_type">{--INSTALLER_MYSQL_TABLE_TYPE--}</label>
-               <select id="mysql_type" name="mysql_type" size="1" class="form_select" onchange="return allowSaveChanges('mysql_type')">
+               <label class="install_label" for="mysql_engine">{--INSTALLER_MYSQL_ENGINE--}</label>
+               <select id="mysql_engine" name="mysql_engine" size="1" class="form_select" onchange="return allowSaveChanges('mysql_engine')">
                {%pipe,generateInstallerDatabaseTypeOptions%}
                </select>
 
                <div class="field_note">
-                       {--INSTALLER_MYSQL_TABLE_TYPE_NOTICE--}
+                       {--INSTALLER_MYSQL_ENGINE_NOTICE--}
                </div>
        </div>
 </fieldset>