- Fix fatal error from last commit (#1487884), rename rcube_gc() to gc()

release-0.6
alecpl 13 years ago
parent b7b7cf5614
commit 68f39efb04

@ -166,12 +166,12 @@ class rcube_session
if ($key == $this->key && $ts - $this->start < 0.5) { if ($key == $this->key && $ts - $this->start < 0.5) {
$oldvars = $this->vars; $oldvars = $this->vars;
} else { // else read data again from DB } else { // else read data again from DB
$oldvars = $this->read($key); $oldvars = $this->db_read($key);
} }
if ($oldvars !== false) { if ($oldvars !== false) {
$newvars = $this->_fixvars($vars, $oldvars); $newvars = $this->_fixvars($vars, $oldvars);
if ($newvars !== $oldvars) { if ($newvars !== $oldvars) {
$this->db->query( $this->db->query(
sprintf("UPDATE %s SET vars=?, changed=%s WHERE sess_id=?", sprintf("UPDATE %s SET vars=?, changed=%s WHERE sess_id=?",
@ -193,8 +193,8 @@ class rcube_session
$this->unsets = array(); $this->unsets = array();
return true; return true;
} }
private function _fixvars($vars, $oldvars) private function _fixvars($vars, $oldvars)
{ {
$ts = microtime(true); $ts = microtime(true);
@ -211,7 +211,7 @@ class rcube_session
else else
$newvars = $vars; $newvars = $vars;
} }
$this->unsets = array(); $this->unsets = array();
return $newvars; return $newvars;
} }
@ -246,7 +246,7 @@ class rcube_session
sprintf("DELETE FROM %s WHERE changed < %s", sprintf("DELETE FROM %s WHERE changed < %s",
get_table_name('session'), $this->db->fromunixtime(time() - $maxlifetime))); get_table_name('session'), $this->db->fromunixtime(time() - $maxlifetime)));
$this->rcube_gc(); $this->gc();
return true; return true;
} }
@ -315,7 +315,7 @@ class rcube_session
/** /**
* Execute registered garbage collector routines * Execute registered garbage collector routines
*/ */
public function rcube_gc() public function gc()
{ {
foreach ($this->gc_handlers as $fct) foreach ($this->gc_handlers as $fct)
$fct(); $fct();

Loading…
Cancel
Save