X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Finstall-inc.php;h=1631b93f876f8ebd40a986a44e34684ad3a2de38;hb=2e9e34b22b8354dba7c0bd699e5486e99a64bc58;hp=b1aeb83b02054f9accd16ad8604953a17712c9ca;hpb=67a9828dd27cb5119292e5ac99042b3fcedb0d6b;p=mailer.git diff --git a/inc/install-inc.php b/inc/install-inc.php index b1aeb83b02..1631b93f87 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -100,6 +100,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) if (empty($mysql['login'])) $mysql['login'] = "your_login"; if (empty($mysql['host'])) $mysql['host'] = "localhost"; if (empty($mysql['prefix'])) $mysql['prefix'] = "mxchange_"; + if (empty($mysql['type'])) $mysql['type'] = "MyISAM"; if (getTotalFatalErrors() > 0) { OUTPUT_HTML(""); foreach (getFatalArray() as $key => $err) { @@ -110,6 +111,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) define('__MYSQL_HOST' , $mysql['host']); define('__MYSQL_DBASE' , $mysql['dbase']); define('__MYSQL_PREFIX', $mysql['prefix']); + define('__TABLE_TYPE' , $mysql['type']); define('__MYSQL_LOGIN' , $mysql['login']); define('__SPATH_VALUE' , REQUEST_POST('spath')); define('__BURL_VALUE' , REQUEST_POST('burl')); @@ -143,6 +145,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) define('__MYSQL_HOST' , $mysql['host']); define('__MYSQL_DBASE' , $mysql['dbase']); define('__MYSQL_PREFIX' , $mysql['prefix']); + define('__TABLE_TYPE' , $mysql['type']); define('__MYSQL_LOGIN' , $mysql['login']); define('__MYSQL_PASS1' , $mysql['pass1']); define('__MYSQL_PASS2' , $mysql['pass2']); @@ -169,6 +172,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) define('__MYSQL_HOST' , $mysql['host']); define('__MYSQL_DBASE' , $mysql['dbase']); define('__MYSQL_PREFIX' , $mysql['prefix']); + define('__TABLE_TYPE' , $mysql['type']); define('__MYSQL_LOGIN' , $mysql['login']); // SMTP settings @@ -248,9 +252,9 @@ if ((!isInstalled()) || (!isAdminRegistered())) "); foreach ($mysql as $key => $value) { - OUTPUT_HTML(" "); + OUTPUT_HTML(" "); } - OUTPUT_HTML(" + OUTPUT_HTML(" @@ -279,9 +283,9 @@ if ((!isInstalled()) || (!isAdminRegistered())) // Automatically run install.sql if ((FILE_READABLE(REQUEST_POST('spath')."install/tables.sql")) && (FILE_READABLE(REQUEST_POST('spath')."install/menu-".GET_LANGUAGE().".sql"))) { // Both exists so import them - foreach (array("tables.sql", "menu-".GET_LANGUAGE().".sql") as $dump) { + foreach (array("tables", "menu-".GET_LANGUAGE()) as $dump) { // Should be save here because file_exists() is there but we check it again. :) - $FQFN = secureString(REQUEST_POST('spath')) . "install/" . $dump; + $FQFN = REQUEST_POST('spath') . "install/" . $dump . ".sql"; if (FILE_READABLE($FQFN)) { // Read the file $fileContent = READ_FILE($FQFN, true); @@ -291,6 +295,11 @@ if ((!isInstalled()) || (!isAdminRegistered())) $fileContent = str_replace("{!prefix!}", $mysql['prefix'], $fileContent); } // END - while + // Replace the {!type!} with actual one + while (strpos($fileContent, "{!type!}") !== false) { + $fileContent = str_replace("{!type!}", $mysql['type'], $fileContent); + } // END - while + // And split it up against ;\n ... SET_SQLS(merge_array(GET_SQLS(), explode(";\n", $fileContent))); } else { @@ -324,6 +333,7 @@ if ((!isInstalled()) || (!isAdminRegistered())) changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-LOGIN", " 'login' => \"", "\",", $mysql['login'], 0); changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-PASSWORD", " 'password' => \"", "\",", $mysql['pass1'], 0); changeDataInFile(REQUEST_POST('spath')."inc/config.php", "MYSQL-PREFIX", "define('_MYSQL_PREFIX', \"", "\");", $mysql['prefix'], 0); + changeDataInFile(REQUEST_POST('spath')."inc/config.php", "TABLE-TYPE", "define('_TABLE_TYPE', \"", "\");", $mysql['type'], 0); changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SMTP-HOSTNAME", "define('SMTP_HOSTNAME', \"", "\");", REQUEST_POST('smtp_host'), 0); changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SMTP-USER", "define('SMTP_USER', \"", "\");", REQUEST_POST('smtp_user'), 0); changeDataInFile(REQUEST_POST('spath')."inc/config.php", "SMTP-PASSWORD", "define('SMTP_PASSWORD', \"", "\");", REQUEST_POST('smtp_pass1'), 0);