Added stuff for PHP extension selection in both installers.
authorRoland Haeder <roland@mxchange.org>
Thu, 17 Apr 2014 21:29:53 +0000 (23:29 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 17 Apr 2014 21:29:53 +0000 (23:29 +0200)
Signed-off-by: Roland H├Ąder <roland@mxchange.org>
12 files changed:
inc/install-functions.php
inc/install-inc.php
inc/install/install_page_2.php
inc/install/install_page_3.php
inc/install/install_page_finalize.php
inc/language/de.php
inc/language/install_de.php
inc/language/mediadata_de.php
inc/language/update_de.php
templates/de/html/install/install_page2.tpl
templates/de/html/install/install_page3.tpl
templates/de/html/install/install_page_database_config.tpl

index 5f027b3..9fd326f 100644 (file)
  * -------------------------------------------------------------------- *
  * 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(
index abf378c..897adeb 100644 (file)
  * -------------------------------------------------------------------- *
  * 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                      *
index cdf02e9..450f178 100644 (file)
@@ -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
index 7a985da..1e975bb 100644 (file)
@@ -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;
index faf2911..bf8187c 100644 (file)
@@ -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')
index ac71b66..d108cf1 100644 (file)
@@ -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
index c736c61..5580ed3 100644 (file)
@@ -112,6 +112,8 @@ addMessages(array(
        'INSTALLER_MYSQL_PREFIX' => "Pr&auml;fix f&uuml;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:",
index 1be376d..4bc1f05 100644 (file)
@@ -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",
index 623a400..66c8968 100644 (file)
@@ -43,13 +43,12 @@ if (!defined('__SECURITY')) {
 // Installation/setup
 addMessages(array(
        'ADMIN_NEW_VERSION_AVAILABLE' => "Neue Version verf&uuml;gbar.",
-       'ADMIN_NO_UPDATES_AVAILABLE' => "Derzeit ist keine neuere Version als <span class=\"data\">{?FULL_VERSION?} r{?CURRENT_REPOSITORY_REVISION?}</span> verf&uuml;gbar.",
+       'ADMIN_NO_UPDATES_AVAILABLE' => "Derzeit ist keine neuere Version als <span class=\"data\">{?FULL_VERSION?}</span> verf&uuml;gbar.",
        'ADMIN_YOUR_VERSION_IS' => "Installierte Version",
        'ADMIN_ONLINE_VERSION_IS' => "Verf&uuml;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 <span class=\"data\">{?CURRENT_REPOSITORY_REVISION?}</span> ist neuer als die auf dem Server. Dies sollte nicht vorkommen, bitte melden Sie dies im Forum oder Bug-Tracker.",
 ));
 
 // [EOF]
index a030d69..4b638b0 100644 (file)
@@ -6,29 +6,34 @@
                        {--INSTALLER_PAGE_DATABASE_CONFIG_TITLE--}
                </td>
        </tr>
+
        <tr>
                <td colspan="2">
                        {--INSTALLER_DATABASE_CONFIG_DESCRIPTION--}
                </td>
        </tr>
+
        <tr>
                <td align="right" class="install_right">{--INSTALLER_MYSQL_HOST--}</td>
                <td align="left">
                        <input type="text" class="form_field" name="mysql[host]" size="25" value="$content[mysql_host]" />
                </td>
        </tr>
+
        <tr>
                <td align="right" class="install_right">{--INSTALLER_MYSQL_DBASE--}</td>
                <td align="left">
                        <input type="text" class="form_field" name="mysql[dbase]" size="25" value="$content[mysql_dbase]" />
                </td>
        </tr>
+
        <tr>
                <td align="right" class="install_right">{--INSTALLER_MYSQL_PREFIX--}</td>
                <td align="left">
                        <input type="text" class="form_field" name="mysql[prefix]" size="25" value="$content[mysql_prefix]" />
                </td>
        </tr>
+
        <tr>
                <td align="right" class="install_right">{--INSTALLER_MYSQL_ENGINE--}</td>
                <td align="left">
                        </select>
                </td>
        </tr>
+
+       <tr>
+               <td align="right" class="install_right">{--INSTALLER_MYSQL_EXTENSION--}</td>
+               <td align="left">
+                       <select name="mysql[extension]" size="1">
+                               <option value="mysql">{--INSTALLER_DATABASE_EXTENSION_MYSQL--}</option>
+                               <option value="mysqli">{--INSTALLER_DATABASE_EXTENSION_MYSQLI--}</option>
+                       </select>
+               </td>
+       </tr>
+
        <tr>
                <td align="right" class="install_right">{--INSTALLER_MYSQL_LOGIN--}</td>
                <td align="left">
                        <input type="text" class="form_field" name="mysql[login]" size="25" value="$content[mysql_login]" />
                </td>
        </tr>
+
        <tr>
                <td align="right" class="install_right">{--INSTALLER_MYSQL_PASSWORD1--}</td>
                <td align="left">
                        <input type="password" class="form_field" name="mysql[password1]" size="25" />
                </td>
        </tr>
+
        <tr>
                <td align="right" class="install_right">{--INSTALLER_MYSQL_PASSWORD2--}</td>
                <td align="left">
                        <input type="password" class="form_field" name="mysql[password2]" size="25" />
                </td>
        </tr>
+
        <tr>
                <td colspan="2" align="center" class="install_footer">
                        <input type="hidden" name="spath" value="$content[spath]" />
index 61706bd..8a96d31 100644 (file)
@@ -46,6 +46,7 @@
                        <input type="hidden" name="mysql[dbase]" value="$content[mysql_dbase]" />
                        <input type="hidden" name="mysql[prefix]" value="$content[mysql_prefix]" />
                        <input type="hidden" name="mysql[type]" value="$content[table_type]" />
+                       <input type="hidden" name="mysql[extension]" value="$content[database_extension" />
                        <input type="hidden" name="mysql[login]" value="$content[mysql_login]" />
                        <input type="hidden" name="mysql[password1]" value="$content[mysql_password1]" />
                        <input type="hidden" name="mysql[password2]" value="$content[mysql_password2]" />
index 9bdf4cb..bb50a21 100644 (file)
                        {--INSTALLER_MYSQL_ENGINE_NOTICE--}
                </div>
        </div>
+
+       <div class="clear"></div>
+
+       <div class="table_row">
+               <label class="install_label" for="database_extension">{--INSTALLER_DATABASE_EXTENSION--}</label>
+               <select id="database_extension" name="database_extension" size="1" class="form_select" onchange="return allowSaveChanges('database_extension')">
+               {%pipe,generateInstallerDatabaseExtensionOptions%}
+               </select>
+
+               <div class="field_note">
+                       {--INSTALLER_DATABASE_EXTENSION_NOTICE--}
+               </div>
+       </div>
 </fieldset>
 
 <fieldset id="login_password">