X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Finstall-inc.php;h=51d2fa1a2b3b171b9ef720550fe7704cc69e3667;hp=1b8d1f486c1219b135e18b62ac8f6415cfe80e74;hb=2a54b10c7d9da3b47d245b2911bed17b21a70414;hpb=5ae157f2010b3aae3c6f2ecdc6ec7c30b305be4a diff --git a/inc/install-inc.php b/inc/install-inc.php index 1b8d1f486c..51d2fa1a2b 100644 --- a/inc/install-inc.php +++ b/inc/install-inc.php @@ -1,7 +1,7 @@ "); - $_GET['page'] = 3; + addToInstallContent('
'.print_r(getSqls(), true).''); + + // Are some SQLs found? + if (countSqls() == '0') { + // Abort here + addFatalMessage(__FILE__, __LINE__, getMessage('INSTALL_SQL_IMPORT_FAILED')); + return; } // END - if - } // END - foreach - - // Ok, all done. So we can write the config data to the php files - if ($_POST['spath'] != constant('PATH')) changeDataInFile($_POST['spath']."inc/config.php", "SERVER-PATH", "define('PATH', \"", "\");", $_POST['spath'], 0); - if ($_POST['burl'] != constant('URL')) changeDataInFile($_POST['spath']."inc/config.php", "HOST-URL", "define('URL', \"", "\");", $_POST['burl'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "MAIN_TITLE", "define('MAIN_TITLE', \"", "\");", $_POST['title'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "SLOGAN", "define('SLOGAN', \"", "\");", $_POST['slogan'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "WEBMASTER", "define('WEBMASTER', \"", "\");", $_POST['email'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "NULLPASS-WARNING", "define('warn_no_pass', ", ");", $_POST['warn_no_pass'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "WRITE-FOOTER", "define('WRITE_FOOTER', ", ");", $_POST['wfooter'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "BACKLINK", "define('ENABLE_BACKLINK', ", ");", $_POST['blink'], 0); - // changeDataInFile($_POST['spath']."inc/config.php", "OUTPUT-MODE", "define('OUTPUT_MODE', \"", "\");", $_POST['omode'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "MYSQL-HOST", " 'host' => \"", "\",", $mysql['host'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "MYSQL-DBASE", " 'dbase' => \"", "\",", $mysql['dbase'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "MYSQL-LOGIN", " 'login' => \"", "\",", $mysql['login'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "MYSQL-PASSWORD", " 'password' => \"", "\",", $mysql['pass1'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "MYSQL-PREFIX", "define('_MYSQL_PREFIX', \"", "\");", $mysql['prefix'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "SMTP-HOSTNAME", "define('SMTP_HOSTNAME', \"", "\");", $_POST['smtp_host'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "SMTP-USER", "define('SMTP_USER', \"", "\");", $_POST['smtp_user'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "SMTP-PASSWORD", "define('SMTP_PASSWORD', \"", "\");", $_POST['smtp_pass'], 0); - changeDataInFile($_POST['spath']."inc/config.php", "INSTALLED", "define('mxchange_installed', ", ");", "true", 0); - } else { - // Installation area not found! - addFatalMessage(getMessage('INSTALL_MISSING_DUMPS')); - } + + // Now run all queries through and try to keep out empty or comment queries + runFilterChain('run_sqls'); + + // Copy the config template and verify it + doInstallWriteLocalConfig(); + } // END - if + } // END - if } // END - if - } // END - if - if (getTotalFatalErrors() > 0) { - $OUT = ""; - foreach ($FATAL as $value) { - $OUT .= "