PHP Class Habari\XMLRPCClient

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();
Datei anzeigen Open project: habari/system

Public Methods

Method Description
__call ( string $fname, array $args ) : array Allow method overloading for this class.
__construct ( string $xmlrpc_entrypoint, $scope = null ) Create the XMLRPCClient
__get ( string $scope ) : XMLRPCClient 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' );
open ( string $xmlrpc_entrypoint ) : XMLRPCClient Convenience method to create a new XMLRPCClient object Example: XMLRPCClient::open( 'http://rpc.pingomatic.com' )->weblogUpdates->ping( 'Blog name', 'http://example.com' );
set_scope ( string $scope ) Set the scope of any subsequent function calls The default scope is 'system'.

Method Details

__call() public method

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.
public __call ( string $fname, array $args ) : array
$fname string The function name to call
$args array An array of arguments that were called with the function
return array The result array

__construct() public method

Create the XMLRPCClient
public __construct ( string $xmlrpc_entrypoint, $scope = null )
$xmlrpc_entrypoint string The entrypoint of the remote server

__get() public method

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' );
public __get ( string $scope ) : XMLRPCClient
$scope string The scope to set this object to.
return XMLRPCClient This object instance

open() public static method

Convenience method to create a new XMLRPCClient object Example: XMLRPCClient::open( 'http://rpc.pingomatic.com' )->weblogUpdates->ping( 'Blog name', 'http://example.com' );
public static open ( string $xmlrpc_entrypoint ) : XMLRPCClient
$xmlrpc_entrypoint string The entrypoint of the remote server
return XMLRPCClient The created client object

set_scope() public method

Set the scope of any subsequent function calls The default scope is 'system'.
public set_scope ( string $scope )
$scope string The scope to use