diff options
Diffstat (limited to 'pts-core/functions')
-rw-r--r-- | pts-core/functions/pts-functions-install.php | 2 | ||||
-rw-r--r-- | pts-core/functions/pts-functions_global.php | 34 | ||||
-rw-r--r-- | pts-core/functions/pts-functions_tests.php | 34 | ||||
-rw-r--r-- | pts-core/functions/pts-functions_types.php | 2 |
4 files changed, 36 insertions, 36 deletions
diff --git a/pts-core/functions/pts-functions-install.php b/pts-core/functions/pts-functions-install.php index ba36399..19ba3c1 100644 --- a/pts-core/functions/pts-functions-install.php +++ b/pts-core/functions/pts-functions-install.php @@ -53,7 +53,7 @@ function pts_start_install($to_install) if(pts_read_assignment("COMMAND") != "benchmark") { - echo pts_string_header("\nNot recognized: " . $TO_INSTALL . "\n"); + echo pts_string_header("\nNot recognized: " . $to_install[0] . "\n"); } return false; } diff --git a/pts-core/functions/pts-functions_global.php b/pts-core/functions/pts-functions_global.php index 8de5501..1d3b59d 100644 --- a/pts-core/functions/pts-functions_global.php +++ b/pts-core/functions/pts-functions_global.php @@ -52,5 +52,39 @@ function pts_global_valid_id_string($global_id) return $is_valid; } +function pts_global_upload_result($result_file, $tags = "") +{ + // Upload a test result to the Phoronix Global database + $test_results = file_get_contents($result_file); + $test_results = str_replace(array("\n", "\t"), "", $test_results); + $switch_tags = array("Benchmark>" => "B>", "Results>" => "R>", "Group>" => "G>", "Entry>" => "E>", "Identifier>" => "I>", "Value>" => "V>", "System>" => "S>", "Attributes>" => "A>"); + + foreach($switch_tags as $f => $t) + { + $test_results = str_replace($f, $t, $test_results); + } + + $ToUpload = base64_encode($test_results); + $GlobalUser = pts_current_user(); + $GlobalKey = pts_read_user_config(P_OPTION_GLOBAL_UPLOADKEY, ""); + $tags = base64_encode($tags); + $return_stream = ""; + + $upload_data = array("result_xml" => $ToUpload, "global_user" => $GlobalUser, "global_key" => $GlobalKey, "tags" => $tags); + $upload_data = http_build_query($upload_data); + + $http_parameters = array("http" => array("method" => "POST", "content" => $upload_data)); + + $stream_context = stream_context_create($http_parameters); + $opened_url = @fopen("http://www.phoronix-test-suite.com/global/user-upload.php", "rb", false, $stream_context); + $response = @stream_get_contents($opened_url); + + if($response !== false) + { + $return_stream = $response; + } + + return $return_stream; +} ?> diff --git a/pts-core/functions/pts-functions_tests.php b/pts-core/functions/pts-functions_tests.php index 89e7153..42bb551 100644 --- a/pts-core/functions/pts-functions_tests.php +++ b/pts-core/functions/pts-functions_tests.php @@ -227,40 +227,6 @@ function pts_get_results_viewer_xsl_formatted($format_type = "PNG") return str_replace("<!-- GRAPH TAGS -->", $graph_string, $raw_xsl); } -function pts_global_upload_result($result_file, $tags = "") -{ - // Upload a test result to the Phoronix Global database - $test_results = file_get_contents($result_file); - $test_results = str_replace(array("\n", "\t"), "", $test_results); - $switch_tags = array("Benchmark>" => "B>", "Results>" => "R>", "Group>" => "G>", "Entry>" => "E>", "Identifier>" => "I>", "Value>" => "V>", "System>" => "S>", "Attributes>" => "A>"); - - foreach($switch_tags as $f => $t) - { - $test_results = str_replace($f, $t, $test_results); - } - - $ToUpload = base64_encode($test_results); - $GlobalUser = pts_current_user(); - $GlobalKey = pts_read_user_config(P_OPTION_GLOBAL_UPLOADKEY, ""); - $tags = base64_encode($tags); - $return_stream = ""; - - $upload_data = array("result_xml" => $ToUpload, "global_user" => $GlobalUser, "global_key" => $GlobalKey, "tags" => $tags); - $upload_data = http_build_query($upload_data); - - $http_parameters = array("http" => array("method" => "POST", "content" => $upload_data)); - - $stream_context = stream_context_create($http_parameters); - $opened_url = @fopen("http://www.phoronix-test-suite.com/global/user-upload.php", "rb", false, $stream_context); - $response = @stream_get_contents($opened_url); - - if($response !== false) - { - $return_stream = $response; - } - - return $return_stream; -} function pts_test_needs_updated_install($identifier) { // Checks if test needs updating diff --git a/pts-core/functions/pts-functions_types.php b/pts-core/functions/pts-functions_types.php index 53d17dc..b083d67 100644 --- a/pts-core/functions/pts-functions_types.php +++ b/pts-core/functions/pts-functions_types.php @@ -334,7 +334,7 @@ function pts_contained_tests($object, $include_extensions = false) } else if(is_file(SAVE_RESULTS_DIR . $object . "/composite.xml")) // Object is a saved results file { - $xml_parser = new pts_suite_tandem_XmlReader($object); + $xml_parser = new pts_results_tandem_XmlReader($object); $tests_in_save = $xml_parser->getXMLArrayValues(P_RESULTS_TEST_TESTNAME); foreach($tests_in_save as $test) |