$sql = $head . " 1 \n-- \n-- DATABASE : " . $arrGPdoDB['db_name'] . "\n-- \n\n-- ---------------------------------\n"; $zip = new phpzip(); $vol_size = $_POST['vol_size']; $sql_name = $_POST['sql_name']; $i = 1; $error = 0; if (!$objWebInit->creat_cache($sql)) { die("不能建立缓存文件!"); } $arrTables = $objWebInit->get_table(); foreach ($arrTables as $k => $table) { if (!$objWebInit->get_table_df($table, $sql, $_POST['drop_tab'])) { $error = 1; break; } if (!$objWebInit->get_table_content($table, $sql, $_POST['ext_insert'])) { $error = 1; break; } } if (filesize($objWebInit->cache) > $vol_size) { if (!($fp = @fopen($objWebInit->cache, 'r'))) { die($objWebInit->cache . " 缓存文件不存在."); } else { $intBlock = $_POST['vol_size'] * 1024; while (!feof($fp)) { $buffer = fread($fp, $intBlock); $buffer .= fgets($fp); $zip->add_file($buffer, $arrGPdoDB['db_name'] . '_' . $date . '_' . $i . '.sql'); $i++; $sql = $head . $i . "\n-- \n-- DATABASE : " . $arrGPdoDB['db_name'] . "\n-- \n\n-- ---------------------------------\n";