X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fxmlrpcclient.php;h=b33fcb3e90783b4538feda0e7a4ae8d6e97d1515;hb=fc10da9a3e2cf019a4c6722288e2f063e3ec1728;hp=e16f19ff9ce7eaa7f7453eece021173f906b0b94;hpb=a7de4ef724d1a3b0bf978a50ce7cc9d23412c7a0;p=platal.git diff --git a/classes/xmlrpcclient.php b/classes/xmlrpcclient.php index e16f19f..b33fcb3 100644 --- a/classes/xmlrpcclient.php +++ b/classes/xmlrpcclient.php @@ -32,6 +32,7 @@ class XmlrpcClient { private $url; private $urlparts; + public $bt = null; public function __construct($url) { @@ -99,8 +100,21 @@ class XmlrpcClient public function __call($method, $args) { $query = xmlrpc_encode_request($method, $args); + if ($this->bt) { + $this->bt->start($method . "\n" . var_export($args, true)); + } $answer = $this->http_post($query, $this->urlparts); + if ($this->bt) { + $this->bt->stop(); + } $result = $this->find_and_decode_xml($answer); + if ($this->bt) { + if (isset($result['faultCode'])) { + $this->bt->update(0, $result['faultString']); + } else { + $this->bt->update(count($result)); + } + } if (is_array($result) && isset($result['faultCode'])) { trigger_error("Error in xmlrpc call $function\n".