while (!feof($file_handle)) { $line = fgets($file_handle); if (stripos($line, "#") === false and stripos($line, "ID") > 0) { $para = explode("):(", $line); $tmp = explode(",", $para[0]); $tmp2 = explode("=", $tmp[0]); $name = $tmp2[1]; $xmlPath = $para[1]; $input = $para[2]; $cpStr = "cd " . $autoPath . "; python control.py " . $name . ";"; $runStr = "ssh " . $host . " '" . $cpStr . "cd " . $bsPath . ";" . $exeStr . $host . ":" . $port . "" . $input . " ';"; echo $runStr; unset($output); exec($runStr, $output); if (!empty($_POST['forClick']) or !empty($_POST['forClick_bex']) or !empty($_POST['forClick_tade']) or !empty($_POST['forClick_adx'])) { $tmp = processClick($output, $name, $cb); $string_c = $string_c . $tmp; } else { $tmp = processRender($output, $name, $rs, $nginx); $string_w = $string_w . $tmp; } } #end if valid line } #end while if (!empty($_POST['forClick']) or !empty($_POST['forClick_bex']) or !empty($_POST['forClick_tade']) or !empty($_POST['forClick_adx'])) { echo $string_c; } else { $string_w = $string_w . "</body></html>"; fwrite($file_w, $string_w); fclose($file_w);
return "<p>" . $name . "</p>" . $snHtml; } } $file_w = fopen("render.html", "w"); $string_w = "<html><head></head><body>"; $string_c = ""; if (!empty($_POST['forClick']) or !empty($_POST['forClick_bex']) or !empty($_POST['forClick_tade']) or !empty($_POST['forClick_adx'])) { $clickCaseId = array("3787", "3789", "3791", "3793", "3795", "3797", "3799", "3801", "3803", "3805", "3807", "3809", "5105", "5107"); $caseName = array("CLICK_ST-SINGLE", "CLICK_RT-DOUBLE-3", "CLICK_UC-DOUBLE-3", "CLICK_RT-ST-5", "CLICK_BT-ST-5", "CLICK_ALLT", "CLICK_CPA-2", "CLICK_LEFENG-API", "CLICK_WBIAO-API-CPC", "CLICK_WBIAO-API-CPA", "CLICK_ZHENPING-API", "CLICK_JIEHUN-API", "CLICK_DRT", "CLICK_DRT_ST"); for ($i = 0; $i < count($clickCaseId); $i++) { $cpStr = "cd " . $autoPath . "; python task.py -t " . $autoTaskId . " -c " . $clickCaseId[$i] . ";"; $runStr = "ssh " . $host . " '" . $cpStr . "cd " . $bsPath . ";" . $exeStr . $host . ":" . $port . " -url youdao.com -v';"; echo $runStr; unset($output); exec($runStr, $output); $tmp = processClick($output, $caseName[$i], $cb); $string_c = $string_c . $tmp; } #end of foreach } else { #end of if $renderCaseId = array("4775", "4777", "4779", "4781", "4783", "5049"); $renderCaseName = array("SWF_RENDER", "JPG_RENDER", "ITEM_RENDER", "THIRDPARTY_RENDER", "THIRDPARTYITEM_RENDER", "ZHIXUAN_ITEMDYNAMIC"); #$renderCaseId=array("5049"); #$renderCaseName=array("ZHIXUAN_ITEMDYNAMIC"); for ($i = 0; $i < count($renderCaseId); $i++) { $cpStr = "cd " . $autoPath . "; python task.py -t " . $autoTaskId . " -c " . $renderCaseId[$i] . ";"; $runStr = "ssh " . $host . " '" . $cpStr . "cd " . $bsPath . ";" . $exeStr . $host . ":" . $port . " -url youdao.com -v';"; echo $runStr; unset($output); exec($runStr, $output);