<?php
/***************************************************************************
- * Copyright (C) 2003-2007 Polytechnique.org *
+ * Copyright (C) 2003-2008 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
{
private $url;
private $urlparts;
+ public $bt = null;
public function __construct($url)
{
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 (is_array($result) && 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".