* -------------------------------------------------------------------- *
* 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 *
}
// 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);
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);
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(
* -------------------------------------------------------------------- *
* 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 *
// 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
} // 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;
postRequestElement('mysql', 'password1'),
postRequestElement('mysql', 'prefix'),
postRequestElement('mysql', 'type'),
+ postRequestElement('mysql', 'extension'),
postRequestElement('smtp_host'),
postRequestElement('smtp_user'),
postRequestElement('smtp_password1')
'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
'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:",
'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",
// Installation/setup
addMessages(array(
'ADMIN_NEW_VERSION_AVAILABLE' => "Neue Version verfügbar.",
- 'ADMIN_NO_UPDATES_AVAILABLE' => "Derzeit ist keine neuere Version als <span class=\"data\">{?FULL_VERSION?} r{?CURRENT_REPOSITORY_REVISION?}</span> verfügbar.",
+ 'ADMIN_NO_UPDATES_AVAILABLE' => "Derzeit ist keine neuere Version als <span class=\"data\">{?FULL_VERSION?}</span> 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 <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]
{--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]" />
<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]" />
{--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">