Changeset 2675 in subversion
- Timestamp:
- Jun 24, 2009 5:44:05 AM (4 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (14 diffs)
-
program/include/rcube_mdb2.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r2671 r2675 2 2 =========================== 3 3 4 - Fix non-unicode characters caching in unicode database (#1484608) 5 - Performance improvements of messages caching 4 6 - Fix empty Date header issue (#1485923) 5 7 - Open collapsed folders during drag & drop (#1485914) -
trunk/roundcubemail/program/include/rcube_imap.php
r2674 r2675 119 119 $this->ssl = $use_ssl; 120 120 121 // print trace mes ages121 // print trace messages 122 122 if ($this->conn && ($this->debug_level & 8)) 123 123 console($this->conn->message); … … 773 773 function _fetch_headers($mailbox, $msgs, &$a_msg_headers, $cache_key) 774 774 { 775 // cache is incomplete776 $cache_index = $this->get_message_cache_index($cache_key);777 778 775 // fetch reqested headers from server 779 776 $a_header_index = iil_C_FetchHeaders($this->conn, $mailbox, $msgs, false, $this->fetch_add_headers); 780 777 781 778 if (!empty($a_header_index)) 782 779 { 780 // cache is incomplete 781 $cache_index = $this->get_message_cache_index($cache_key); 782 783 783 foreach ($a_header_index as $i => $headers) 784 784 { … … 800 800 } 801 801 } 802 802 803 803 return count($a_msg_headers); 804 804 } … … 2263 2263 WHERE user_id=? 2264 2264 AND cache_key=? 2265 ORDER BY ".$this->db->quoteIdentifier($sort_field)." ". 2266 strtoupper($sort_order), 2265 ORDER BY ".$this->db->quoteIdentifier($sort_field)." ".strtoupper($sort_order), 2267 2266 $from, 2268 2267 $to-$from, … … 2273 2272 { 2274 2273 $uid = $sql_arr['uid']; 2275 $this->cache[$cache_key][$uid] = unserialize($sql_arr['headers']);2276 2274 $this->cache[$cache_key][$uid] = $this->db->decode(unserialize($sql_arr['headers'])); 2275 2277 2276 // featch headers if unserialize failed 2278 2277 if (empty($this->cache[$cache_key][$uid])) … … 2280 2279 } 2281 2280 } 2282 2281 2283 2282 return $this->cache[$cache_key]; 2284 2283 } … … 2306 2305 if ($sql_arr = $this->db->fetch_assoc($sql_result)) 2307 2306 { 2308 $this->cache[$internal_key][$uid] = unserialize($sql_arr['headers']);2307 $this->cache[$internal_key][$uid] = $this->db->decode(unserialize($sql_arr['headers'])); 2309 2308 if (is_object($this->cache[$internal_key][$uid]) && !empty($sql_arr['structure'])) 2310 $this->cache[$internal_key][$uid]->structure = unserialize($sql_arr['structure']);2309 $this->cache[$internal_key][$uid]->structure = $this->db->decode(unserialize($sql_arr['structure'])); 2311 2310 } 2312 2311 } … … 2348 2347 * @access private 2349 2348 */ 2350 function add_message_cache($key, $index, $headers, $struct=null)2349 private function add_message_cache($key, $index, $headers, $struct=null) 2351 2350 { 2352 2351 if (empty($key) || !is_object($headers) || empty($headers->uid)) … … 2356 2355 $this->cache['__single_msg'][$headers->uid] = $headers; 2357 2356 $this->cache['__single_msg'][$headers->uid]->structure = $struct; 2358 2357 2359 2358 // no further caching 2360 2359 if (!$this->caching_enabled) … … 2381 2380 WHERE message_id=?", 2382 2381 $index, 2383 serialize($ headers),2384 is_object($struct) ? serialize($ struct) : NULL,2382 serialize($this->db->encode(clone $headers)), 2383 is_object($struct) ? serialize($this->db->encode(clone $struct)) : NULL, 2385 2384 $sql_arr['message_id'] 2386 2385 ); … … 2396 2395 $index, 2397 2396 $headers->uid, 2398 (string)substr($this->decode_header($headers->subject, TRUE), 0, 128), 2399 (string)substr($this->decode_header($headers->from, TRUE), 0, 128), 2400 (string)substr($this->decode_header($headers->to, TRUE), 0, 128), 2401 (string)substr($this->decode_header($headers->cc, TRUE), 0, 128), 2397 2398 (string)rc_substr($this->db->encode($this->decode_header($headers->subject, TRUE)), 0, 128), 2399 (string)rc_substr($this->db->encode($this->decode_header($headers->from, TRUE)), 0, 128), 2400 (string)rc_substr($this->db->encode($this->decode_header($headers->to, TRUE)), 0, 128), 2401 (string)rc_substr($this->db->encode($this->decode_header($headers->cc, TRUE)), 0, 128), 2402 2402 (int)$headers->size, 2403 serialize($ headers),2404 is_object($struct) ? serialize($ struct) : NULL2403 serialize($this->db->encode(clone $headers)), 2404 is_object($struct) ? serialize($this->db->encode(clone $struct)) : NULL 2405 2405 ); 2406 2406 } … … 2410 2410 * @access private 2411 2411 */ 2412 function remove_message_cache($key, $uids)2412 private function remove_message_cache($key, $uids) 2413 2413 { 2414 2414 if (!$this->caching_enabled) … … 2427 2427 * @access private 2428 2428 */ 2429 function clear_message_cache($key, $start_index=1)2429 private function clear_message_cache($key, $start_index=1) 2430 2430 { 2431 2431 if (!$this->caching_enabled) … … 2445 2445 * @access private 2446 2446 */ 2447 function get_message_cache_index_min($key, $uids=NULL)2447 private function get_message_cache_index_min($key, $uids=NULL) 2448 2448 { 2449 2449 if (!$this->caching_enabled) -
trunk/roundcubemail/program/include/rcube_mdb2.php
r2673 r2675 558 558 559 559 /** 560 * Encodes non-UTF-8 characters in string/array/object (recursive) 561 * 562 * @param mixed Data to fix 563 * @return mixed Properly UTF-8 encoded data 564 * @access public 565 */ 566 function encode($input) 567 { 568 if (is_object($input)) { 569 foreach (get_object_vars($input) as $idx => $value) 570 $input->$idx = $this->encode($value); 571 return $input; 572 } 573 else if (is_array($input)) { 574 foreach ($input as $idx => $value) 575 $input[$idx] = $this->encode($value); 576 return $input; 577 } 578 579 return utf8_encode($input); 580 } 581 582 583 /** 584 * Decodes encoded UTF-8 string/object/array (recursive) 585 * 586 * @param mixed Input data 587 * @return mixed Decoded data 588 * @access public 589 */ 590 function decode($input) 591 { 592 if (is_object($input)) { 593 foreach (get_object_vars($input) as $idx => $value) 594 $input->$idx = $this->decode($value); 595 return $input; 596 } 597 else if (is_array($input)) { 598 foreach ($input as $idx => $value) 599 $input[$idx] = $this->decode($value); 600 return $input; 601 } 602 603 return utf8_decode($input); 604 } 605 606 607 /** 560 608 * Adds a query result and returns a handle ID 561 609 *
Note: See TracChangeset
for help on using the changeset viewer.
