Public Member Functions | Static Public Member Functions

XMLRPCClient Class Reference

List of all members.

Public Member Functions

 __construct ($xmlrpc_entrypoint, $scope=null)
 set_scope ($scope)
 __call ($fname, $args)
 __get ($scope)

Static Public Member Functions

static open ($xmlrpc_entrypoint)

Detailed Description

Create an XMLRPC client connection

To Use: // Create the object using the XMLRPC entrypoint and scope. $rpc= new XMLRPCClient( 'http://rpc.pingomatic.com', 'weblogUpdates' ); // Make a weblogUpdates.ping call on the client. $result= $rpc->ping( 'Blog name', 'http://example.com' );

// Change the scope on the existing client object. $rpc->set_scope( 'system' ); // Make a system.listMethods call on the client. $methods= $rpc->listMethods();

Todo:
Handle XMLRPC fault results by returning some error value.

Definition at line 27 of file xmlrpcclient.php.


Constructor & Destructor Documentation

XMLRPCClient::__construct ( xmlrpc_entrypoint,
scope = null 
)

Create the XMLRPCClient

Parameters:
string $xmlrpc_entrypoint The entrypoint of the remote server

Definition at line 37 of file xmlrpcclient.php.


Member Function Documentation

XMLRPCClient::__call ( fname,
args 
)

Allow method overloading for this class. This method allows any method name to be called on this object. The method called is the method called via RPC, within the scope defined in $this->scope.

Parameters:
string $fname The function name to call
array $args An array of arguments that were called with the function
Returns:
array The result array

Definition at line 65 of file xmlrpcclient.php.

XMLRPCClient::__get ( scope  ) 

Allow scoped functions to be called in shorthand Example: // Create the XMLRPC object $rpc= new XMLRPCClient( 'http://rpc.pingomatic.com' ); // Call weblogUpdates.ping RPC call $rpc->weblogUpdates->ping( 'Blog name', 'http://example.com' );

Parameters:
string $scope The scope to set this object to.
Returns:
XMLRPCClient This object instance

Definition at line 131 of file xmlrpcclient.php.

static XMLRPCClient::open ( xmlrpc_entrypoint  )  [static]

Convenience method to create a new XMLRPCClient object Example: XMLRPCClient::open( 'http://rpc.pingomatic.com' )->weblogUpdates->ping( 'Blog name', 'http://example.com' );

Parameters:
string $xmlrpc_entrypoint The entrypoint of the remote server
Returns:
XMLRPCClient The created client object

Definition at line 146 of file xmlrpcclient.php.

Referenced by Pingback::send_pingback().

XMLRPCClient::set_scope ( scope  ) 

Set the scope of any subsequent function calls The default scope is 'system'.

Parameters:
string $scope The scope to use

Definition at line 51 of file xmlrpcclient.php.

Referenced by __get().


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