ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
XML_RPC2_Backend_Xmlrpcext_Client Class Reference
+ Inheritance diagram for XML_RPC2_Backend_Xmlrpcext_Client:
+ Collaboration diagram for XML_RPC2_Backend_Xmlrpcext_Client:

Public Member Functions

 __construct ($uri, $options=array())
 Construct a new XML_RPC2_Client PHP Backend.
 remoteCall___ ($methodName, $parameters)
 remoteCall executes the XML-RPC call, and returns the result
- Public Member Functions inherited from XML_RPC2_Client
 __call ($methodName, $parameters)
 __call Catchall.

Additional Inherited Members

- Static Public Member Functions inherited from XML_RPC2_Client
static create ($uri, $options=array())
 Factory method to select, create and return a XML_RPC2_Client backend.
- Data Fields inherited from XML_RPC2_Client
const VERSION = '1.0.4'
- Protected Member Functions inherited from XML_RPC2_Client
 displayDebugInformations___ ($request, $body)
 Display debug informations.
 displayDebugInformations2___ ($result)
 Display debug informations (part 2)
 testMethodName___ ($methodName)
 Return true is the given method name is ok with XML/RPC spec.
- Protected Attributes inherited from XML_RPC2_Client
 $uri = null
 $proxy = null
 $prefix = null
 $debug = false
 $encoding = 'iso-8859-1'
 $sslverify = true
 $uglyStructHack = true
 ugly hack flag to avoid http://bugs.php.net/bug.php?id=21949

Detailed Description

Definition at line 58 of file Client.php.

Constructor & Destructor Documentation

XML_RPC2_Backend_Xmlrpcext_Client::__construct (   $uri,
  $options = array() 
)

Construct a new XML_RPC2_Client PHP Backend.

A URI must be provided (e.g. http://xmlrpc.example.com/1.0/). Optionally, some options may be set.

Parameters
stringURI for the XML-RPC server
array(optional) Associative array of options

Reimplemented from XML_RPC2_Client.

Definition at line 72 of file Client.php.

References XML_RPC2_Client\$uri.

{
}

Member Function Documentation

XML_RPC2_Backend_Xmlrpcext_Client::remoteCall___ (   $methodName,
  $parameters 
)

remoteCall executes the XML-RPC call, and returns the result

NB : The '___' at the end of the method name is to avoid collisions with XMLRPC __call()

Parameters
stringMethod name
arrayParameters

Reimplemented from XML_RPC2_Client.

Definition at line 89 of file Client.php.

References $result, XML_RPC2_Client\$uri, XML_RPC2_Client\displayDebugInformations2___(), and XML_RPC2_Client\displayDebugInformations___().

{
$tmp = xmlrpc_encode_request($this->prefix . $methodName, $parameters, array('encoding' => $this->encoding));
if ($this->uglyStructHack) {
// ugly hack because of http://bugs.php.net/bug.php?id=21949
// see XML_RPC2_Backend_Xmlrpcext_Value::createFromNative() from more infos
$request = preg_replace('~<name>xml_rpc2_ugly_struct_hack_(.*)</name>~', '<name>\1</name>', $tmp);
} else {
$request = $tmp;
}
$options = array(
'encoding' => $this->encoding,
'proxy' => $this->proxy,
'sslverify' => $this->sslverify
);
$httpRequest = new XML_RPC2_Util_HTTPRequest($uri, $options);
$httpRequest->setPostData($request);
$httpRequest->sendRequest();
$body = $httpRequest->getBody();
if ($this->debug) {
$this->displayDebugInformations___($request, $body);
}
$result = xmlrpc_decode($body, $this->encoding);
/* Commented due to change in behaviour from xmlrpc_decode. It does not return faults now
if ($result === false || is_null($result)) {
if ($this->debug) {
print "XML_RPC2_Exception : unable to decode response !";
}
throw new XML_RPC2_Exception('Unable to decode response');
}
*/
if (xmlrpc_is_fault($result)) {
if ($this->debug) {
print "XML_RPC2_FaultException(${result['faultString']}, ${result['faultCode']})";
}
throw new XML_RPC2_FaultException($result['faultString'], $result['faultCode']);
}
if ($this->debug) {
}
return $result;
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: