+
+ // Close SQL link
+ SQL_CLOSE(__FUNCTION__, __LINE__);
+}
+
+// Call-back function to import menu SQL file
+function doAjaxInstallerStepImportMenuSql () {
+ // Establish database link
+ establishAjaxInstallerDatabaseLink();
+
+ // Init SQL array
+ initSqls();
+
+ // Import tables.sql
+ importInstallSqlDump('menu-' . getLanguage());
+
+ // Are some SQLs found?
+ if (countSqls() == 0) {
+ // Abort here
+ reportBug(__FUNCTION__, __LINE__, '{--INSTALLER_SQL_IMPORT_FAILED--}');
+ } // END - if
+
+ // Now run all queries through
+ runFilterChain('run_sqls');
+
+ // Close SQL link
+ SQL_CLOSE(__FUNCTION__, __LINE__);
+}
+
+// Call-back function to install some important extensions
+function doAjaxInstallerStepInstallExtensions () {
+ // Only one element is required
+ if (!isSessionVariableSet('extensions')) {
+ // Some required session data is not set
+ reportBug(__FUNCTION__, __LINE__, 'Required session data for this step not found.');
+ } // END - if
+
+ // Establish database link
+ establishAjaxInstallerDatabaseLink();
+
+ // Get all extensions
+ $extensions = explode(':', getSession('extensions'));
+
+ // Make sure ext-sql_patches is first
+ array_unshift($extensions, 'sql_patches');
+
+ // "Walk" through all extensions
+ foreach ($extensions as $key => $ext_name) {
+ // Is ext-sql_patches not at key=0?
+ if (($key == 0) && ($ext_name == 'sql_patches')) {
+ // Then skip this entry
+ continue;
+ } elseif ((!loadExtension($ext_name, 'test', '0.0.0', TRUE)) || (!registerExtension($ext_name, NULL))) {
+ // Didn't work
+ reportBug(__FUNCTION__, __LINE__, 'Cannot load/register extension ' . $ext_name . '.');
+ } // END - if
+ } // END - foreach
+
+ // Close SQL link
+ SQL_CLOSE(__FUNCTION__, __LINE__);
+}
+
+// Call-back function to write local configuration file
+function doAjaxInstallerStepWriteLocalConfig () {
+ // Is all set?
+ if (!isSessionDataSet(array('base_path', 'base_url', 'main_title', 'slogan', 'webmaster', 'mysql_host', 'mysql_dbase', 'mysql_prefix', 'mysql_login', 'mysql_password1', 'mysql_password2', 'mysql_engine', 'output_mode', 'warn_no_pass', 'write_footer', 'enable_backlink'))) {
+ // Some required session data is not set
+ reportBug(__FUNCTION__, __LINE__, 'Required session data for this step not found.');
+ } // END - if
+
+ // Write config file
+ if (!doInstallWriteLocalConfigurationFile(
+ getSession('base_path'),
+ getSession('base_url'),
+ getSession('main_title'),
+ getSession('slogan'),
+ getSession('webmaster'),
+ getSession('warn_no_pass'),
+ getSession('write_footer'),
+ getSession('enable_backlink'),
+ getSession('mysql_host'),
+ getSession('mysql_dbase'),
+ getSession('mysql_login'),
+ getSession('mysql_password1'),
+ getSession('mysql_prefix'),
+ getSession('mysql_engine'),
+ getSession('smtp_host'),
+ getSession('smtp_user'),
+ getSession('smtp_password1')
+ )) {
+ // Something bad went wrong
+ removeFile(getSession('base_path') . getCachePath() . 'config-local.php');
+ reportBug(__FUNCTION__, __LINE__, 'Did not fully write config-local.php .');
+ }