Пример #1
0
        die;
    }
    Build::insert($run, $mode->id, $revision);
    die;
}
// Report that a slave is still awake when there are no benchmarks results
// to send.
if (GET_string('awake') == 'yes') {
    $MACHINE = GET_int('MACHINE');
    mysql_query("UPDATE awfy_machine\n                 SET last_checked = UNIX_TIMESTAMP()\n                 WHERE id = {$MACHINE}") or die("ERROR: " . mysql_error());
    die;
}
// Report score of a benchmark total or subtest.
$run_id = GET_int('run');
$run = new Run($run_id);
if ($run->isFinished() || $run->hasError()) {
    throw new Error("Run was already finished or error'ed");
}
$time = mysql_real_escape_string(GET_string('time'));
$mode_id = find_mode(GET_string('mode'));
$version = GET_string('suite');
$score = GET_int('score');
$build = find_build($run_id, $mode_id);
if (isset($_GET['version'])) {
    $version = GET_string('version');
}
$suite_version_id = find_or_add_suite_version(GET_string('suite'), $version);
if (GET_string('name') == '__total__') {
    $extra_info = htmlspecialchars(GET_string('extra_info'), ENT_QUOTES);
    mysql_query("INSERT INTO awfy_score\n                 (build_id, suite_version_id, score, extra_info)\n                 VALUES\n                 ({$build}, {$suite_version_id}, {$time}, '{$extra_info}')") or die("ERROR: " . mysql_error());
    print "id=" . mysql_insert_id();