/[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.5 by jonen, Sun Dec 22 13:24:09 2002 UTC revision 1.6 by jonen, Mon Feb 3 03:37:45 2003 UTC
# Line 3  Line 3 
3  ##    $Id$  ##    $Id$
4  ##    --------------------------------------------------------------------------  ##    --------------------------------------------------------------------------
5  ##    $Log$  ##    $Log$
6    ##    Revision 1.6  2003/02/03 03:37:45  jonen
7    ##    - removed unused argument  '$decode' at function '_call()'
8    ##    + added argument '$options=array()' at function '_call()'
9    ##      which will be passed to function '&decodeData()' for e.g. utf8 decoding
10    ##    + added  '$encoder->toISO()' at '&decodeData()', (re)moved from 'ProxyObject.php'
11    ##
12  ##    Revision 1.5  2002/12/22 13:24:09  jonen  ##    Revision 1.5  2002/12/22 13:24:09  jonen
13  ##    + added utf8 encoding at 'send()' toggled by option  ##    + added utf8 encoding at 'send()' toggled by option
14  ##  ##
# Line 48  class Remote { Line 54  class Remote {
54        $encoder->toUTF8();        $encoder->toUTF8();
55      }      }
56      // call '_call' with 'decode'      // call '_call' with 'decode'
57      return $this->_call($command, $data, 1);      return $this->_call($command, $data, $options);
58    }    }
59    
60    function _call($command, $data = "", $decode = 0) {    function _call($command, $data = "", $options = array() ) {
61    
62     //print "call: $command<hr>";     //print "call: $command<hr>";
63    
# Line 76  class Remote { Line 82  class Remote {
82        $response_enc = $msg_response->value();        $response_enc = $msg_response->value();
83    
84        // TODO: what's this? prematurely returning here should not be considered "stable"....        // TODO: what's this? prematurely returning here should not be considered "stable"....
85        return $this->decodeData($response_enc);        return $this->decodeData($response_enc, $options);
   
     if ($decode) {  
       return $this->decodeData($response_enc);  
     } else {  
       return $response_enc;  
     }  
       
86    }    }
87        
88    function &decodeData(&$payload) {    function &decodeData(&$payload, $options = array() ) {
89      //if (!is_object($payload)) { return; }      //if (!is_object($payload)) { return; }
90        if ($payload) {        if ($payload) {
91      // data      // data
92          $data = XML_RPC_decode($payload);          $data = XML_RPC_decode($payload);
93          //print "data: " . dumpVar($response);          //print "data: " . dumpVar($response);
94    
95            //  decode UTF8 to ISO if wanted
96            if($options[utf8]) {
97              $encoder = new TextEncode($data);
98              $encoder->toISO();
99            }
100    
101          return $data;          return $data;
102        } else {        } else {
103          //print "ERROR!<br>";          //print "ERROR!<br>";

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

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