/[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.4 by jonen, Thu Dec 19 02:02:25 2002 UTC revision 1.5 by jonen, Sun Dec 22 13:24:09 2002 UTC
# Line 3  Line 3 
3  ##    $Id$  ##    $Id$
4  ##    --------------------------------------------------------------------------  ##    --------------------------------------------------------------------------
5  ##    $Log$  ##    $Log$
6    ##    Revision 1.5  2002/12/22 13:24:09  jonen
7    ##    + added utf8 encoding at 'send()' toggled by option
8    ##
9  ##    Revision 1.4  2002/12/19 02:02:25  jonen  ##    Revision 1.4  2002/12/19 02:02:25  jonen
10  ##    + minor changes  ##    + minor changes
11  ##  ##
# Line 38  class Remote { Line 41  class Remote {
41      if ($args['Port']) { $this->port = $args['Port']; }      if ($args['Port']) { $this->port = $args['Port']; }
42    }    }
43    
44    function send($command, $data = "") {    function send($command, $data = "", $options = array()) {
45      //$encoder = new Text_Encode($data);      // do 'encode' here and ...
46      //$encoder->toUTF8();      if ($options[utf8]) {
47      return $this->call($command, $data, 1);        $encoder = new TextEncode($data);
48          $encoder->toUTF8();
49        }
50        // call '_call' with 'decode'
51        return $this->_call($command, $data, 1);
52    }    }
53    
54    function call($command, $data = "", $decode = 0) {    function _call($command, $data = "", $decode = 0) {
55    
56    // print "call: $command<hr>";     //print "call: $command<hr>";
57    
58    // print Dumper($data);
59    
60      // data      // data
61        $data_enc = XML_RPC_encode($data);        $data_enc = XML_RPC_encode($data);
# Line 54  class Remote { Line 63  class Remote {
63      // message - request      // message - request
64        $msg = new XML_RPC_Message($command);        $msg = new XML_RPC_Message($command);
65        $msg->addParam($data_enc);        $msg->addParam($data_enc);
66    //print htmlentities($msg->serialize());
67      // remote procedure call      // remote procedure call
68        $rpc = new XML_RPC_Client("/", $this->host, $this->port);        $rpc = new XML_RPC_Client("/", $this->host, $this->port);
69        $rpc->setDebug(0);        $rpc->setDebug(0);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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