Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Unknown

License

Content on this site is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5. Some parts of this website may be subject to other licenses.

 Class xmlrpc_client

Description

Located in /phpxmlrpc/xmlrpc.php (line 792)

Class xmlrpc_client
Variable Summary
Method Summary
Constructor xmlrpc_client xmlrpc_client (string $path, [string $server = ''], [integer $port = ''], [string $method = ''])
Method array multicall (array $msgs, [integer $timeout = 0], [string $method = ''], [boolean $fallback = true])
Method xmlrpcresp &send (mixed $msg, [integer $timeout = 0], [string $method = ''])
Method void setAcceptedCompression (string $compmethod)
Method void setCaCertificate (string $cacert, [bool $is_dir = false])
Method void setCertificate (string $cert, string $certpass)
Method void setCookie (string $name, [string $value = ''], [string $path = ''], [string $domain = ''], [int $port = null])
Method void setCredentials (string $u, string $p, [integer $t = 1])
Method void setDebug ( $in, integer $debug)
Method void setKey (string $key, string $keypass)
Method void setProxy (string $proxyhost, string $proxyport, [string $proxyusername = ''], [string $proxypassword = ''], [int $proxyauthtype = 1])
Method void setRequestCompression (string $compmethod)
Method void setSSLVerifyHost (int $i)
Method void setSSLVerifyPeer (bool $i)
Variables
mixed $accepted_charset_encodings = array() (line 842)
mixed $accepted_compression = array() (line 828)

List of http compression methods accepted by the client for responses.

NB: PHP supports deflate, gzip compressions out of the box if compiled w. zlib

NNB: you can set it to any non-empty array for HTTP11 and HTTPS, since in those cases it will be up to CURL to decide the compression methods it supports. You might check for the presence of 'zlib' in the output of curl_version() to determine wheter compression is supported or not

mixed $authtype = 1 (line 803)
mixed $cacert = '' (line 806)
mixed $cacertdir = '' (line 807)
mixed $cert = '' (line 804)
mixed $certpass = '' (line 805)
mixed $cookies = array() (line 818)
mixed $debug (line 800)
mixed $errno (line 798)
mixed $errstr (line 799)
mixed $keepalive = false (line 840)
mixed $key = '' (line 808)
mixed $keypass = '' (line 809)
mixed $method = 'http' (line 797)
mixed $no_multicall = false (line 812)
mixed $password = '' (line 802)
mixed $path (line 794)
mixed $port (line 796)
mixed $proxy = '' (line 813)
mixed $proxyport (line 814)
mixed $proxy_authtype = 1 (line 817)
mixed $proxy_pass = '' (line 816)
mixed $proxy_user = '' (line 815)
mixed $request_charset_encoding = '' (line 844)
mixed $request_compression = '' (line 833)

Name of compression scheme to be used for sending requests.

Either null, gzip or deflate

mixed $return_type = 'xmlrpcvals' (line 849)

Decides the content of xmlrpcresp objects returned by calls to send()

valid strings are 'xmlrpcvals', 'phpvals' or 'xml'

mixed $server (line 795)
mixed $username = '' (line 801)
mixed $verifyhost = 1 (line 811)
mixed $verifypeer = true (line 810)
mixed $xmlrpc_curl_handle = null (line 838)

