protected static function rebuild_pprid_entries() { $stmt = phoromatic_server::$db->prepare('SELECT * FROM phoromatic_results ORDER BY UploadTime ASC'); $result = $stmt ? $stmt->execute() : false; while ($result && ($row = $result->fetchArray())) { $stmt = phoromatic_server::$db->prepare('UPDATE phoromatic_results SET PPRID = :pprid WHERE AccountID = :account_id AND UploadID = :upload_id'); $stmt->bindValue(':account_id', $row['AccountID']); $stmt->bindValue(':upload_id', $row['UploadID']); $stmt->bindValue(':pprid', phoromatic_server::compute_pprid($row['AccountID'], $row['SystemID'], $row['UploadTime'], $row['XmlUploadHash'])); $stmt->execute(); } }
$stmt->bindValue(':account_id', ACCOUNT_ID); $stmt->bindValue(':system_id', SYSTEM_ID); $stmt->bindValue(':upload_id', $upload_id); $stmt->bindValue(':schedule_id', $SCHEDULE_ID); $stmt->bindValue(':benchmark_ticket_id', $BENCHMARK_TICKET_ID); $stmt->bindValue(':trigger', $TRIGGER_STRING); $stmt->bindValue(':upload_time', $upload_time); $stmt->bindValue(':title', sqlite_escape_string($result_file->get_title())); $stmt->bindValue(':description', sqlite_escape_string($result_file->get_description())); $stmt->bindValue(':system_count', $result_file->get_system_count()); $stmt->bindValue(':result_count', $result_file->get_test_count()); $stmt->bindValue(':display_status', 1); $stmt->bindValue(':xml_upload_hash', $xml_upload_hash); $stmt->bindValue(':comparison_hash', $result_file->get_contained_tests_hash(false)); $stmt->bindValue(':elapsed_time', empty($ELAPSED_TIME) || !is_numeric($ELAPSED_TIME) || $ELAPSED_TIME < 0 ? 0 : $ELAPSED_TIME); $stmt->bindValue(':pprid', phoromatic_server::compute_pprid(ACCOUNT_ID, SYSTEM_ID, $upload_time, $xml_upload_hash)); $result = $stmt->execute(); //echo phoromatic_server::$db->lastErrorMsg(); $result_directory = phoromatic_server::phoromatic_account_result_path(ACCOUNT_ID, $upload_id); pts_file_io::mkdir($result_directory); //phoromatic_add_activity_stream_event('result', $upload_id, 'uploaded'); file_put_contents($result_directory . 'composite.xml', $composite_xml); if ($SYSTEM_LOGS_ZIP != null && $SYSTEM_LOGS_HASH != null) { if (sha1($SYSTEM_LOGS_ZIP) == $SYSTEM_LOGS_HASH) { $system_logs_zip = $result_directory . 'system-logs.zip'; file_put_contents($system_logs_zip, base64_decode($_POST['system_logs_zip'])); /*if(filesize($system_logs_zip) > 2097152) { unlink($system_logs_zip); }*/ }