Aleksander Machniak
2013-05-25 00cb22cf92d267fe602ad37336fba4454c6aa896
Expunge all cache instances in shutdown
4 files modified
10 ■■■■ changed files
program/lib/Roundcube/rcube.php 3 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_cache.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_cache_shared.php 2 ●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_imap.php 3 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube.php
@@ -897,6 +897,9 @@
        foreach ($this->caches as $cache) {
            if (is_object($cache)) {
                if ($this->expunge_cache) {
                    $cache->expunge();
                }
                $cache->close();
            }
        }
program/lib/Roundcube/rcube_cache.php
@@ -192,7 +192,7 @@
     */
    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 = ?".
program/lib/Roundcube/rcube_cache_shared.php
@@ -191,7 +191,7 @@
     */
    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 ?"
program/lib/Roundcube/rcube_imap.php
@@ -3749,9 +3749,12 @@
            $this->mcache->expunge($ttl);
        }
/*
        // this cache is expunged by rcube class
        if ($this->cache) {
            $this->cache->expunge();
        }
*/
    }