$args = init_args(); $platform_mgr = new tlPlatform($db, $args->testproject_id); $var_id = $_GET['varid']; $suite_id = $_GET['suiteid']; //var_cases $fp = @fopen($_FILES['varfile']['tmp_name'], "r"); switch ($suite_id) { case '3959': //affirm2 if (preg_match("/^.*?\\.tcl/i", $_FILES['varfile']['name'], $temp)) { if ($fp) { $var_cases = array(); while (!feof($fp)) { $buffer = fgets($fp, 4096); if (preg_match("/^set {affirm_(.*?)} 1/i", $buffer, $case)) { $tcversion_id = $platform_mgr->getTcversionidByName($case[1], 'affirm2'); if ($tcversion_id != 0) { $var_cases[] = $tcversion_id; } } elseif (preg_match("/^set {(bf.*?)} 1/i", $buffer, $case)) { $tcversion_id = $platform_mgr->getTcversionidByName($case[1], 'affirm2'); if ($tcversion_id != 0) { $var_cases[] = $tcversion_id; } } elseif (preg_match("/^set {(mt.*?)} 1/i", $buffer, $case)) { $tcversion_id = $platform_mgr->getTcversionidByName($case[1], 'affirm2'); if ($tcversion_id != 0) { $var_cases[] = $tcversion_id; } } }