XML_RPC2
[ class tree: XML_RPC2 ] [ index: XML_RPC2 ] [ all elements ]

Class: XML_RPC2_Client

Source Location: /XML_RPC2-1.1.2/XML/RPC2/Client.php

Class Overview


XML_RPC client class. Use this class to access remote methods.


Author(s):

Copyright:

  • 2004-2006 Sergio Carvalho

Variables

Methods


Child classes:

XML_RPC2_Backend_Xmlrpcext_Client
XML_RPC client backend class. This backend class uses the XMLRPCext extension to execute the call.
XML_RPC2_Backend_Php_Client
XML_RPC client backend class. This is the default, all-php XML_RPC client backend.

Inherited Variables

Inherited Methods


Class Details

[line 73]
XML_RPC client class. Use this class to access remote methods.

To use this class, construct it providing the server URL and method prefix. Then, call remote methods on the new instance as if they were local.

Example:

  1.   require_once 'XML_RPC2/Client.php';
  2.  
  3.   $client XML_RPC2_Client('http://xmlrpc.example.com/1.0/''example.');
  4.   $result $client->hello('Sergio');
  5.   print($result);

The above example will call the example.hello method on the xmlrpc.example.com server, under the /1.0/ URI.



[ Top ]


Class Variables

$connectionTimeout =  null

[line 131]

Holds the connection timeout in milliseconds of the client request.
  • Access: protected

Type:   integer


[ Top ]

$debug =  false

[line 103]

Holds the debug flag
  • Access: protected

Type:   boolean


[ Top ]

$encoding =  'utf-8'

[line 110]

Hold the encoding of the client request
  • Access: protected

Type:   string


[ Top ]

$escaping = array('non-ascii', 'non-print', 'markup')

[line 117]

Holds the escaping method(s) of the client request
  • Access: protected

Type:   string


[ Top ]

$httpRequest =

[line 145]

Preconfigured HTTP_Request2 provided by the user
  • Access: protected

Type:   HTTP_Request2


[ Top ]

$prefix =  null

[line 96]

Holds the prefix to prepend to method names
  • Access: protected

Type:   string


[ Top ]

$proxy =  null

[line 89]

proxy Field (holds the proxy server data)
  • Access: protected

Type:   string


[ Top ]

$sslverify =  true

[line 124]

Holds the SSL verify flag
  • Access: protected

Type:   boolean


[ Top ]

$uglyStructHack =  true

[line 138]

ugly hack flag to avoid http://bugs.php.net/bug.php?id=21949

see XML_RPC2_Backend_Xmlrpcext_Value::createFromNative() from more infos

  • Access: protected

Type:   mixed


[ Top ]

$uri =  null

[line 82]

uri Field (holds the uri for the XML_RPC server)
  • Access: protected

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 164]

XML_RPC2_Client __construct( string $uri, [array $options = array()])

Construct a new XML_RPC2_Client.

To create a new XML_RPC2_Client, a URI must be provided (e.g. http://xmlrpc.example.com/1.0/). Optionally, some options may be set as an associative array. Accepted keys are : 'prefix', 'proxy', 'debug' => see correspondant property to get more informations 'encoding' => The XML encoding for the requests (optional, defaults to utf-8) 'sslverify' => boolean, true iff SSL certificates are to be verified against local cert database (optional, default false) 'connectionTimeout' => Timeout, in seconds, for the XML-RPC HTTP request (optional, default is no timeout) 'httpRequest' => Preconfigured HTTP_Request2 instance to be used in executing the XML-RPC calls (optional)

  • Access: protected

Overridden in child classes as:

XML_RPC2_Backend_Xmlrpcext_Client::__construct()
Construct a new XML_RPC2_Client PHP Backend.
XML_RPC2_Backend_Php_Client::__construct()
Construct a new XML_RPC2_Client PHP Backend.

Parameters:

string   $uri   —  URI for the XML-RPC server
array   $options   —  (optional) Associative array of options

[ Top ]

create   [line 229]

void create( string $uri, [array $options = array()])

Factory method to select, create and return a XML_RPC2_Client backend

To create a new XML_RPC2_Client, a URI must be provided (e.g. http://xmlrpc.example.com/1.0/).

Optionally, some options may be set.

  • Access: public

Parameters:

string   $uri   —  URI for the XML-RPC server
array   $options   —  (optional) associative array of options (see constructor)

[ Top ]

__call   [line 257]

mixed __call( string $methodName, array $parameters)

__call Catchall. This method catches remote method calls and provides for remote forwarding.

If the parameters are native types, this method will use XML_RPC_Value::createFromNative to convert it into an XML-RPC type. Whenever a parameter is already an instance of XML_RPC_Value it will be used as provided. It follows that, in situations when XML_RPC_Value::createFromNative proves inacurate -- as when encoding DateTime values -- you should present an instance of XML_RPC_Value in lieu of the native parameter.

  • Return: The call result, already decoded into native types
  • Abstract:
  • Access: public

Overridden in child classes as:

XML_RPC2_Backend_Xmlrpcext_Client::__call()
__call Catchall. This method catches remote method calls and provides for remote forwarding.
XML_RPC2_Backend_Php_Client::__call()
__call Catchall. This method catches remote method calls and provides for remote forwarding.

Parameters:

string   $methodName   —  Method name
array   $parameters   —  Parameters

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:56:38 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.