silverorange / xml_rpc2
Fork of PEAR's XML_RPC2 package. Packaged for composer and working in PHP 7.
Requires
- php: >=8.2
- ext-mbstring: *
- pear/http_request2: ^2.3.0
- pear/pear-core-minimal: ^1.10
- pear/pear_exception: ^1.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.64.0
- pear/cache_lite: ^1.8.0
- phpstan/phpstan: ^1.12
- phpunit/phpunit: *
- rector/rector: ^1.2
- silverorange/php-coding-tools: ^1.4
Suggests
- pear/cache_lite: Adds caching layer to client and server
README
XML_RPC2 is a package providing XML-RPC client and server services. XML-RPC is a simple remote procedure call protocol built using HTTP as transport and XML as the encoding.As a client library, XML_RPC2 is capable of creating a proxy class which exposes the methods exported by the server. As a server library, XML_RPC2 is capable of exposing methods from a class or object instance, seamlessly exporting local methods as remotely callable procedures.
This fork maintained by silverorange updates the package for PHP 7 and composer compatibility.
Basic Usage
<?php $options = array( 'prefix' => 'package.' ); $client = XML_RPC2_Client::create( 'http://pear.php.net/xmlrpc.php', $options ); try { $result = $client->info('XML_RPC2'); print_r($result); } catch (XML_RPC2_Exception_Fault $e) { // The XMLRPC server returns a XMLRPC error die('Exception #' . $e->getFaultCode() . ' : ' . $e->getFaultString()); } catch (Exception $e) { // Other errors (HTTP or networking problems...) die('Exception : ' . $e->getMessage()); } ?>
Installation
Make sure the silverorange composer repository is added to the composer.json
for the project and then run:
composer require silverorange/xml_rpc2