]> git.mxchange.org Git - mailer.git/commitdiff
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 5f027b3f7e1bf44e9e349f585a808337f2c0778f..9fd326f7e9dc5d059323845269fff44604aeb706 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 abf378c987c7ceb7d635fafe17fa3f94c3da61fb..897adebc57d8c35d5f5947fdd8b1f224f2b7017a 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 cdf02e92d240428e7bece2ea70d951ebe3cc1bc3..450f1787e97070c634dd31d16c0be1e9b60e81a6 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 7a985dab6195e8bbbac99da0f4d093cd1b2c39df..1e975bb28ab4b865475dabedb24b6b78ad76ad60 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 faf29112a719416e36cc50224f9e26ddf8d61d3c..bf8187cd00b18b588603948defa26d99e9ff2ed7 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 ac71b66d4862d30be3a1ecbba824c68340663ee5..d108cf146772cef20ee28f8d5244eae52b7a5862 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 c736c6126c971b4969d6e4cc9fcd1b658d1abb0c..5580ed31ed60caeaa1d4aecd4c193ee612831a5e 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 1be376dcf0c7b9d4e3560bb14bda99c4de5365db..4bc1f052ac927569c7323d73df6350155f45dc16 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 623a400eb4688caa21505e29a55465b8fa43d77a..66c896896a2262e3eac1b3f3e5f09891d8347255 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 a030d69f7ac6779152b243437d9aa3fb9cab288e..4b638b06582d052bd29af9ad2e0c25d51e3d9717 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 61706bdcab5783360ffafca7f540afa6a3b777c5..8a96d319fe8fce9a262f096ae76ced334fe47cb8 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 9bdf4cb83dd196381c8f86b94cc08cdae07443d3..bb50a2185963276f8a167312c9c96d48be6ff608 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">