. */ class merge_results implements pts_option_interface { public static function run($r) { pts_load_function_set("merge"); $BASE_FILE = $r[0]; $MERGE_FROM_FILE = $r[1]; $MERGE_TO = $r[2]; if(empty($BASE_FILE) || empty($MERGE_FROM_FILE)) { echo "\nTwo saved result profile names must be supplied.\n"; } else { $BASE_FILE = pts_find_result_file($BASE_FILE); $MERGE_FROM_FILE = pts_find_result_file($MERGE_FROM_FILE); if($BASE_FILE == false || $MERGE_FROM_FILE == false) { echo "\n" . $r[0] . " or " . $r[1] . " couldn't be found.\n"; } else { if(!empty($MERGE_TO) && !is_dir(SAVE_RESULTS_DIR . $MERGE_TO)) { $MERGE_TO .= "/composite.xml"; } else { $MERGE_TO = null; } if(empty($MERGE_TO)) { do { $rand_file = rand(1000, 9999); $MERGE_TO = "merge-" . $rand_file . '/'; } while(is_dir(SAVE_RESULTS_DIR . $MERGE_TO)); $MERGE_TO .= "composite.xml"; } // Merge Results $MERGED_RESULTS = pts_merge_test_results(file_get_contents($BASE_FILE), file_get_contents($MERGE_FROM_FILE)); pts_save_result($MERGE_TO, $MERGED_RESULTS); echo "Merged Results Saved To: " . SAVE_RESULTS_DIR . $MERGE_TO . "\n\n"; pts_display_web_browser(SAVE_RESULTS_DIR . $MERGE_TO); } } } } ?>