Changeset 4784 in subversion


Ignore:
Timestamp:
May 18, 2011 8:10:27 AM (2 years ago)
Author:
alec
Message:
  • Make memcached cache not system-wide
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_cache.php

    r4783 r4784  
    209209 
    210210        if ($this->type == 'memcache') { 
    211             $data = $this->db->get($key); 
     211            $data = $this->db->get($this->mc_key($key)); 
    212212                 
    213213            if ($data) { 
     
    264264 
    265265        if ($this->type == 'memcache') { 
     266            $key = $this->mc_key($key); 
    266267            $result = $this->db->replace($key, $data, MEMCACHE_COMPRESSED); 
    267268            if (!$result) 
     
    314315 
    315316        if ($this->type == 'memcache') { 
    316             return $this->db->delete($key); 
     317            return $this->db->delete($this->mc_key($key)); 
    317318        } 
    318319 
     
    326327    } 
    327328 
     329 
     330    /** 
     331     * Creates per-user Memcache key 
     332     * 
     333     * @param string $key Cache key 
     334     * @access private 
     335     */ 
     336    private function mc_key($key) 
     337    { 
     338        return sprintf('[%d]%s', $this->userid, $key); 
     339    } 
    328340} 
Note: See TracChangeset for help on using the changeset viewer.