From 8729e9b2566751c19f225e86daa86730f25c49b0 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 17 Apr 2014 23:29:53 +0200 Subject: [PATCH] Added stuff for PHP extension selection in both installers. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- inc/install-functions.php | 60 ++++++++++++++++--- inc/install-inc.php | 5 -- inc/install/install_page_2.php | 21 +++---- inc/install/install_page_3.php | 15 ++--- inc/install/install_page_finalize.php | 1 + inc/language/de.php | 4 ++ inc/language/install_de.php | 2 + inc/language/mediadata_de.php | 2 - inc/language/update_de.php | 3 +- templates/de/html/install/install_page2.tpl | 19 ++++++ templates/de/html/install/install_page3.tpl | 1 + .../install/install_page_database_config.tpl | 13 ++++ 12 files changed, 111 insertions(+), 35 deletions(-) diff --git a/inc/install-functions.php b/inc/install-functions.php index 5f027b3f7e..9fd326f7e9 100644 --- a/inc/install-functions.php +++ b/inc/install-functions.php @@ -10,11 +10,6 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Funktionen fuer die Installationsroutine * * -------------------------------------------------------------------- * - * $Revision:: $ * - * $Date:: $ * - * $Tag:: 0.2.1-FINAL $ * - * $Author:: $ * - * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * @@ -82,7 +77,7 @@ function initInstaller () { } // Write the local config-local.php file from "template" -function doInstallWriteLocalConfigurationFile ($path, $url, $title, $slogan, $email, $noPassword, $writeFooter, $backLink, $databaseHost, $databaseName, $databaseLogin, $databasePassword, $databasePrefix, $databaseType, $smtpHost, $smtpUser, $smtpPassword) { +function doInstallWriteLocalConfigurationFile ($path, $url, $title, $slogan, $email, $noPassword, $writeFooter, $backLink, $databaseHost, $databaseName, $databaseLogin, $databasePassword, $databasePrefix, $tableType, $databaseExtension, $smtpHost, $smtpUser, $smtpPassword) { // Copy the config template and verify it copyFileVerified($path . 'inc/config-local.php.dist', $path . getCachePath() . 'config-local.php', 0644); @@ -110,7 +105,8 @@ function doInstallWriteLocalConfigurationFile ($path, $url, $title, $slogan, $em changeDataInLocalConfigurationFile('MYSQL-LOGIN', " 'login' => '", "',", $databaseLogin, 0); changeDataInLocalConfigurationFile('MYSQL-PASSWORD', " 'password' => '", "',", $databasePassword, 0); changeDataInLocalConfigurationFile('MYSQL-PREFIX', "setConfigEntry('_MYSQL_PREFIX', '", "');", $databasePrefix, 0); - changeDataInLocalConfigurationFile('TABLE-TYPE', "setConfigEntry('_TABLE_TYPE', '", "');", $databaseType, 0); + changeDataInLocalConfigurationFile('TABLE-TYPE', "setConfigEntry('_TABLE_TYPE', '", "');", $tableType, 0); + changeDataInLocalConfigurationFile('DATABASE-TYPE', "setConfigEntry('_DB_TYPE', '", "');", $databaseExtension, 0); changeDataInLocalConfigurationFile('SMTP-HOSTNAME', "setConfigEntry('SMTP_HOSTNAME', '", "');", $smtpHost, 0); changeDataInLocalConfigurationFile('SMTP-USER', "setConfigEntry('SMTP_USER', '", "');", $smtpUser, 0); changeDataInLocalConfigurationFile('SMTP-PASSWORD', "setConfigEntry('SMTP_PASSWORD', '", "');", $smtpPassword, 0); @@ -192,12 +188,58 @@ function generateInstallerFooterNavigation () { function generateInstallerDatabaseTypeOptions () { return generateOptions( '/ARRAY/', - array('MyISAM', 'InnoDB'), - array('{--INSTALLER_TABLE_TYPE_MYISAM--}', '{--INSTALLER_TABLE_TYPE_INNODB--}'), + array( + 'MyISAM', + 'InnoDB' + ), + array( + '{--INSTALLER_TABLE_TYPE_MYISAM--}', + '{--INSTALLER_TABLE_TYPE_INNODB--}' + ), getSession('mysql_engine') ); } +// Generate an option list for database extensions for given default value +function generateInstallerDatabaseExtensionOptions () { + // Init all arrays + $keys = array(); + $values = array(); + $foundExtensions = array(); + + // Scan directory + $drivers = getArrayFromDirectory('inc/db/', 'lib-', FALSE, FALSE); + + // Remove prefix + extension + foreach ($drivers as $key => $driver) { + // Remove driver + $drivers[$key] = substr($driver, 4, -4); + + // Is the corresponding extension loaded? + if (isPhpExtensionLoaded($drivers[$key])) { + // Then add it + array_push($foundExtensions, $drivers[$key]); + } // END - if + } // END - foreach + + // Generate list for keys/values ("translations") + foreach ($foundExtensions as $extension) { + // Use it as direct key + array_push($keys, $extension); + + // Add "translation" function around it as value + array_push($values, '{%pipe,translatePhpExtension=' . $extension . '%}'); + } // END - if + + // Get a directory list + return generateOptions( + '/ARRAY/', + $keys, + $values, + getSession('database_extension') + ); +} + // Generate an option list for output mode types for given default value function generateInstallerOutputModeOptions ($defaultValue) { return generateOptions( diff --git a/inc/install-inc.php b/inc/install-inc.php index abf378c987..897adebc57 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -10,11 +10,6 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Funktionen fuer die Installationsroutine * * -------------------------------------------------------------------- * - * $Revision:: $ * - * $Date:: $ * - * $Tag:: 0.2.1-FINAL $ * - * $Author:: $ * - * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * diff --git a/inc/install/install_page_2.php b/inc/install/install_page_2.php index cdf02e92d2..450f1787e9 100644 --- a/inc/install/install_page_2.php +++ b/inc/install/install_page_2.php @@ -59,16 +59,17 @@ if (ifFatalErrorsDetected()) { // Prepare content array $content = array( - 'mysql_host' => $GLOBALS['install_mysql']['host'], - 'mysql_dbase' => $GLOBALS['install_mysql']['dbase'], - 'mysql_prefix' => $GLOBALS['install_mysql']['prefix'], - 'mysql_login' => $GLOBALS['install_mysql']['login'], - 'table_type' => $GLOBALS['install_mysql']['type'], - 'spath' => postRequestElement('spath'), - 'burl' => postRequestElement('burl'), - 'title' => postRequestElement('title'), - 'slogan' => postRequestElement('slogan'), - 'email' => postRequestElement('email') + 'mysql_host' => $GLOBALS['install_mysql']['host'], + 'mysql_dbase' => $GLOBALS['install_mysql']['dbase'], + 'mysql_prefix' => $GLOBALS['install_mysql']['prefix'], + 'mysql_login' => $GLOBALS['install_mysql']['login'], + 'table_type' => $GLOBALS['install_mysql']['type'], + 'database_extension' => $GLOBALS['install_mysql']['extension'], + 'spath' => postRequestElement('spath'), + 'burl' => postRequestElement('burl'), + 'title' => postRequestElement('title'), + 'slogan' => postRequestElement('slogan'), + 'email' => postRequestElement('email') ); // Load template diff --git a/inc/install/install_page_3.php b/inc/install/install_page_3.php index 7a985dab61..1e975bb28a 100644 --- a/inc/install/install_page_3.php +++ b/inc/install/install_page_3.php @@ -62,13 +62,14 @@ if (isPostRequestElementSet('smtp_password')) { } // END - if // Database login data -$content['mysql_host'] = $GLOBALS['install_mysql']['host']; -$content['mysql_dbase'] = $GLOBALS['install_mysql']['dbase']; -$content['mysql_prefix'] = $GLOBALS['install_mysql']['prefix']; -$content['table_type'] = $GLOBALS['install_mysql']['type']; -$content['mysql_login'] = $GLOBALS['install_mysql']['login']; -$content['mysql_password1'] = $GLOBALS['install_mysql']['password1']; -$content['mysql_password2'] = $GLOBALS['install_mysql']['password2']; +$content['mysql_host'] = $GLOBALS['install_mysql']['host']; +$content['mysql_dbase'] = $GLOBALS['install_mysql']['dbase']; +$content['mysql_prefix'] = $GLOBALS['install_mysql']['prefix']; +$content['table_type'] = $GLOBALS['install_mysql']['type']; +$content['database_extension'] = $GLOBALS['install_mysql']['extension']; +$content['mysql_login'] = $GLOBALS['install_mysql']['login']; +$content['mysql_password1'] = $GLOBALS['install_mysql']['password1']; +$content['mysql_password2'] = $GLOBALS['install_mysql']['password2']; // Set constants for SMTP data $content['smtp_host'] = $smtpHost; diff --git a/inc/install/install_page_finalize.php b/inc/install/install_page_finalize.php index faf29112a7..bf8187cd00 100644 --- a/inc/install/install_page_finalize.php +++ b/inc/install/install_page_finalize.php @@ -134,6 +134,7 @@ if ((isPostRequestElementSet('finalize')) && (!isInstalled())) { postRequestElement('mysql', 'password1'), postRequestElement('mysql', 'prefix'), postRequestElement('mysql', 'type'), + postRequestElement('mysql', 'extension'), postRequestElement('smtp_host'), postRequestElement('smtp_user'), postRequestElement('smtp_password1') diff --git a/inc/language/de.php b/inc/language/de.php index ac71b66d48..d108cf1467 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1416,6 +1416,10 @@ addMessages(array( 'PASSWORD_SCORE_3' => "Mittel", 'PASSWORD_SCORE_4' => "Stark", 'PASSWORD_SCORE_5' => "Sehr stark", + + // PHP extensions used (mostly database) + 'PHP_EXTENSION_MYSQL' => "MySQL (veraltet)", + 'PHP_EXTENSION_MYSQLI' => "MySQLi (Standardauswahl)", )); // Description of all months diff --git a/inc/language/install_de.php b/inc/language/install_de.php index c736c6126c..5580ed31ed 100644 --- a/inc/language/install_de.php +++ b/inc/language/install_de.php @@ -112,6 +112,8 @@ addMessages(array( 'INSTALLER_MYSQL_PREFIX' => "Präfix für alle Tabellen:", 'INSTALLER_MYSQL_ENGINE' => "Tabellentyp:", 'INSTALLER_MYSQL_ENGINE_NOTICE' => "MyISAM ist meistens ausreichend.", + 'INSTALLER_DATABASE_EXTENSION' => "PHP-Extension f. Anbindung:", + 'INSTALLER_DATABASE_EXTENSION_NOTICE' => "Bei neuen Servern (PHP +5.5) sollte immer MySQLi verwendet werden.", '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:", diff --git a/inc/language/mediadata_de.php b/inc/language/mediadata_de.php index 1be376dcf0..4bc1f052ac 100644 --- a/inc/language/mediadata_de.php +++ b/inc/language/mediadata_de.php @@ -71,8 +71,6 @@ addMessages(array( 'MEDIA_DATA_SCRIPT' => "Daten zur verwendeten Software", 'ENGINE_SOFTWARE' => "Verwendete Engine", 'ENGINE_VERSION' => "Installierte Version", - 'ENGINE_REVISION' => "Installierte Revision", - 'ENGINE_REVISION_CREATED' => "Revision erstellt", // Admin area 'ADMIN_CONFIG_MEDIADATA_TITLE' => "Einstellungen zu den Mediendaten", diff --git a/inc/language/update_de.php b/inc/language/update_de.php index 623a400eb4..66c896896a 100644 --- a/inc/language/update_de.php +++ b/inc/language/update_de.php @@ -43,13 +43,12 @@ if (!defined('__SECURITY')) { // Installation/setup addMessages(array( 'ADMIN_NEW_VERSION_AVAILABLE' => "Neue Version verfügbar.", - 'ADMIN_NO_UPDATES_AVAILABLE' => "Derzeit ist keine neuere Version als {?FULL_VERSION?} r{?CURRENT_REPOSITORY_REVISION?} verfügbar.", + 'ADMIN_NO_UPDATES_AVAILABLE' => "Derzeit ist keine neuere Version als {?FULL_VERSION?} verfügbar.", 'ADMIN_YOUR_VERSION_IS' => "Installierte Version", 'ADMIN_ONLINE_VERSION_IS' => "Verfügbare Version", 'ADMIN_UPDATE_CREATE_TIME' => "Update wurde erstellt", 'ADMIN_DOWNLOAD_NEW_VERSION' => "Jetzt neue Version herunterladen.", 'ADMIN_CANNOT_CHECK_VERSION' => "Konnte Versionsnummer nicht abgleichen! (Fehlende Internet-Verbindung? Server ist down?)", - 'ADMIN_LOCAL_REVISION_IS_NEWER_THAN_UPDATE' => "Die auf Ihrem installierte Revision {?CURRENT_REPOSITORY_REVISION?} ist neuer als die auf dem Server. Dies sollte nicht vorkommen, bitte melden Sie dies im Forum oder Bug-Tracker.", )); // [EOF] diff --git a/templates/de/html/install/install_page2.tpl b/templates/de/html/install/install_page2.tpl index a030d69f7a..4b638b0658 100644 --- a/templates/de/html/install/install_page2.tpl +++ b/templates/de/html/install/install_page2.tpl @@ -6,29 +6,34 @@ {--INSTALLER_PAGE_DATABASE_CONFIG_TITLE--} + {--INSTALLER_DATABASE_CONFIG_DESCRIPTION--} + {--INSTALLER_MYSQL_HOST--} + {--INSTALLER_MYSQL_DBASE--} + {--INSTALLER_MYSQL_PREFIX--} + {--INSTALLER_MYSQL_ENGINE--} @@ -38,24 +43,38 @@ + + + {--INSTALLER_MYSQL_EXTENSION--} + + + + + {--INSTALLER_MYSQL_LOGIN--} + {--INSTALLER_MYSQL_PASSWORD1--} + {--INSTALLER_MYSQL_PASSWORD2--} + diff --git a/templates/de/html/install/install_page3.tpl b/templates/de/html/install/install_page3.tpl index 61706bdcab..8a96d319fe 100644 --- a/templates/de/html/install/install_page3.tpl +++ b/templates/de/html/install/install_page3.tpl @@ -46,6 +46,7 @@ + diff --git a/templates/de/html/install/install_page_database_config.tpl b/templates/de/html/install/install_page_database_config.tpl index 9bdf4cb83d..bb50a21859 100644 --- a/templates/de/html/install/install_page_database_config.tpl +++ b/templates/de/html/install/install_page_database_config.tpl @@ -41,6 +41,19 @@ {--INSTALLER_MYSQL_ENGINE_NOTICE--} + +
+ +
+ + + +
+ {--INSTALLER_DATABASE_EXTENSION_NOTICE--} +
+
-- 2.39.5