/** * Factory method to select, create and return a XML_RPC2_Client backend * * To create a new XML_RPC2_Client, a URI must be provided (e.g. http://xmlrpc.example.com/1.0/). * * Optionally, some options may be set. * * @param string URI for the XML-RPC server * @param array (optional) associative array of options (see constructor) */ public static function create($uri, $options = array()) { if (isset($options['backend'])) { XML_RPC2_Backend::setBackend($options['backend']); } $backend = XML_RPC2_Backend::getClientClassname(); return new $backend($uri, $options); }
/** * Factory method to select, create and return a XML_RPC2_Client backend * * To create a new XML_RPC2_Client, a URI must be provided (e.g. http://xmlrpc.example.com/1.0/). * * Optionally, some options may be set. * * @param string URI for the XML-RPC server * @param array (optional) associative array of options (see constructor) */ public static function create($uri, $options = array()) { if (isset($this)) { // Method called non-statically forward to remote call() as RPC $this->__call('create', func_get_args()); } if (isset($options['backend'])) { XML_RPC2_Backend::setBackend($options['backend']); } $backend = XML_RPC2_Backend::getClientClassname(); return new $backend($uri, $options); }