--- nfo/php/libs/org.netfrag.glib/DesignPattern/RemoteProxy.php 2004/05/13 19:17:55 1.18 +++ nfo/php/libs/org.netfrag.glib/DesignPattern/RemoteProxy.php 2004/06/07 16:56:45 1.19 @@ -15,9 +15,13 @@ * *
  * -------------------------------------------------------------------------
- *    $Id: RemoteProxy.php,v 1.18 2004/05/13 19:17:55 jonen Exp $
+ *    $Id: RemoteProxy.php,v 1.19 2004/06/07 16:56:45 joko Exp $
  * -------------------------------------------------------------------------
  *    $Log: RemoteProxy.php,v $
+ *    Revision 1.19  2004/06/07 16:56:45  joko
+ *    enabled caching-layers
+ *    minor fixes regarding caching
+ *
  *    Revision 1.18  2004/05/13 19:17:55  jonen
  *    + bugfix: utf8 conversion was missing at some backend-calls
  *
@@ -281,7 +285,7 @@
   var $backend;
 
   function DesignPattern_RemoteProxy($objectId = "", $options = array() ) {
-    php::log(get_class($this) . "->new()", PEAR_LOG_INFO);
+    php::log(get_class($this) . "->new(objectId=$objectId)", PEAR_LOG_INFO);
     global $proxy;
 
     // 2003-03-05 - modified constructor
@@ -421,6 +425,9 @@
   function _loadState() {
     global $proxy;
 
+    // just do session-caching if requested
+    if (!$this->meta[cache][session]) { return; }
+
     // trace
       //print Dumper($this);
 
@@ -431,12 +438,16 @@
       //print "_loadState:" . dumpVar($this->attributes);
       $this->meta[decoded] = 1;
       // TODO: make a parameter from this (0 deactivates session-layer)
-      return 0;
+      return 1;
     }
   }
 
   function _saveState() {
     global $proxy;
+    
+    // just do session-caching if requested
+    if (!$this->meta[cache][session]) { return; }
+    
     php::log(get_class($this) . "->_saveState()");
     $proxy[$this->objectId] = $this->attributes;
     //print "_saveState: " . dumpVar($this->attributes);
@@ -459,7 +470,7 @@
       if ($row) {
         $this->payload = $row[payload];
         // TODO: make a parameter from this (0 deactivates mysqldb-layer)
-        return 0;
+        return 1;
       }
     }
   }