| | |
| | | { |
| | | if ($this->caching && !$this->cache) { |
| | | $rcube = rcube::get_instance(); |
| | | $ttl = $rcube->config->get('message_cache_lifetime', '10d'); |
| | | $ttl = $rcube->config->get('imap_cache_ttl', '10d'); |
| | | $this->cache = $rcube->get_cache('IMAP', $this->caching, $ttl); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Delete outdated cache entries |
| | | */ |
| | | public function expunge_cache() |
| | | { |
| | | if ($this->mcache) { |
| | | $ttl = rcube::get_instance()->config->get('message_cache_lifetime', '10d'); |
| | | $this->mcache->expunge($ttl); |
| | | } |
| | | |
| | | if ($this->cache) { |
| | | $this->cache->expunge(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /* -------------------------------- |
| | | * message caching methods |
| | |
| | | if ($this->messages_caching && !$this->mcache) { |
| | | $rcube = rcube::get_instance(); |
| | | if (($dbh = $rcube->get_dbh()) && ($userid = $rcube->get_user_id())) { |
| | | $ttl = $rcube->config->get('messages_cache_ttl', '10d'); |
| | | $this->mcache = new rcube_imap_cache( |
| | | $dbh, $this, $userid, $this->options['skip_deleted']); |
| | | $dbh, $this, $userid, $this->options['skip_deleted'], $ttl); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Delete outdated cache entries |
| | | */ |
| | | function cache_gc() |
| | | { |
| | | rcube_imap_cache::gc(); |
| | | } |
| | | |
| | | |
| | | /* -------------------------------- |
| | | * protected methods |
| | | * --------------------------------*/ |