$update_response['nwarnings'] = 0; } $response['update'] = $update_response; // Configure $configure_response = array(); $configure = pdo_query("SELECT * FROM configure WHERE buildid='{$buildid}'"); $configure_array = pdo_fetch_array($configure); $nerrors = 0; if ($configure_array['status'] != 0) { $nerrors = 1; } $configure_response['nerrors'] = $nerrors; $configure_response['nwarnings'] = $configure_array['warnings']; $configure_response['status'] = $configure_array['status']; $configure_response['command'] = $configure_array['command']; $configure_response['output'] = format_for_iphone($configure_array['log']); $configure_response['starttime'] = date(FMT_DATETIMETZ, strtotime($configure_array['starttime'] . ' UTC')); $configure_response['endtime'] = date(FMT_DATETIMETZ, strtotime($configure_array['endtime'] . ' UTC')); $response['configure'] = $configure_response; // Test $test_response = array(); $nerrors = 0; $nwarnings = 0; $test_response['nerrors'] = $nerrors; $test_response['nwarnings'] = $nwarnings; $npass_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='{$buildid}' AND status='passed'")); $npass = $npass_array[0]; $nnotrun_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='{$buildid}' AND status='notrun'")); $nnotrun = $nnotrun_array[0]; $nfail_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='{$buildid}' AND status='failed'")); $nfail = $nfail_array[0];
$xml .= add_XML_value("endtime", date(FMT_DATETIMETZ, strtotime($update_array["endtime"] . " UTC"))); $xml .= "</update>"; } // Configure $xml .= "<configure>"; $configure = pdo_query("SELECT * FROM configure WHERE buildid='{$buildid}'"); $configure_array = pdo_fetch_array($configure); $nerrors = 0; if ($configure_array["status"] != 0) { $nerrors = 1; } $xml .= add_XML_value("nerrors", $nerrors); $xml .= add_XML_value("nwarnings", $configure_array['warnings']); $xml .= add_XML_value("status", $configure_array["status"]); $xml .= add_XML_value("command", $configure_array["command"]); $xml .= add_XML_value("output", format_for_iphone($configure_array["log"])); $xml .= add_XML_value("starttime", date(FMT_DATETIMETZ, strtotime($configure_array["starttime"] . " UTC"))); $xml .= add_XML_value("endtime", date(FMT_DATETIMETZ, strtotime($configure_array["endtime"] . " UTC"))); $xml .= "</configure>"; // Test $xml .= "<test>"; $nerrors = 0; $nwarnings = 0; $xml .= add_XML_value("nerrors", $nerrors); $xml .= add_XML_value("nwarnings", $nwarnings); $npass_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='{$buildid}' AND status='passed'")); $npass = $npass_array[0]; $nnotrun_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='{$buildid}' AND status='notrun'")); $nnotrun = $nnotrun_array[0]; $nfail_array = pdo_fetch_array(pdo_query("SELECT count(testid) FROM build2test WHERE buildid='{$buildid}' AND status='failed'")); $nfail = $nfail_array[0];