Page 1 of 1

access the testlink database by running a PHP from CLI

PostPosted: Wed Feb 18, 2009 2:03 am
by abadve
Hello all
I am trying this simple example from the command line interface to access the testlink database. This example below works if I specify the absolute path to the location of class-IXR.php file. If I specify it using IP address it does not work.
Do I need some HTTP packages installed or am I having some permission problems.
<?php
require_once('http://IP_address/testlink/third_party/xml-rpc/class-IXR.php');
// above works if used absolute path
define("SERVER_URL", "http://IP_address/testlink/lib/api/xmlrpc.php");
define("DEV_KEY", "97b98d32b515fc4f2c9a09abf6999849");
$client = new IXR_Client(SERVER_URL);
if(!$client->query('tl.sayHello')) {
echo "callfailed". $client->getErrorCode()."-".$client->getErrorMessage();
}
else {
print "class called\n";
print($client->getResponse());
}
?>

I look forward to your replies.

Thanks a lot.

PostPosted: Wed May 13, 2009 4:56 am
by tfeathers
The answer is use the python client... I will attach my code once I am done with it... I have one last piece to finish in the morning.

PostPosted: Fri May 15, 2009 2:57 pm
by fman
the answer is undertand why php client do not work and solve

PostPosted: Wed Jun 17, 2009 6:15 pm
by aksinghv
Hi tfeathers,

I guess your coding is complete. Could you share your code so that wider comunity gets benefitted.

Regards,
Anjani