Changeset 38bf4253 in github
- Timestamp:
- Sep 24, 2009 8:08:23 AM (4 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- c2e697f
- Parents:
- 9e2a7af
- Files:
-
- 2 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r93a88c9 r38bf4253 2 2 =========================== 3 3 4 - Fix cache status checking + improve cache operations performance (#1486104) 4 5 - Prevent from setting INBOX as any of special folders (#1486114) 5 6 - Fix regular expression for e-mail address (#1486152) -
program/include/rcube_imap.php
r1cead0c r38bf4253 486 486 private function _messagecount($mailbox='', $mode='ALL', $force=FALSE) 487 487 { 488 $a_mailbox_cache = FALSE;489 488 $mode = strtoupper($mode); 490 489 … … 2141 2140 function get_cache($key) 2142 2141 { 2143 // read cache 2144 if (! isset($this->cache[$key]) && $this->caching_enabled)2142 // read cache (if it was not read before) 2143 if (!count($this->cache) && $this->caching_enabled) 2145 2144 { 2146 2145 return $this->_read_cache_record($key); … … 2219 2218 $sql_key = preg_replace('/^IMAP\./', '', $sql_arr['cache_key']); 2220 2219 $this->cache_keys[$sql_key] = $sql_arr['cache_id']; 2221 $this->cache[$sql_key] = $sql_arr['data'] ? unserialize($sql_arr['data']) : FALSE; 2220 if (!isset($this->cache[$sql_key])) 2221 $this->cache[$sql_key] = $sql_arr['data'] ? unserialize($sql_arr['data']) : FALSE; 2222 2222 } 2223 2223 } … … 2234 2234 return FALSE; 2235 2235 2236 // check if we already have a cache entry for this key 2237 if (!isset($this->cache_keys[$key])) 2238 { 2236 // update existing cache record 2237 if ($this->cache_keys[$key]) 2238 { 2239 $this->db->query( 2240 "UPDATE ".get_table_name('cache')." 2241 SET created=". $this->db->now().", data=? 2242 WHERE user_id=? 2243 AND cache_key=?", 2244 $data, 2245 $_SESSION['user_id'], 2246 'IMAP.'.$key); 2247 } 2248 // add new cache record 2249 else 2250 { 2251 $this->db->query( 2252 "INSERT INTO ".get_table_name('cache')." 2253 (created, user_id, cache_key, data) 2254 VALUES (".$this->db->now().", ?, ?, ?)", 2255 $_SESSION['user_id'], 2256 'IMAP.'.$key, 2257 $data); 2258 2259 // get cache entry ID for this key 2239 2260 $sql_result = $this->db->query( 2240 2261 "SELECT cache_id … … 2245 2266 'IMAP.'.$key); 2246 2267 2247 if ($sql_arr = $this->db->fetch_assoc($sql_result)) 2248 $this->cache_keys[$key] = $sql_arr['cache_id']; 2249 else 2250 $this->cache_keys[$key] = FALSE; 2251 } 2252 2253 // update existing cache record 2254 if ($this->cache_keys[$key]) 2255 { 2256 $this->db->query( 2257 "UPDATE ".get_table_name('cache')." 2258 SET created=". $this->db->now().", data=? 2259 WHERE user_id=? 2260 AND cache_key=?", 2261 $data, 2262 $_SESSION['user_id'], 2263 'IMAP.'.$key); 2264 } 2265 // add new cache record 2266 else 2267 { 2268 $this->db->query( 2269 "INSERT INTO ".get_table_name('cache')." 2270 (created, user_id, cache_key, data) 2271 VALUES (".$this->db->now().", ?, ?, ?)", 2272 $_SESSION['user_id'], 2273 'IMAP.'.$key, 2274 $data); 2268 if ($sql_arr = $this->db->fetch_assoc($sql_result)) 2269 $this->cache_keys[$key] = $sql_arr['cache_id']; 2275 2270 } 2276 2271 } … … 2287 2282 $_SESSION['user_id'], 2288 2283 'IMAP.'.$key); 2284 2285 unset($this->cache_keys[$key]); 2289 2286 } 2290 2287
Note: See TracChangeset
for help on using the changeset viewer.
