コード例 #1
0
ファイル: test.php プロジェクト: BackupTheBerlios/btg-svn
$r = send($c, new uptimeCommand());
if (!$r instanceof uptimeResponseCommand) {
    die(__LINE__ . ": Failed to get uptime: " . $r->toString() . "\n");
}
// Detach this session and list session, make sure this is found
$r = send($c, new detachSessionCommand());
if (!$r instanceof ackCommand) {
    die(__LINE__ . ": Failed to deatch session: " . $r->toString() . "\n");
}
// Create new connection
$c->close();
unset($c);
$c = new XMLRPC_Client($host);
$c->setSSLparams("htdocs/stromnetCA.crt", "htdocs/btgclient.pem");
$c->enableGZIP(1);
$c->setDebug(0);
// Authorize
$r = send($c, new initConnectionCommand($username, $password));
if (!$r instanceof ackCommand) {
    die(__LINE__ . ": Failed to init connection: " . $r->toString() . "\n");
}
/*
$r = send($c, new initSessionCommand());
if(!($r instanceof ackCommand))
	die(__LINE__.": Failed to init session: ".$r->toString()."\n");
*/
// List available sessions, make sure this IS found
$r = send($c, new listSessionCommand());
if (!$r instanceof listSessionResponseCommand) {
    die(__LINE__ . ": Failed to list sessions: " . $r->toString() . "\n");
}