CURL handle: used for keep-alive connections (PHP 4.3.8 up, see:

http://curl.haxx.se/docs/faq.html#7.3)

Methods
Constructor xmlrpc_client (line 857)
xmlrpc_client xmlrpc_client (string $path, [string $server = ''], [integer $port = ''], [string $method = ''])
  • string $path: either the complete server URL or the PATH part of the xmlrc server URL, e.g. /xmlrpc/server.php
  • string $server: the server name / ip address
  • integer $port: the port the server is listening on, defaults to 80 or 443 depending on protocol used
  • string $method: the http protocol variant: defaults to 'http', 'https' and 'http11' can be used if CURL is installed
multicall (line 1662)

Send an array of request messages and return an array of responses.

Unless $this->no_multicall has been set to true, it will try first to use one single xmlrpc call to server method system.multicall, and revert to sending many successive calls in case of failure. This failure is also stored in $this->no_multicall for subsequent calls. Unfortunately, there is no server error code universally used to denote the fact that multicall is unsupported, so there is no way to reliably distinguish between that and a temporary failure. If you are sure that server supports multicall and do not want to fallback to using many single calls, set the fourth parameter to FALSE.

NB: trying to shoehorn extra functionality into existing syntax has resulted in pretty much convoluted code...

  • access: public
array multicall (array $msgs, integer $timeout, [string $method = ''], [boolean $fallback = true])
  • array $msgs: an array of xmlrpcmsg objects
  • integer $timeout: connection timeout (in seconds)
  • string $method: the http protocol variant to be used
  • boolean $fallback: fallback When true, upon receiveing an error during multicall, multiple single calls will be attempted
send (line 1100)

Send an xmlrpc request

  • access: public
xmlrpcresp &send (mixed $msg, integer $timeout, [string $method = ''])
  • mixed $msg: The message object, or an array of messages for using multicall, or the complete xml representation of a request
  • integer $timeout: Connection timeout, in seconds, If unspecified, a platform specific timeout will apply
  • string $method: if left unspecified, the http protocol chosen during creation of the object will be used
setAcceptedCompression (line 1043)

Enables/disables reception of compressed xmlrpc responses.

Note that enabling reception of compressed responses merely adds some standard http headers to xmlrpc requests. It is up to the xmlrpc server to return compressed responses when receiving such requests.

  • access: public
void setAcceptedCompression (string $compmethod)
  • string $compmethod: either 'gzip', 'deflate', 'any' or ''
setCaCertificate (line 971)

Add a CA certificate to verify server with (see man page about

CURLOPT_CAINFO for more details

  • access: public
void setCaCertificate (string $cacert, [bool $is_dir = false])
  • string $cacert: certificate file name (or dir holding certificates)
  • bool $is_dir: set to true to indicate cacert is a dir. defaults to false
setCertificate (line 958)

Add a client-side https certificate

  • access: public
void setCertificate (string $cert, string $certpass)
  • string $cert
  • string $certpass
setCookie (line 1076)

Adds a cookie to list of cookies that will be sent to server.

NB: setting any param but name and value will turn the cookie into a 'version 1' cookie: do not do it unless you know what you are doing

  • todo: check correctness of urlencoding cookie value (copied from php way of doing it...)
  • access: public
void setCookie (string $name, [string $value = ''], [string $path = ''], [string $domain = ''], [int $port = null])
  • string $name
  • string $value
  • string $path
  • string $domain
  • int $port
setCredentials (line 945)

Add some http BASIC AUTH credentials, used by the client to authenticate

  • access: public
void setCredentials (string $u, string $p, [integer $t = 1])
  • string $u: username
  • string $p: password
  • integer $t: auth type. See curl_setopt man page for supported auth types. Defaults to CURLAUTH_BASIC (basic auth)
setDebug (line 933)

Enables/disables the echoing to screen of the xmlrpc responses received

  • access: public
void setDebug ( $in, integer $debug)
  • integer $debug: values 0, 1 and 2 are supported (2 = echo sent msg too, before received response)
  • $in
setKey (line 991)

Set attributes for SSL communication: private SSL key

void setKey (string $key, string $keypass)
  • string $key: The name of a file containing a private SSL key
  • string $keypass: The secret password needed to use the private SSL key
setProxy (line 1026)

Set proxy info

  • access: public
void setProxy (string $proxyhost, string $proxyport, [string $proxyusername = ''], [string $proxypassword = ''], [int $proxyauthtype = 1])
  • string $proxyhost
  • string $proxyport: Defaults to 8080 for HTTP and 443 for HTTPS
  • string $proxyusername: Leave blank if proxy has public access
  • string $proxypassword: Leave blank if proxy has public access
  • int $proxyauthtype: set to constant CURLAUTH_NTLM to use NTLM auth with proxy
setRequestCompression (line 1058)

Enables/disables http compression of xmlrpc request.

Take care when sending compressed requests: servers might not support them (and automatic fallback to uncompressed requests is not yet implemented)

  • access: public
void setRequestCompression (string $compmethod)
  • string $compmethod: either 'gzip', 'deflate' or ''
setSSLVerifyHost (line 1012)

Set attributes for SSL communication: verify match of server cert w. hostname

  • access: public
void setSSLVerifyHost (int $i)
  • int $i
setSSLVerifyPeer (line 1002)

Set attributes for SSL communication: verify server certificate

  • access: public
void setSSLVerifyPeer (bool $i)
  • bool $i: enable/disable verification of peer certificate

Documentation generated on Tue, 29 Jan 2008 19:33:11 +0000 by phpDocumentor 1.3.1