Open Monograph Press  3.3.0
PhpXmlRpc\Client Class Reference

Public Member Functions

 __construct ($path, $server='', $port='', $method='')
 
 multicall ($reqs, $timeout=0, $method='', $fallback=true)
 
 send ($req, $timeout=0, $method='')
 
 setAcceptedCompression ($compMethod)
 
 setCaCertificate ($caCert, $isDir=false)
 
 setCertificate ($cert, $certPass)
 
 setCookie ($name, $value='', $path='', $domain='', $port=null)
 
 setCredentials ($u, $p, $t=1)
 
 SetCurlOptions ($options)
 
 setDebug ($in)
 
 setKey ($key, $keyPass)
 
 setProxy ($proxyHost, $proxyPort, $proxyUsername='', $proxyPassword='', $proxyAuthType=1)
 
 setRequestCompression ($compMethod)
 
 setSSLVerifyHost ($i)
 
 setSSLVerifyPeer ($i)
 
 setSSLVersion ($i)
 
 SetUserAgent ($agentString)
 

Data Fields

 $accepted_charset_encodings = array()
 
 $accepted_compression = array()
 
 $authtype = 1
 
 $cacert = ''
 
 $cacertdir = ''
 
 $cert = ''
 
 $certpass = ''
 
 $cookies = array()
 
 $debug = 0
 
 $errno
 
 $errstr
 
 $extracurlopts = array()
 
 $keepalive = false
 
 $key = ''
 
 $keypass = ''
 
 $method = 'http'
 
 $no_multicall = false
 
 $password = ''
 
 $path
 
 $port = 0
 
 $proxy = ''
 
 $proxy_authtype = 1
 
 $proxy_pass = ''
 
 $proxy_user = ''
 
 $proxyport = 0
 
 $request_charset_encoding = ''
 
 $request_compression = ''
 
 $return_type = 'xmlrpcvals'
 
 $server
 
 $sslversion = 0
 
 $user_agent
 
 $username = ''
 
 $verifyhost = 2
 
 $verifypeer = true
 
 $xmlrpc_curl_handle = null
 

Protected Member Functions

 sendPayloadCURL ($req, $server, $port, $timeout=0, $username='', $password='', $authType=1, $cert='', $certPass='', $caCert='', $caCertDir='', $proxyHost='', $proxyPort=0, $proxyUsername='', $proxyPassword='', $proxyAuthType=1, $method='https', $keepAlive=false, $key='', $keyPass='', $sslVersion=0)
 
 sendPayloadHTTP10 ($req, $server, $port, $timeout=0, $username='', $password='', $authType=1, $proxyHost='', $proxyPort=0, $proxyUsername='', $proxyPassword='', $proxyAuthType=1, $method='http')
 
 sendPayloadHTTPS ($req, $server, $port, $timeout=0, $username='', $password='', $authType=1, $cert='', $certPass='', $caCert='', $caCertDir='', $proxyHost='', $proxyPort=0, $proxyUsername='', $proxyPassword='', $proxyAuthType=1, $keepAlive=false, $key='', $keyPass='', $sslVersion=0)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

PhpXmlRpc\Client::__construct (   $path,
  $server = '',
  $port = '',
  $method = '' 
)
Parameters
string$patheither the complete server URL or the PATH part of the xmlrc server URL, e.g. /xmlrpc/server.php
string$serverthe server name / ip address
integer$portthe port the server is listening on, defaults to 80 or 443 depending on protocol used
string$methodthe http protocol variant: defaults to 'http', 'https' and 'http11' can be used if CURL is installed

Definition at line 86 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

Member Function Documentation

◆ multicall()

PhpXmlRpc\Client::multicall (   $reqs,
  $timeout = 0,
  $method = '',
  $fallback = true 
)

Send an array of requests 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
Request[]$reqsan array of Request objects
integer$timeoutconnection timeout (in seconds)
string$methodthe http protocol variant to be used
booleanfallback When true, upon receiving an error during multicall, multiple single calls will be attempted
Returns
array

Definition at line 917 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ send()

PhpXmlRpc\Client::send (   $req,
  $timeout = 0,
  $method = '' 
)

Send an xmlrpc request.

Parameters
Request | Request[] | string$reqThe Request object, or an array of requests for using multicall, or the complete xml representation of a request
integer$timeoutConnection timeout, in seconds, If unspecified, a platform specific timeout will apply
string$methodif left unspecified, the http protocol chosen during creation of the object will be used
Returns
Response|Response[]

Definition at line 356 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ sendPayloadCURL()

PhpXmlRpc\Client::sendPayloadCURL (   $req,
  $server,
  $port,
  $timeout = 0,
  $username = '',
  $password = '',
  $authType = 1,
  $cert = '',
  $certPass = '',
  $caCert = '',
  $caCertDir = '',
  $proxyHost = '',
  $proxyPort = 0,
  $proxyUsername = '',
  $proxyPassword = '',
  $proxyAuthType = 1,
  $method = 'https',
  $keepAlive = false,
  $key = '',
  $keyPass = '',
  $sslVersion = 0 
)
protected

