📄 header_php.php
字号:
echo '<br>123='.$dbinfo->version123;
echo '<br>124='.$dbinfo->version124;
echo '<br>125='.$dbinfo->version125;
echo '<br>126='.$dbinfo->version126;
echo '<br>127='.$dbinfo->version127;
echo '<br>130='.$dbinfo->version130;
echo '<br>1301='.$dbinfo->version1301;
echo '<br>1302='.$dbinfo->version1302;
echo '<br>135='.$dbinfo->version135;
echo '<br>136='.$dbinfo->version136;
echo '<br>137='.$dbinfo->version137;
echo '<br>138='.$dbinfo->version138;
echo '<br>';
}
// IF FORM WAS SUBMITTED, CHECK SELECTIONS AND PERFORM THEM
if (isset($_POST['submit'])) {
$sniffer_text = '';
$sniffer_version = '';
$nothing_to_process = false;
if (is_array($_POST['version'])) {
if (ZC_UPG_DEBUG2==true) foreach($_POST['version'] as $value) { echo 'Selected: ' . $value.'<br />';}
reset($_POST['version']);
while (list(, $value) = each($_POST['version'])) {
$sniffer_file = '';
switch ($value) {
case '1.0.4': // upgrading from v1.0.4 to 1.1.1
if ($dbinfo->version111) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_104_to_111.sql';
if (ZC_UPG_DEBUG2==true) echo '<br>'.$sniffer_file.'<br>';
$got_v1_1_1 = true;
$db_upgraded_to_version='1.1.1';
break;
case '1.1.0': // upgrading from v1.1.0 to 1.1.1
if (!$dbinfo->version110 || $dbinfo->version111) continue; // if don't have prerequisite, or if already done this step
$sniffer_file = '_upgrade_zencart_110_to_111.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_1_1 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.1.1';
break;
case '1.1.1': // upgrading from v1.1.1 to 1.1.2
if (!$dbinfo->version111 || $dbinfo->version112) continue;
$sniffer_file = '_upgrade_zencart_110_to_112.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_1_2 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.1.2';
break;
case '1.1.2-or-1.1.3': // upgrading from v1.1.2 or v.1.13 TO 1.1.4
if (!$dbinfo->version112 || $dbinfo->version114) continue;
$sniffer_file = '_upgrade_zencart_112_to_114.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_1_4 = true;
$got_v1_1_4_patch1 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.1.4-1';
break;
case '1.1.4': // upgrading from v1.1.4 to 1.1.4 patch1
if (!$dbinfo->version114 || $dbinfo->version1141) continue;
$sniffer_file = '_upgrade_zencart_114_patch1.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_1_4_patch1 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.1.4-1';
break;
case '1.1.4u': // upgrading from v1.1.4 TO v1.2.0 ('u' implies "upgrade", rather than just the patch1)
if (!$dbinfo->version114 || $dbinfo->version120) continue;
$sniffer_file = '_upgrade_zencart_114_to_120.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_2_0 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.2.0';
break;
case '1.2.0': // upgrading from v1.2.0 TO v1.2.1
if (!$dbinfo->version120 || $dbinfo->version121) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_120_to_121.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_2_1 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.2.1';
break;
case '1.2.1': // upgrading from v1.2.1 TO v1.2.2
// if (!$dbinfo->version121 || $dbinfo->version122) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_121_to_122.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_2_2 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.2.2';
break;
case '1.2.2': // upgrading from v1.2.2 TO v1.2.3
// if (!$dbinfo->version122 || $dbinfo->version123) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_122_to_123.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_2_3 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.2.3';
break;
case '1.2.3': // upgrading from v1.2.3 TO v1.2.4
// if (!$dbinfo->version123 || $dbinfo->version124) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_123_to_124.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_2_4 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.2.4';
break;
case '1.2.4': // upgrading from v1.2.4 TO v1.2.5
// if (!$dbinfo->version124 || $dbinfo->version125) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_124_to_125.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_2_5 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.2.5';
break;
case '1.2.5': // upgrading from v1.2.5 TO v1.2.6
// if (!$dbinfo->version125 || $dbinfo->version126) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_125_to_126.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_2_6 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.2.6';
break;
case '1.2.6': // upgrading from v1.2.6 TO v1.2.7
// if (!$dbinfo->version126 || $dbinfo->version127) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_126_to_127.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_2_7 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.2.7';
break;
case '1.2.7': // upgrading from v1.2.7 TO v1.3.0
// if (!$dbinfo->version127 || $dbinfo->version130) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_127_to_130.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_3_0 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.3.0';
break;
case '1.3.0': // upgrading from v1.3.0 TO 1.3.0.1
// if (!$dbinfo->version130 || $dbinfo->version1301) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_130_to_1301.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_3_0_1 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.3.0.1';
break;
case '1.3.0.1': // upgrading from v1.3.0.1 TO 1.3.0.2
// if (!$dbinfo->version1301 || $dbinfo->version1302) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_1301_to_1302.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_3_0_2 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.3.0.2';
break;
case '1.3.0.2': // upgrading from v1.3.0.2 TO 1.3.5
// if (!$dbinfo->version1302 || $dbinfo->version135) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_1302_to_135.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_3_5 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.3.5';
break;
case '1.3.5': // upgrading from v1.3.5 TO 1.3.6
// if (!$dbinfo->version135 || $dbinfo->version136) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_135_to_136.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_3_6 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.3.6';
break;
case '1.3.6': // upgrading from v1.3.6 TO 1.3.7
// if (!$dbinfo->version135 || $dbinfo->version137) continue; // if prerequisite not completed, or already done, skip
$sniffer_file = '_upgrade_zencart_136_to_137.sql';
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_3_7 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.3.7';
break;
case '1.3.7': // upgrading from v1.3.7 TO 1.3.8
// if (!$dbinfo->version137 || $dbinfo->version138) continue; // if prerequisite not completed, or already done, skip
// modified by zen-cart.cn
if (version_compare(mysql_get_server_info(), '4.1.3', '>='))
{
$sniffer_file = '_upgrade_zencart_137_to_138.sql';
}
else
{
$sniffer_file = '_upgrade_zencart_137_to_138_40.sql';
}
// end of modification
if (ZC_UPG_DEBUG2==true) echo $sniffer_file.'<br>';
$got_v1_3_8 = true; //after processing this step, this will be the new version-level
$db_upgraded_to_version='1.3.8';
break;
default:
$nothing_to_process=true;
} // end while
//check for errors
$zc_install->test_store_configure(ERROR_TEXT_STORE_CONFIGURE,ERROR_CODE_STORE_CONFIGURE);
if (!$zc_install->fatal_error && isset($_POST['adminid']) && isset($_POST['adminpwd'])) {
$zc_install->fileExists('sql/' . DB_TYPE . $sniffer_file, DB_TYPE . $sniffer_file . ' ' . ERROR_TEXT_DB_SQL_NOTEXIST, ERROR_CODE_DB_SQL_NOTEXIST);
$zc_install->functionExists(DB_TYPE, ERROR_TEXT_DB_NOTSUPPORTED, ERROR_CODE_DB_NOTSUPPORTED);
$zc_install->dbConnect(DB_TYPE, DB_SERVER, DB_DATABASE, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, ERROR_TEXT_DB_CONNECTION_FAILED, ERROR_CODE_DB_CONNECTION_FAILED,ERROR_TEXT_DB_NOTEXIST, ERROR_CODE_DB_NOTEXIST);
$zc_install->verifyAdminCredentials($_POST['adminid'], $_POST['adminpwd']);
} //end if !fatal_error
if (ZC_UPG_DEBUG2==true) echo 'Processing ['.$sniffer_file.']...<br />';
if ($zc_install->error == false && $nothing_to_process==false) {
//open database connection to run queries against it
$db = new queryFactory;
$db->Connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE) or die("Unable to connect to database");
// load the upgrade.sql file(s) relative to the required step(s)
$query_results = executeSql('sql/'. DB_TYPE . $sniffer_file, DB_DATABASE, DB_PREFIX);
if ($query_results['queries'] > 0 && $query_results['queries'] != $query_results['ignored']) {
$messageStack->add('upgrade',$query_results['queries'].'鏉℃寚浠ゆ垚鍔熸墽琛屻
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -