PHP XML-RPC client only inspired from package DarkaOnLine/Ripcord. The code was rewritted so as to isolate the XML-RPC client and fix code at the same time.
The PHP extension php-xmlrpc must be enabled.
Open a command console, enter your project directory and execute the following command to download the latest stable version of the client:
$ composer require aesislabs/php-xmlrpc-clientThis command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Create your client by calling the constructor with the URL of a XML-RPC server. Then, call the desired method with optional arguments:
require_once 'vendor/autoload.php';
use Aesislabs\Component\XmlRpc\Client;
// Create the client
$client = new Client('<xmlrpc_server_url>');
// Call a method and get result
$result = $client->call('method_name', $args = []);
- A
Aesislabs\Component\XmlRpc\Transport\TransportExceptionwhen the request to the server failed.- A
Aesislabs\Component\XmlRpc\Exception\RemoteExceptionis thrown if the XML-RPC server returns an error.- Both of previous exceptions extend exception
Aesislabs\Component\XmlRpc\Exception\RequestException
That's it!
- PHP 8.0 support
- Fixed exceptions
- Moved transport exception to transport folder.
- First release.