--- nfo/php/libs/org.netfrag.glib/DesignPattern/RemoteProxy.php 2003/03/10 23:05:25 1.9 +++ nfo/php/libs/org.netfrag.glib/DesignPattern/RemoteProxy.php 2003/03/28 03:05:54 1.10 @@ -15,9 +15,12 @@ * *
  * -------------------------------------------------------------------------
- *    $Id: RemoteProxy.php,v 1.9 2003/03/10 23:05:25 joko Exp $
+ *    $Id: RemoteProxy.php,v 1.10 2003/03/28 03:05:54 joko Exp $
  * -------------------------------------------------------------------------
  *    $Log: RemoteProxy.php,v $
+ *    Revision 1.10  2003/03/28 03:05:54  joko
+ *    more fancy debugging-output
+ *
  *    Revision 1.9  2003/03/10 23:05:25  joko
  *    + fixed metadata for phpDocumentor
  *
@@ -476,6 +479,7 @@
           logp(get_class($this) . "->_loadRemote: argument 'guid' requires 'classname'", PEAR_LOG_WARNING);
           return;
         }
+        logp(get_class($this) . "->_loadRemote: getObjectByGuid", PEAR_LOG_DEBUG);
         $args = array( guid => $this->objectId, classname => $this->meta[classname] );
         $result = $this->backend->send('getObjectByGuid', $args );
 
@@ -484,6 +488,7 @@
           logp(get_class($this) . "->_loadRemote: argument 'oid' requires valid objectId", PEAR_LOG_WARNING);
           return;
         }
+        logp(get_class($this) . "->_loadRemote: getObject", PEAR_LOG_DEBUG);
         $result = $this->backend->send('getObject', $this->objectId);
 
       } elseif ($this->meta[key]) {
@@ -497,15 +502,36 @@
           return;
         }
         */
+        //logp(get_class($this) . "->_loadRemote: $this->meta[command](" . join(' ', $this->meta[query]) . ")", PEAR_LOG_DEBUG);
+        //print Dumper(array($this->meta[command], $this->meta[query]));
         $result = $this->backend->send($this->meta[command], $this->meta[query]);
         
       }
 
+    //print "result: " . dumpVar($result) . "
"; + $status = $this->backend->getStatus(); + //print Dumper($status); + + $style = html_style("text/css", '.caption { color: yellow }'); - if ($result) { - //print "result: " . dumpVar($result) . "
"; - if (count($result) == 0) { return; } + $statusbox = html_div(); + $statusbox->set_style('background: #558856; border: 2px black groove; width:640px; padding:10px; margin:40px;'); + $statusbox->add( html_b("Connected:"), $status[connected], html_br() ); + $statusbox->add( html_span('caption', "Connected:"), $status[connected], html_br() ); + foreach ($status[errors] as $error) { + $statusbox->add( html_span('caption', "Error[$error[code]]:"), $error[message], html_br() ); + } + + if (is_array($result)) { + $good = 1; + } else { + $message = get_class($this) . "->_loadRemote: Error while trying to talk to remote side. Please check wire, socket or api."; + $statusbox->add( $message, html_br() ); + logp($message, PEAR_LOG_CRIT); + } + + if ($good && sizeof($result)) { // FIXME: this is dangerous! if ($_GET[debug]) { @@ -518,9 +544,11 @@ $this->_saveProxy(); //print "oid: $this->objectId
"; $this->flushState(); + } else { - //print "Error in _loadRemote!!!
"; - logp(get_class($this) . "->_loadRemote: error while trying to talk to remote side", PEAR_LOG_CRIT); + print $style->render(); + print $statusbox->render(); + } }