Fix message cache expunge after config options changed
| | |
| | | // get target timestamp |
| | | $ts = get_offset_time($rcmail->config->get('message_cache_lifetime', '30d'), -1); |
| | | |
| | | if ($rcmail->config->get('messages_cache') || $this->config->get('enable_caching')) { |
| | | $db->query("DELETE FROM ".get_table_name('cache_messages') |
| | | ." WHERE changed < " . $db->fromunixtime($ts)); |
| | | |
| | |
| | | |
| | | $db->query("DELETE FROM ".get_table_name('cache_thread') |
| | | ." WHERE changed < " . $db->fromunixtime($ts)); |
| | | } |
| | | |
| | | $db->query("DELETE FROM ".get_table_name('cache') |
| | | ." WHERE created < " . $db->fromunixtime($ts)); |
| | |
| | | $this->session = new rcube_session($this->get_dbh(), $this->config); |
| | | |
| | | $this->session->register_gc_handler('rcmail_temp_gc'); |
| | | if ($this->config->get('enable_caching')) |
| | | $this->session->register_gc_handler('rcmail_cache_gc'); |
| | | |
| | | // start PHP session (if not in CLI mode) |