phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.43


From: nomail
Subject: [Phpgroupware-cvs] sync/inc/class.bo_sync.inc.php, 1.43
Date: Thu, 10 Jun 2004 00:34:01 +0200

Update of /sync/inc
Modified Files:
        Branch: 
          class.bo_sync.inc.php

date: 2004/06/09 22:34:01;  author: mkaemmerer;  state: Exp;  lines: +20 -1

Log Message:
- added IdListCache
=====================================================================
Index: sync/inc/class.bo_sync.inc.php
diff -u sync/inc/class.bo_sync.inc.php:1.42 sync/inc/class.bo_sync.inc.php:1.43
--- sync/inc/class.bo_sync.inc.php:1.42 Wed Jun  9 18:35:09 2004
+++ sync/inc/class.bo_sync.inc.php      Wed Jun  9 22:34:01 2004
@@ -402,12 +402,22 @@
         error_log("Sync Module: Error: There is no source called '$source'. 
Can not synchronize");
         return -1;
       }
+
+      $session_data = 
$GLOBALS['phpgw']->session->appsession('session_data','sync');
+      $idlistname = "idlistcache_" . $deviceid . "_" . $source;
+        
+      if ((is_array($session_data[$idlistname])) and ($type == 1))
+      {
+        error_log("GetIDList: use cached IdList: 
".serialize($session_data[$idlistname]));
+        return $session_data[$idlistname];         
+      }
            
       $idlist = $this->ipc->getIdList($lastmod, 'syncable');
       $retList = array();
       
       foreach($idlist as $id)
       {
+        // this may be optimized later to use only one SQL
         $LUID = $this->so->getLUID($channelid, $id);
         
         // for new Ids we have to generate temporary LUIDs till we get
@@ -423,6 +433,15 @@
         if (($type == 1) or (($LUID[0] == '_') xor ($type != 2))) 
           $retList[] = $LUID;
       }
+      
+      if ($type == 1) 
+      {
+        $session_data = 
$GLOBALS['phpgw']->session->appsession('session_data','sync');
+        $session_data[$idlistname] = $retList;
+        error_log("GetIdList: set cache to session");
+        $GLOBALS['phpgw']->session->appsession('session_data','sync', 
$session_data);
+      }
+         
       if ($this->debug)
         error_log("getIDList return value: ".serialize($retList));
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]