b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 2.4) [ class tree: main ] [ index: main ] [ all elements ]

Class: xmlrpc_client

Source Location: /blogs/inc/_ext/xmlrpc/_xmlrpc.inc.php

Class xmlrpc_client

Property Summary
mixed   $accepted_charset_encodings  
mixed   $accepted_compression   List of http compression methods accepted by the client for responses.
mixed   $authtype  
mixed   $cacert  
mixed   $cacertdir  
mixed   $cert  
mixed   $certpass  
mixed   $cookies  
mixed   $debug  
mixed   $errno  
mixed   $errstr  
mixed   $keepalive  
mixed   $key  
mixed   $keypass  
mixed   $method  
mixed   $no_multicall  
mixed   $password  
mixed   $path  
mixed   $port  
mixed   $proxy  
mixed   $proxyport  
mixed   $proxy_authtype  
mixed   $proxy_pass  
mixed   $proxy_user  
mixed   $request_charset_encoding  
mixed   $request_compression   Name of compression scheme to be used for sending requests.
mixed   $return_type   Decides the content of xmlrpcresp objects returned by calls to send()
mixed   $server  
mixed   $username  
mixed   $verifyhost  
mixed   $verifypeer  
mixed   $xmlrpc_curl_handle   CURL handle: used for keep-alive connections (PHP 4.3.8 up, see:

[ Top ]
Method Summary
xmlrpc_client   xmlrpc_client()  
array   multicall()   Send an array of request messages and return an array of responses.
xmlrpcresp   &send()   Send an xmlrpc request
void   setAcceptedCompression()   Enables/disables reception of compressed xmlrpc responses.
void   setCaCertificate()   Add a CA certificate to verify server with (see man page about
void   setCertificate()   Add a client-side https certificate
void   setCookie()   Adds a cookie to list of cookies that will be sent to server.
void   setCredentials()   Add some http BASIC AUTH credentials, used by the client to authenticate
void   setDebug()   Enables/disables the echoing to screen of the xmlrpc responses received
void   setKey()   Set attributes for SSL communication: private SSL key
void   setProxy()   Set proxy info
void   setRequestCompression()   Enables/disables http compression of xmlrpc request.
void   setSSLVerifyHost()   Set attributes for SSL communication: verify match of server cert w. hostname
void   setSSLVerifyPeer()   Set attributes for SSL communication: verify server certificate

[ Top ]
Properties
mixed   $accepted_charset_encodings = array() [line 809]

[ Top ]
mixed   $accepted_compression = array() [line 795]

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


[ Top ]
mixed   $authtype = 1 [line 770]

[ Top ]
mixed   $cacert = '' [line 773]

[ Top ]
mixed   $cacertdir = '' [line 774]

[ Top ]
mixed   $cert = '' [line 771]

[ Top ]
mixed   $certpass = '' [line 772]

[ Top ]
mixed   $cookies = array() [line 785]

[ Top ]
mixed   $debug [line 767]

[ Top ]
mixed   $errno [line 765]

[ Top ]
mixed   $errstr [line 766]

[ Top ]
mixed   $keepalive = false [line 807]

[ Top ]
mixed   $key = '' [line 775]

[ Top ]
mixed   $keypass = '' [line 776]

[ Top ]
mixed   $method = 'http' [line 764]

[ Top ]
mixed   $no_multicall = false [line 779]

[ Top ]
mixed   $password = '' [line 769]

[ Top ]
mixed   $path [line 761]

[ Top ]
mixed   $port [line 763]

[ Top ]
mixed   $proxy = '' [line 780]

[ Top ]
mixed   $proxyport [line 781]

[ Top ]
mixed   $proxy_authtype = 1 [line 784]

[ Top ]
mixed   $proxy_pass = '' [line 783]

[ Top ]
mixed   $proxy_user = '' [line 782]

[ Top ]
mixed   $request_charset_encoding = '' [line 811]

[ Top ]
mixed   $request_compression = '' [line 800]

Name of compression scheme to be used for sending requests.

Either null, gzip or deflate


[ Top ]
mixed   $return_type = 'xmlrpcvals' [line 816]

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

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


[ Top ]
mixed   $server [line 762]

[ Top ]
mixed   $username = '' [line 768]

[ Top ]
mixed   $verifyhost = 1 [line 778]

[ Top ]
mixed   $verifypeer = true [line 777]

[ Top ]
mixed   $xmlrpc_curl_handle = null [line 805]

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

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


[ Top ]
Methods
Constructor xmlrpc_client  [line 824]

  xmlrpc_client xmlrpc_client( string $path, [string $server = ''], [integer $port = ''], [string $method = '']  )

Parameters:
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


[ Top ]
multicall  [line 1629]

  array multicall( array $msgs, [integer $timeout = 0], [string $method = ''], [boolean $fallback = true]  )

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...

Parameters:
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

API Tags:
Access:  public


[ Top ]
send  [line 1067]

  xmlrpcresp &send( mixed $msg, [integer $timeout = 0], [string $method = '']  )

Send an xmlrpc request

Parameters:
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

API Tags:
Access:  public


[ Top ]
setAcceptedCompression  [line 1010]

  void setAcceptedCompression( string $compmethod  )

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.

Parameters:
string   $compmethod:  either 'gzip', 'deflate', 'any' or ''

API Tags:
Access:  public


[ Top ]
setCaCertificate  [line 938]

  void setCaCertificate( string $cacert, [bool $is_dir = false]  )

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

CURLOPT_CAINFO for more details

Parameters:
string   $cacert:  certificate file name (or dir holding certificates)
bool   $is_dir:  set to true to indicate cacert is a dir. defaults to false

API Tags:
Access:  public


[ Top ]
setCertificate  [line 925]

  void setCertificate( string $cert, string $certpass  )

Add a client-side https certificate

Parameters:
string   $cert: 
string   $certpass: 

API Tags:
Access:  public


[ Top ]
setCookie  [line 1043]

  void setCookie( string $name, [string $value = ''], [string $path = ''], [string $domain = ''], [int $port = null]  )

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

Parameters:
string   $name: 
string   $value: 
string   $path: 
string   $domain: 
int   $port: 

API Tags:
Access:  public

Information Tags:
Todo:  check correctness of urlencoding cookie value (copied from php way of doing it...)

[ Top ]
setCredentials  [line 912]

  void setCredentials( string $u, string $p, [integer $t = 1]  )

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

Parameters:
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)

API Tags:
Access:  public


[ Top ]
setDebug  [line 900]

  void setDebug( $in, integer $debug  )

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

Parameters:
integer   $debug:  values 0, 1 and 2 are supported (2 = echo sent msg too, before received response)
   $in: 

API Tags:
Access:  public


[ Top ]
setKey  [line 958]

  void setKey( string $key, string $keypass  )

Set attributes for SSL communication: private SSL key

Parameters:
string   $key:  The name of a file containing a private SSL key
string   $keypass:  The secret password needed to use the private SSL key


[ Top ]
setProxy  [line 993]

  void setProxy( string $proxyhost, string $proxyport, [string $proxyusername = ''], [string $proxypassword = ''], [int $proxyauthtype = 1]  )

Set proxy info

Parameters:
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

API Tags:
Access:  public


[ Top ]
setRequestCompression  [line 1025]

  void setRequestCompression( string $compmethod  )

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)

Parameters:
string   $compmethod:  either 'gzip', 'deflate' or ''

API Tags:
Access:  public


[ Top ]
setSSLVerifyHost  [line 979]

  void setSSLVerifyHost( int $i  )

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

Parameters:
int   $i: 

API Tags:
Access:  public


[ Top ]
setSSLVerifyPeer  [line 969]

  void setSSLVerifyPeer( bool $i  )

Set attributes for SSL communication: verify server certificate

Parameters:
bool   $i:  enable/disable verification of peer certificate

API Tags:
Access:  public


[ Top ]

Documentation generated on Sat, 06 Mar 2010 03:43:20 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).