summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-05-25 15:46:20 +0200
committerAleksander Machniak <alec@alec.pl>2013-05-25 15:46:20 +0200
commit00cb22cf92d267fe602ad37336fba4454c6aa896 (patch)
tree3e7fcfddc9f843d2d25b0d126f3f3f325c5d7e6d /program/lib/Roundcube
parent50abd557184326f173357b50e7593dc3f452be91 (diff)
Expunge all cache instances in shutdown
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r--program/lib/Roundcube/rcube.php3
-rw-r--r--program/lib/Roundcube/rcube_cache.php2
-rw-r--r--program/lib/Roundcube/rcube_cache_shared.php2
-rw-r--r--program/lib/Roundcube/rcube_imap.php3
4 files changed, 8 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php
index a57cad57e..78d7959b7 100644
--- a/program/lib/Roundcube/rcube.php
+++ b/program/lib/Roundcube/rcube.php
@@ -897,6 +897,9 @@ class rcube
foreach ($this->caches as $cache) {
if (is_object($cache)) {
+ if ($this->expunge_cache) {
+ $cache->expunge();
+ }
$cache->close();
}
}
diff --git a/program/lib/Roundcube/rcube_cache.php b/program/lib/Roundcube/rcube_cache.php
index 92f12a8bf..129f3242d 100644
--- a/program/lib/Roundcube/rcube_cache.php
+++ b/program/lib/Roundcube/rcube_cache.php
@@ -192,7 +192,7 @@ class rcube_cache
*/
function expunge()
{
- if ($this->type == 'db' && $this->db) {
+ if ($this->type == 'db' && $this->db && $this->ttl) {
$this->db->query(
"DELETE FROM ".$this->db->table_name('cache').
" WHERE user_id = ?".
diff --git a/program/lib/Roundcube/rcube_cache_shared.php b/program/lib/Roundcube/rcube_cache_shared.php
index bef9e85f2..c43d2cad1 100644
--- a/program/lib/Roundcube/rcube_cache_shared.php
+++ b/program/lib/Roundcube/rcube_cache_shared.php
@@ -191,7 +191,7 @@ class rcube_cache
*/
function expunge()
{
- if ($this->type == 'db' && $this->db) {
+ if ($this->type == 'db' && $this->db && $this->ttl) {
$this->db->query(
"DELETE FROM " . $this->table
. " WHERE cache_key LIKE ?"
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index 43c61fd81..31e7079fb 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -3749,9 +3749,12 @@ class rcube_imap extends rcube_storage
$this->mcache->expunge($ttl);
}
+/*
+ // this cache is expunged by rcube class
if ($this->cache) {
$this->cache->expunge();
}
+*/
}