/[cvs]/nfo/php/libs/org.netfrag.glib/DesignPattern/RemoteProxy.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.glib/DesignPattern/RemoteProxy.php

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

revision 1.9 by joko, Mon Mar 10 23:05:25 2003 UTC revision 1.10 by joko, Fri Mar 28 03:05:54 2003 UTC
# Line 18  Line 18 
18   *    $Id$   *    $Id$
19   * -------------------------------------------------------------------------   * -------------------------------------------------------------------------
20   *    $Log$   *    $Log$
21     *    Revision 1.10  2003/03/28 03:05:54  joko
22     *    more fancy debugging-output
23     *
24   *    Revision 1.9  2003/03/10 23:05:25  joko   *    Revision 1.9  2003/03/10 23:05:25  joko
25   *    + fixed metadata for phpDocumentor   *    + fixed metadata for phpDocumentor
26   *   *
# Line 476  class DesignPattern_RemoteProxy extends Line 479  class DesignPattern_RemoteProxy extends
479            logp(get_class($this) . "->_loadRemote: argument 'guid' requires 'classname'", PEAR_LOG_WARNING);            logp(get_class($this) . "->_loadRemote: argument 'guid' requires 'classname'", PEAR_LOG_WARNING);
480            return;            return;
481          }          }
482            logp(get_class($this) . "->_loadRemote: getObjectByGuid", PEAR_LOG_DEBUG);
483          $args = array( guid => $this->objectId, classname => $this->meta[classname] );          $args = array( guid => $this->objectId, classname => $this->meta[classname] );
484          $result = $this->backend->send('getObjectByGuid', $args );          $result = $this->backend->send('getObjectByGuid', $args );
485    
# Line 484  class DesignPattern_RemoteProxy extends Line 488  class DesignPattern_RemoteProxy extends
488            logp(get_class($this) . "->_loadRemote: argument 'oid' requires valid objectId", PEAR_LOG_WARNING);            logp(get_class($this) . "->_loadRemote: argument 'oid' requires valid objectId", PEAR_LOG_WARNING);
489            return;            return;
490          }          }
491            logp(get_class($this) . "->_loadRemote: getObject", PEAR_LOG_DEBUG);
492          $result = $this->backend->send('getObject', $this->objectId);          $result = $this->backend->send('getObject', $this->objectId);
493    
494        } elseif ($this->meta[key]) {        } elseif ($this->meta[key]) {
# Line 497  class DesignPattern_RemoteProxy extends Line 502  class DesignPattern_RemoteProxy extends
502            return;            return;
503          }          }
504          */          */
505            //logp(get_class($this) . "->_loadRemote: $this->meta[command](" . join(' ', $this->meta[query]) . ")", PEAR_LOG_DEBUG);
506            //print Dumper(array($this->meta[command], $this->meta[query]));
507          $result = $this->backend->send($this->meta[command], $this->meta[query]);          $result = $this->backend->send($this->meta[command], $this->meta[query]);
508                    
509        }        }
510    
511        //print "result: " . dumpVar($result) . "<br>";
512    
513        $status = $this->backend->getStatus();
514        //print Dumper($status);
515        
516        $style = html_style("text/css", '.caption { color: yellow }');
517            
518      if ($result) {      $statusbox = html_div();
519        //print "result: " . dumpVar($result) . "<br>";      $statusbox->set_style('background: #558856; border: 2px black groove; width:640px; padding:10px; margin:40px;');
520        if (count($result) == 0) { return; }      $statusbox->add( html_b("Connected:"), $status[connected], html_br() );
521        $statusbox->add( html_span('caption', "Connected:"), $status[connected], html_br() );
522        foreach ($status[errors] as $error) {
523          $statusbox->add( html_span('caption', "Error[$error[code]]:"), $error[message], html_br() );
524        }
525        
526        if (is_array($result)) {
527          $good = 1;
528        } else {
529          $message = get_class($this) . "->_loadRemote: Error while trying to talk to remote side. Please check wire, socket or api.";
530          $statusbox->add( $message, html_br() );
531          logp($message, PEAR_LOG_CRIT);
532        }
533    
534        if ($good && sizeof($result)) {
535                
536        // FIXME: this is dangerous!        // FIXME: this is dangerous!
537        if ($_GET[debug]) {        if ($_GET[debug]) {
# Line 518  class DesignPattern_RemoteProxy extends Line 544  class DesignPattern_RemoteProxy extends
544        $this->_saveProxy();        $this->_saveProxy();
545        //print "oid: $this->objectId<br>";        //print "oid: $this->objectId<br>";
546        $this->flushState();        $this->flushState();
547        
548      } else {      } else {
549        //print "Error in _loadRemote!!!<br>";        print $style->render();
550        logp(get_class($this) . "->_loadRemote: error while trying to talk to remote side", PEAR_LOG_CRIT);        print $statusbox->render();
551        
552      }      }
553            
554    }    }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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