PHP XML-RPC Client Simplified

In my previous for XML-RPC client helper, I suggested to create a client instance to make your methods exposed and developer friendly. But may be some of us are too lazy write all the wrapper code. There is solution for that.

In this case you still need to create client instance which extends XMLRPCClientHelper, but this time you don't need to write all the wrapper code. Just simply add __call overload methods.

It's easy but you need to remember the service API.

Here is the code:

<?php
class TestXMLRPCClientSimplified extends XMLRPCClientHelper {
    public function __call($name, $arguments) {
        return $this->sendRequest("$name", $arguments);
    }    
}
?>

0 comments:

 
Copyright © peyotest