public static function run($r) { if (pts_result_file::is_test_result_file($r[0])) { $result_file = new pts_result_file($r[0]); pts_client::$display->generic_heading($r[0]); $valid = $result_file->validate(); if ($valid == false) { echo PHP_EOL . 'Errors occurred parsing the main XML.' . PHP_EOL; pts_validation::process_libxml_errors(); return false; } else { echo PHP_EOL . 'The result file is Valid.' . PHP_EOL; } } }
} else { if ($COMPOSITE_XML_GZ != null && function_exists('gzinflate')) { $composite_xml = gzinflate(base64_decode($_POST['composite_xml_gz'])); } else { $composite_xml = null; } } if ($composite_xml == null || sha1($composite_xml) != $COMPOSITE_XML_HASH) { $json['phoromatic']['error'] = 'XML Hash Mismatch'; echo json_encode($json); return false; } // VALIDATE $result_file = new pts_result_file($composite_xml); // Validate the XML if ($result_file->validate() == false) { $json['phoromatic']['error'] = 'XML Did Not Match Schema Definition'; echo json_encode($json); return false; } if ($result_file->get_title() == null || $result_file->get_system_count() == 0 || $result_file->get_test_count() == 0) { $json['phoromatic']['error'] = 'Invalid Result File'; echo json_encode($json); return false; } /*$Featured_Results = -1; $Featured = pts_result_file_analyzer::analyze_result_file_intent($result_file, $Featured_Results); if(!is_array($Featured)) { $Featured = array(null, null);