diff options
author | Thomas Bruederli <bruederli@kolabsys.com> | 2015-03-09 17:16:39 +0100 |
---|---|---|
committer | Thomas Bruederli <bruederli@kolabsys.com> | 2015-03-09 17:17:04 +0100 |
commit | 87ff88d55003a7af755d290ae06173c4d73cc133 (patch) | |
tree | 740333d1cf2e85c3033b67b9710166982c30b087 /program/lib/Roundcube | |
parent | aafc050f550eec7557d9e66ee90cc8bd7b5536da (diff) |
Fix session garbage collector handler registration after refactoring
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r-- | program/lib/Roundcube/rcube.php | 1 | ||||
-rw-r--r-- | program/lib/Roundcube/rcube_session.php | 3 | ||||
-rw-r--r-- | program/lib/Roundcube/rcube_session_db.php | 1 |
3 files changed, 2 insertions, 3 deletions
diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php index 3d081539f..cf6ebf993 100644 --- a/program/lib/Roundcube/rcube.php +++ b/program/lib/Roundcube/rcube.php @@ -523,6 +523,7 @@ class rcube // get session driver instance $this->session = rcube_session::factory($this->config); + $this->session->register_gc_handler(array($this, 'gc')); // start PHP session (if not in CLI mode) if ($_SERVER['REMOTE_ADDR']) { diff --git a/program/lib/Roundcube/rcube_session.php b/program/lib/Roundcube/rcube_session.php index fc1d87150..ab5c24c1e 100644 --- a/program/lib/Roundcube/rcube_session.php +++ b/program/lib/Roundcube/rcube_session.php @@ -86,9 +86,6 @@ abstract class rcube_session { $this->config = $config; - // register default gc handler - $this->register_gc_handler(array($this, 'gc')); - // set secret $this->set_secret($this->config->get('des_key') . dirname($_SERVER['SCRIPT_NAME'])); diff --git a/program/lib/Roundcube/rcube_session_db.php b/program/lib/Roundcube/rcube_session_db.php index 78138d1eb..4d94f43ff 100644 --- a/program/lib/Roundcube/rcube_session_db.php +++ b/program/lib/Roundcube/rcube_session_db.php @@ -168,6 +168,7 @@ class rcube_session_db extends rcube_session // just clean all old sessions when this GC is called $this->db->query("DELETE FROM " . $this->db->table_name('session') . " WHERE changed < " . $this->db->now(-$this->gc_enabled)); + $this->log("Session GC (DB): remove records < " . date('Y-m-d H:i:s', time() - $this->gc_enabled) . '; rows = ' . intval($this->db->affected_rows())); } }
\ No newline at end of file |