Contributed by Justin Miller justi.nosp@m.n@vo.nosp@m.xel.n.nosp@m.et Requires curl to be built into PHP NB: CURL versions before 7.11.10 cannot use proxy to talk to https servers!

Parameters
Request$req
string$server
int$port
int$timeout
string$username
string$password
int$authType
string$cert
string$certPass
string$caCert
string$caCertDir
string$proxyHost
int$proxyPort
string$proxyUsername
string$proxyPassword
int$proxyAuthType
string$method
bool$keepAlive
string$key
string$keyPass
int$sslVersion
Returns
Response

Definition at line 676 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ sendPayloadHTTP10()

PhpXmlRpc\Client::sendPayloadHTTP10 (   $req,
  $server,
  $port,
  $timeout = 0,
  $username = '',
  $password = '',
  $authType = 1,
  $proxyHost = '',
  $proxyPort = 0,
  $proxyUsername = '',
  $proxyPassword = '',
  $proxyAuthType = 1,
  $method = 'http' 
)
protected
Parameters
Request$req
string$server
int$port
int$timeout
string$username
string$password
int$authType
string$proxyHost
int$proxyPort
string$proxyUsername
string$proxyPassword
int$proxyAuthType
string$method
Returns
Response

Definition at line 459 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

References $op.

◆ sendPayloadHTTPS()

PhpXmlRpc\Client::sendPayloadHTTPS (   $req,
  $server,
  $port,
  $timeout = 0,
  $username = '',
  $password = '',
  $authType = 1,
  $cert = '',
  $certPass = '',
  $caCert = '',
  $caCertDir = '',
  $proxyHost = '',
  $proxyPort = 0,
  $proxyUsername = '',
  $proxyPassword = '',
  $proxyAuthType = 1,
  $keepAlive = false,
  $key = '',
  $keyPass = '',
  $sslVersion = 0 
)
protected
Parameters
Request$req
string$server
int$port
int$timeout
string$username
string$password
int$authType
string$cert
string$certPass
string$caCert
string$caCertDir
string$proxyHost
int$proxyPort
string$proxyUsername
string$proxyPassword
int$proxyAuthType
bool$keepAlive
string$key
string$keyPass
int$sslVersion
Returns
Response

Definition at line 638 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setAcceptedCompression()

