Login   Register  
PHP Classes
elePHPant
Icontem

File: class.remotetest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ivan Ristic  >  XML-RPC Class Server  >  class.remotetest.php  >  Download  
File: class.remotetest.php
Role: ???
Content type: text/plain
Description: Proxy class for the remote class Test
Class: XML-RPC Class Server
Turns any PHP class into an XML-RPC server
Author: By
Last change:
Date: 2002-05-09 19:49
Size: 926 bytes
 

Contents

Class file image Download
<?

/**
 * This is a proxy class for the real class Test; a
 * proxy object will communicate with the real object
 * via XML-RPC
 */
class Test {

    /**
     * Get the constructor parameters and use them to construct
     * the URL.
     */
    function Test() {
        $this->host = XCS_HOST;
        $this->uri = XCS_URI;
        
        $j = 0;
        $i = func_num_args();
        
        while($j < $i) {
            $this->params .= func_get_arg($j) . '/';
            $j++;
        }
    }

    /**
     * Call the real method using XML-RPC
     */
    function sayHello($name) {

        return xu_rpc_http_concise(
            array(method => "sayhello",
                args => $name,
                host => $this->host,
                uri  => $this->uri . '/' . get_class($this) . '/' . $this->params));
    }

    var $host;
    var $uri;
    var $params;
}

?>