/[cvs]/nfo/php/libs/org.netfrag.flib/Application/RPC/Remote.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.flib/Application/RPC/Remote.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joko, Sun Dec 1 17:23:58 2002 UTC revision 1.2 by joko, Thu Dec 5 21:45:31 2002 UTC
# Line 3  Line 3 
3  ##    $Id$  ##    $Id$
4  ##    --------------------------------------------------------------------------  ##    --------------------------------------------------------------------------
5  ##    $Log$  ##    $Log$
6    ##    Revision 1.2  2002/12/05 21:45:31  joko
7    ##    + debugging
8    ##
9  ##    Revision 1.1  2002/12/01 17:23:58  joko  ##    Revision 1.1  2002/12/01 17:23:58  joko
10  ##    + initial check-in  ##    + initial check-in
11  ##  ##
# Line 22  class Remote { Line 25  class Remote {
25        
26    function Remote($args = array()) {    function Remote($args = array()) {
27      global $cfg;      global $cfg;
28        //print "new Remote<br>";
29      $this->host = $cfg[rpcinfo][Host];      $this->host = $cfg[rpcinfo][Host];
30      $this->port = $cfg[rpcinfo][Port];      $this->port = $cfg[rpcinfo][Port];
31      if ($args['Host']) { $this->host = $args['Host']; }      if ($args['Host']) { $this->host = $args['Host']; }
32      if ($args['Port']) { $this->port = $args['Port']; }      if ($args['Port']) { $this->port = $args['Port']; }
33    }    }
34    
35    function &send($command, $data = "") {    function send($command, $data = "") {
36      //$encoder = new Text_Encode($data);      //$encoder = new Text_Encode($data);
37      //$encoder->toUTF8();      //$encoder->toUTF8();
38      return $this->call($command, $data, 1);      return $this->call($command, $data, 1);
39    }    }
40    
41    function &call($command, $data = "", $decode = 0) {    function call($command, $data = "", $decode = 0) {
42    
43    //print "call: <hr>";
44    
45      // data      // data
46        $data_enc = XML_RPC_encode($data);        $data_enc = XML_RPC_encode($data);
# Line 46  class Remote { Line 52  class Remote {
52        $rpc = new XML_RPC_Client("/", $this->host, $this->port);        $rpc = new XML_RPC_Client("/", $this->host, $this->port);
53        $rpc->setDebug(0);        $rpc->setDebug(0);
54        if ( !$msg_response = $rpc->send($msg) ) {        if ( !$msg_response = $rpc->send($msg) ) {
55            // TODO: redirect this error elsewhere!
56            //print "RPC-error!<br>";
57          return;          return;
58        }        }
59      // message - response      // message - response

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed