/[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.12 by joko, Sat Mar 29 08:01:21 2003 UTC
# Line 18  Line 18 
18   *    $Id$   *    $Id$
19   * -------------------------------------------------------------------------   * -------------------------------------------------------------------------
20   *    $Log$   *    $Log$
21     *    Revision 1.12  2003/03/29 08:01:21  joko
22     *    modified ErrorBoxing
23     *
24     *    Revision 1.11  2003/03/28 06:44:51  joko
25     *    VERBOSE mode
26     *
27     *    Revision 1.10  2003/03/28 03:05:54  joko
28     *    more fancy debugging-output
29     *
30   *    Revision 1.9  2003/03/10 23:05:25  joko   *    Revision 1.9  2003/03/10 23:05:25  joko
31   *    + fixed metadata for phpDocumentor   *    + fixed metadata for phpDocumentor
32   *   *
# Line 476  class DesignPattern_RemoteProxy extends Line 485  class DesignPattern_RemoteProxy extends
485            logp(get_class($this) . "->_loadRemote: argument 'guid' requires 'classname'", PEAR_LOG_WARNING);            logp(get_class($this) . "->_loadRemote: argument 'guid' requires 'classname'", PEAR_LOG_WARNING);
486            return;            return;
487          }          }
488            logp(get_class($this) . "->_loadRemote: getObjectByGuid", PEAR_LOG_DEBUG);
489          $args = array( guid => $this->objectId, classname => $this->meta[classname] );          $args = array( guid => $this->objectId, classname => $this->meta[classname] );
490          $result = $this->backend->send('getObjectByGuid', $args );          $result = $this->backend->send('getObjectByGuid', $args );
491    
# Line 484  class DesignPattern_RemoteProxy extends Line 494  class DesignPattern_RemoteProxy extends
494            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);
495            return;            return;
496          }          }
497            logp(get_class($this) . "->_loadRemote: getObject", PEAR_LOG_DEBUG);
498          $result = $this->backend->send('getObject', $this->objectId);          $result = $this->backend->send('getObject', $this->objectId);
499    
500        } elseif ($this->meta[key]) {        } elseif ($this->meta[key]) {
# Line 497  class DesignPattern_RemoteProxy extends Line 508  class DesignPattern_RemoteProxy extends
508            return;            return;
509          }          }
510          */          */
511            //logp(get_class($this) . "->_loadRemote: $this->meta[command](" . join(' ', $this->meta[query]) . ")", PEAR_LOG_DEBUG);
512            //print Dumper(array($this->meta[command], $this->meta[query]));
513          $result = $this->backend->send($this->meta[command], $this->meta[query]);          $result = $this->backend->send($this->meta[command], $this->meta[query]);
514                    
515        }        }
516    
517        //print "result: " . dumpVar($result) . "<br>";
518    
519        $status = $this->backend->getStatus();
520        //print Dumper($status);
521            
522      if ($result) {      $style = html_style("text/css", '.boxlabel_yellow { color: yellow; font-weight:bold; }');
523        //print "result: " . dumpVar($result) . "<br>";      $statusbox = html_div();
524        if (count($result) == 0) { return; }      $statusbox->set_style('background: red; border: 2px black groove; width:640px; padding:10px; margin:40px;');
525        $statusbox->add( html_span('boxlabel_yellow', "Connected:"), $status[connected], html_br() );
526        foreach ($status[errors] as $error) {
527          $statusbox->add( html_span('boxlabel_yellow', "Error($error[code]):"), $error[message], html_br() );
528        }
529        
530        if (is_array($result)) {
531          $good = 1;
532        } else {
533          $message = get_class($this) . "->_loadRemote: Error while trying to talk to remote side. Please check wire, socket or api.";
534          logp($message, PEAR_LOG_CRIT);
535          $statusbox->add( html_span('boxlabel_yellow', "Critical:"), $message, html_br() );
536        }
537    
538        if ($good && sizeof($result)) {
539                
540        // FIXME: this is dangerous!        // FIXME: this is dangerous!
541        if ($_GET[debug]) {        if ($_GET[debug]) {
# Line 518  class DesignPattern_RemoteProxy extends Line 548  class DesignPattern_RemoteProxy extends
548        $this->_saveProxy();        $this->_saveProxy();
549        //print "oid: $this->objectId<br>";        //print "oid: $this->objectId<br>";
550        $this->flushState();        $this->flushState();
551        
552      } else {      } else {
553        //print "Error in _loadRemote!!!<br>";        if (constants::get('VERBOSE') || constants::get('ERRORS_ONLY')) {
554        logp(get_class($this) . "->_loadRemote: error while trying to talk to remote side", PEAR_LOG_CRIT);          print $style->render();
555            print $statusbox->render();
556          } else {
557            foreach ($status[errors] as $error) {
558              print Dumper($error);
559            }
560          }
561        
562      }      }
563            
564    }    }

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

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