Changeset 5405 in subversion
- Timestamp:
- Nov 9, 2011 9:15:26 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.7/program/include/rcube_session.php
r5404 r5405 57 57 $this->ip = $_SERVER['REMOTE_ADDR']; 58 58 $this->logging = $config->get('log_session', false); 59 $this->mc_debug = $config->get('memcache_debug', false); 59 60 60 61 $lifetime = $config->get('session_lifetime', 1) * 60; … … 260 261 public function mc_read($key) 261 262 { 262 if ($value = $this->memcache->get($key)) { 263 $arr = unserialize($value); 263 $value = $this->memcache->get($key); 264 if ($this->mc_debug) write_log('memcache', "get($key): " . strlen($value)); 265 if ($value && ($arr = unserialize($value))) { 264 266 $this->changed = $arr['changed']; 265 267 $this->ip = $arr['ip']; … … 297 299 $newvars = $oldvars !== false ? $this->_fixvars($vars, $oldvars) : $vars; 298 300 299 if ($newvars !== $oldvars || $ts - $this->changed > $this->lifetime / 2) 300 return $this->memcache->set($key, serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $newvars)), MEMCACHE_COMPRESSED, $this->lifetime); 301 if ($newvars !== $oldvars || $ts - $this->changed > $this->lifetime / 2) { 302 $value = serialize(array('changed' => time(), 'ip' => $this->ip, 'vars' => $newvars)); 303 $ret = $this->memcache->set($key, $value, MEMCACHE_COMPRESSED, $this->lifetime); 304 if ($this->mc_debug) { 305 write_log('memcache', "set($key): " . strlen($value) . ": " . ($ret ? 'OK' : 'ERR')); 306 write_log('memcache', "... get($key): " . strlen($this->memcache->get($key))); 307 } 308 return $ret; 309 } 301 310 302 311 return true; … … 311 320 public function mc_destroy($key) 312 321 { 313 return $this->memcache->delete($key); 322 $ret = $this->memcache->delete($key); 323 if ($this->mc_debug) write_log('memcache', "delete($key): " . ($ret ? 'OK' : 'ERR')); 324 return $ret; 314 325 } 315 326
Note: See TracChangeset
for help on using the changeset viewer.
