summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-dev/attachments/20110208/69d2df41/attachment-0001.bin
blob: 19339094694888cd52c05f83c67756cc15c22591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php

require_once('xmlrpc.inc');

# prepare the call parameters
$server = "http://sophie2.aero.jussieu.fr/rpc";

$method = "rpms.info";

$pkgid = $_SERVER['argv'][1];
# the Sophie pkgid of a package must be given at the command line
# example : $ php sophieinfo.php 4727e94730113216e19d04592bbc4cec

$parameters =  new xmlrpcval("$pkgid")  ;

print_r($server);
print_r("\n");
print_r($method);
print_r("\n");

print_r($parameters);
print_r("\n");

$message = new xmlrpcmsg($method, array($parameters));

# create the client, telling it which server to call
$client = new xmlrpc_client($server);
# (eventually) set options of the client
$client->setDebug(2);

# ask the client to send the message to the server
$response = $client->send($message);

# handle the response
if (!$response->faultCode()) {
		print "<HR>I got this value back<BR><PRE>" .
		htmlentities($response->serialize()). "</PRE><HR>\n";
} else {
      print "Fault <BR>";
      print "Code: " . htmlentities($response->faultCode()) . "<BR>" .
            "Reason: '" . htmlentities($response->faultString()) . "'<BR>";
}

?>