PhpXmlRpc\Client::setAcceptedCompression (   $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$compMethodeither 'gzip', 'deflate', 'any' or ''

Definition at line 276 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setCaCertificate()

PhpXmlRpc\Client::setCaCertificate (   $caCert,
  $isDir = false 
)

Add a CA certificate to verify server with (see man page about CURLOPT_CAINFO for more details).

Parameters
string$caCertcertificate file name (or dir holding certificates)
bool$isDirset to true to indicate cacert is a dir. defaults to false

Definition at line 197 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setCertificate()

PhpXmlRpc\Client::setCertificate (   $cert,
  $certPass 
)

Add a client-side https certificate.

Parameters
string$cert
string$certPass

Definition at line 184 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setCookie()

PhpXmlRpc\Client::setCookie (   $name,
  $value = '',
  $path = '',
  $domain = '',
  $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
Todo:
check correctness of urlencoding cookie value (copied from php way of doing it...)

Definition at line 312 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setCredentials()

PhpXmlRpc\Client::setCredentials (   $u,
  $p,
  $t = 1 
)

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

Parameters
string$uusername
string$ppassword
integer$tauth type. See curl_setopt man page for supported auth types. Defaults to CURLAUTH_BASIC (basic auth)

Definition at line 171 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ SetCurlOptions()

PhpXmlRpc\Client::SetCurlOptions (   $options)

Directly set cURL options, for extra flexibility It allows eg. to bind client to a specific IP interface / address.

Parameters
array$options

Definition at line 331 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setDebug()

PhpXmlRpc\Client::setDebug (   $in)

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

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

Definition at line 159 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setKey()

PhpXmlRpc\Client::setKey (   $key,
  $keyPass 
)

Set attributes for SSL communication: private SSL key NB: does not work in older php/curl installs Thanks to Daniel Convissor.

Parameters
string$keyThe name of a file containing a private SSL key
string$keyPassThe secret password needed to use the private SSL key

Definition at line 214 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setProxy()

PhpXmlRpc\Client::setProxy (   $proxyHost,
  $proxyPort,
  $proxyUsername = '',
  $proxyPassword = '',
  $proxyAuthType = 1 
)

Set proxy info.

Parameters
string$proxyHost
string$proxyPortDefaults to 8080 for HTTP and 443 for HTTPS
string$proxyUsernameLeave blank if proxy has public access
string$proxyPasswordLeave blank if proxy has public access
int$proxyAuthTypeset to constant CURLAUTH_NTLM to use NTLM auth with proxy

Definition at line 259 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setRequestCompression()

PhpXmlRpc\Client::setRequestCompression (   $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$compMethodeither 'gzip', 'deflate' or ''

Definition at line 294 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setSSLVerifyHost()

PhpXmlRpc\Client::setSSLVerifyHost (   $i)

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

Parameters
int$i

Definition at line 235 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setSSLVerifyPeer()

PhpXmlRpc\Client::setSSLVerifyPeer (   $i)

Set attributes for SSL communication: verify server certificate.

Parameters
bool$ienable/disable verification of peer certificate

Definition at line 225 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ setSSLVersion()

PhpXmlRpc\Client::setSSLVersion (   $i)

Set attributes for SSL communication: SSL version to use. Best left at 0 (default value ): let cURL decide

Parameters
int$i

Definition at line 245 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ SetUserAgent()

PhpXmlRpc\Client::SetUserAgent (   $agentString)

Set user-agent string that will be used by this client instance in http headers sent to the server.

Parameters
string$agentString

Definition at line 342 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

Field Documentation

◆ $accepted_charset_encodings

PhpXmlRpc\Client::$accepted_charset_encodings = array()

Charset encodings that can be decoded without problems by the client.

Definition at line 67 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ $accepted_compression

PhpXmlRpc\Client::$accepted_compression = array()

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

Definition at line 53 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ $authtype

PhpXmlRpc\Client::$authtype = 1

◆ $cacert

PhpXmlRpc\Client::$cacert = ''

◆ $cacertdir

PhpXmlRpc\Client::$cacertdir = ''

◆ $cert

PhpXmlRpc\Client::$cert = ''

◆ $certpass

PhpXmlRpc\Client::$certpass = ''

◆ $cookies

PhpXmlRpc\Client::$cookies = array()

◆ $debug

PhpXmlRpc\Client::$debug = 0

◆ $errno

PhpXmlRpc\Client::$errno

◆ $errstr

PhpXmlRpc\Client::$errstr

◆ $extracurlopts

PhpXmlRpc\Client::$extracurlopts = array()

◆ $keepalive

PhpXmlRpc\Client::$keepalive = false

Whether to use persistent connections for http 1.1 and https.

Definition at line 65 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ $key

PhpXmlRpc\Client::$key = ''

◆ $keypass

PhpXmlRpc\Client::$keypass = ''

◆ $method

PhpXmlRpc\Client::$method = 'http'
Todo:
: do these need to be public?

Definition at line 10 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ $no_multicall

PhpXmlRpc\Client::$no_multicall = false

◆ $password

PhpXmlRpc\Client::$password = ''

◆ $path

PhpXmlRpc\Client::$path

◆ $port

PhpXmlRpc\Client::$port = 0

◆ $proxy

PhpXmlRpc\Client::$proxy = ''

◆ $proxy_authtype

PhpXmlRpc\Client::$proxy_authtype = 1

◆ $proxy_pass

PhpXmlRpc\Client::$proxy_pass = ''

◆ $proxy_user

PhpXmlRpc\Client::$proxy_user = ''

◆ $proxyport

PhpXmlRpc\Client::$proxyport = 0

◆ $request_charset_encoding

PhpXmlRpc\Client::$request_charset_encoding = ''

Charset encoding to be used in serializing request. NULL = use ASCII.

Definition at line 69 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ $request_compression

PhpXmlRpc\Client::$request_compression = ''

Name of compression scheme to be used for sending requests. Either null, gzip or deflate.

Definition at line 58 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ $return_type

PhpXmlRpc\Client::$return_type = 'xmlrpcvals'

Decides the content of Response objects returned by calls to send() valid strings are 'xmlrpcvals', 'phpvals' or 'xml'.

Definition at line 74 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ $server

PhpXmlRpc\Client::$server

◆ $sslversion

PhpXmlRpc\Client::$sslversion = 0

◆ $user_agent

PhpXmlRpc\Client::$user_agent

Sent to servers in http headers.

Definition at line 78 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.

◆ $username

PhpXmlRpc\Client::$username = ''

◆ $verifyhost

PhpXmlRpc\Client::$verifyhost = 2

◆ $verifypeer

PhpXmlRpc\Client::$verifypeer = true

◆ $xmlrpc_curl_handle

PhpXmlRpc\Client::$xmlrpc_curl_handle = null

CURL handle: used for keep-alive connections (PHP 4.3.8 up, see: http://curl.haxx.se/docs/faq.html#7.3).

Definition at line 63 of file generic/plagiarism/vendor/phpxmlrpc/phpxmlrpc/src/Client.php.


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