2
// This file is part of BOINC.
3
// http://boinc.berkeley.edu
4
// Copyright (C) 2011 University of California
6
// BOINC is free software; you can redistribute it and/or modify it
7
// under the terms of the GNU Lesser General Public License
8
// as published by the Free Software Foundation,
9
// either version 3 of the License, or (at your option) any later version.
11
// BOINC is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
// See the GNU Lesser General Public License for more details.
16
// You should have received a copy of the GNU Lesser General Public License
17
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
19
// example code for making a remote job submission
21
$ch = curl_init("http://foo.edu/test/submit.php");
22
curl_setopt($ch, CURLOPT_POST, 1);
23
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
24
curl_setopt($ch, CURLOPT_POSTFIELDS, "request=
26
<authenticator>xxx</authenticator>
28
<app_name>uppercase</app_name>
30
<rsc_fpops_est>100e9</rsc_fpops_est>
31
<command_line>--t ALPHA</command_line>
33
<source>http://foo.edu/index.php</source>
34
<physical_name>name</physical_name>
40
$reply = curl_exec($ch);
41
if (!$reply) die("HTTP op failed\n");
42
echo "reply: $reply\n"; exit;
44
$r = simplexml_load_string($reply);
45
if (!$r) die("bad reply: $reply\n");
46
$name = $r->getName();
47
if ($name == 'estimate') {
48
echo "estimate: ".(string)$r->seconds."\n";
49
} else if ($name == 'error') {
50
foreach ($r->message as $msg) {