addServer(); $status = $client->jobStatus($handle); if ($status[0]) { if ($status[3] != 0) { echo "Running: " . ($status[1] ? "true" : "false"); echo ", progress: ".ceil($status[2]/$status[3]*100) . "%, "; echo $status[2] . "/" . $status[3] . "\n"; } else { echo "Task has not yet been processed\n"; } } else { $query = "SELECT returncode, result FROM builds ". "WHERE id = '".mysql_real_escape_string($argv[1])."'"; $result = mysql_query($query); $jobres = mysql_fetch_array($result); if ($jobres[0] !== NULL) { echo "Job returned with code ".$jobres[0].": ".$jobres[1]."\n"; } else { echo "Job failed\n"; } } } else { echo "Invalid handle hash\n"; }