Exemplo n.º 1
0
        $path = dir_hier_path($name, $upload_dir, $fanout);
        if (is_file($path)) {
            system("nice -9 zip -jq {$zip_basename} {$path}");
        }
    }
    do_download($zip_filename);
    unlink($zip_filename);
    unlink($zip_basename);
}
$cmd = get_str('cmd');
$auth_str = get_str('auth_str');
switch ($cmd) {
    case 'result_file':
        $result_name = get_str('result_name');
        $file_num = get_int('file_num');
        get_output_file($result_name, $file_num, $auth_str);
        break;
    case 'batch_files':
        get_batch_output_files($auth_str);
        break;
    case 'workunit_file':
        $file_num = get_int('file_num');
        $wu_name = get_str('wu_name');
        get_wu_output_file($wu_name, $file_num, $auth_str);
        break;
    case 'workunit_files':
        $wu_id = get_int('wu_id');
        get_wu_output_files($wu_id, $auth_str);
        break;
    default:
        echo "bad command\n";
Exemplo n.º 2
0
    $fanout = parse_config(get_config(), "<uldl_dir_fanout>");
    $upload_dir = parse_config(get_config(), "<upload_dir>");
    if (!$wu->canonical_resultid) {
        die("no canonical result for wu {$wu->name}");
    }
    $result = BoincResult::lookup_id($wu->canonical_resultid);
    $names = get_outfile_names($result);
    foreach ($names as $name) {
        $path = dir_hier_path($name, $upload_dir, $fanout);
        if (is_file($path)) {
            system("nice -9 zip -jq {$zip_basename} {$path}");
        }
    }
    do_download($zip_filename);
    unlink($zip_filename);
    unlink($zip_basename);
}
$auth_str = get_str('auth_str');
$instance_name = get_str('instance_name', true);
if ($instance_name) {
    $file_num = get_int('file_num');
    get_output_file($instance_name, $file_num, $auth_str);
} else {
    $batch_id = get_int('batch_id', true);
    if ($batch_id) {
        get_batch_output_files($batch_id, $auth_str);
    } else {
        $wu_id = get_int('wu_id');
        get_wu_output_files($wu_id, $auth_str);
    }
}