Changeset fa2173c in github


Ignore:
Timestamp:
Oct 26, 2010 8:17:55 AM (3 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
10a6fc58
Parents:
4757608
Message:
  • Fix: Use internal instead of DB cache in message_index() and thread_index()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_imap.php

    ra5a4bf4 rfa2173c  
    12601260 
    12611261        // we have a saved search result, get index from there 
    1262         if (!isset($this->cache[$key]) && $this->search_string 
     1262        if (!isset($this->icache[$key]) && $this->search_string 
    12631263            && !$this->search_threads && $mailbox == $this->mailbox) { 
    12641264            // use message index sort as default sorting 
     
    12701270 
    12711271                if ($this->sort_order == 'DESC') 
    1272                     $this->cache[$key] = array_reverse($msgs); 
     1272                    $this->icache[$key] = array_reverse($msgs); 
    12731273                else 
    1274                     $this->cache[$key] = $msgs; 
     1274                    $this->icache[$key] = $msgs; 
    12751275            } 
    12761276            // sort with SORT command 
     
    12801280 
    12811281                if ($this->sort_order == 'DESC') 
    1282                     $this->cache[$key] = array_reverse($this->search_set); 
     1282                    $this->icache[$key] = array_reverse($this->search_set); 
    12831283                else 
    1284                     $this->cache[$key] = $this->search_set; 
     1284                    $this->icache[$key] = $this->search_set; 
    12851285            } 
    12861286            else { 
     
    12941294                        arsort($a_index); 
    12951295 
    1296                     $this->cache[$key] = array_keys($a_index); 
     1296                    $this->icache[$key] = array_keys($a_index); 
    12971297                } 
    12981298                else { 
    1299                     $this->cache[$key] = array(); 
     1299                    $this->icache[$key] = array(); 
    13001300                } 
    13011301            } 
     
    13031303 
    13041304        // have stored it in RAM 
    1305         if (isset($this->cache[$key])) 
    1306             return $this->cache[$key]; 
     1305        if (isset($this->icache[$key])) 
     1306            return $this->icache[$key]; 
    13071307 
    13081308        // check local cache 
     
    13281328                $a_index = array_reverse($a_index); 
    13291329 
    1330             $this->cache[$key] = $a_index; 
     1330            $this->icache[$key] = $a_index; 
    13311331        } 
    13321332        // fetch complete message index 
     
    13381338                $a_index = array_reverse($a_index); 
    13391339 
    1340             $this->cache[$key] = $a_index; 
     1340            $this->icache[$key] = $a_index; 
    13411341        } 
    13421342        else if ($a_index = $this->conn->fetchHeaderIndex( 
     
    13471347                arsort($a_index); 
    13481348 
    1349             $this->cache[$key] = array_keys($a_index); 
    1350         } 
    1351  
    1352         return $this->cache[$key] !== false ? $this->cache[$key] : array(); 
     1349            $this->icache[$key] = array_keys($a_index); 
     1350        } 
     1351 
     1352        return $this->icache[$key] !== false ? $this->icache[$key] : array(); 
    13531353    } 
    13541354 
     
    13701370 
    13711371        // we have a saved search result, get index from there 
    1372         if (!isset($this->cache[$key]) && $this->search_string 
     1372        if (!isset($this->icache[$key]) && $this->search_string 
    13731373            && $this->search_threads && $mailbox == $this->mailbox) { 
    13741374            // use message IDs for better performance 
    13751375            $ids = array_keys_recursive($this->search_set['tree']); 
    1376             $this->cache[$key] = $this->_flatten_threads($mailbox, $this->search_set['tree'], $ids); 
     1376            $this->icache[$key] = $this->_flatten_threads($mailbox, $this->search_set['tree'], $ids); 
    13771377        } 
    13781378 
    13791379        // have stored it in RAM 
    1380         if (isset($this->cache[$key])) 
    1381             return $this->cache[$key]; 
     1380        if (isset($this->icache[$key])) 
     1381            return $this->icache[$key]; 
    13821382/* 
    13831383        // check local cache 
     
    13941394        list ($thread_tree) = $this->_fetch_threads($mailbox); 
    13951395 
    1396         $this->cache[$key] = $this->_flatten_threads($mailbox, $thread_tree); 
    1397  
    1398         return $this->cache[$key]; 
     1396        $this->icache[$key] = $this->_flatten_threads($mailbox, $thread_tree); 
     1397 
     1398        return $this->icache[$key]; 
    13991399    } 
    14001400 
Note: See TracChangeset for help on using the changeset viewer.