summaryrefslogtreecommitdiff
path: root/program/include/rcube_session.php
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-05-18 10:16:36 +0000
committerthomascube <thomas@roundcube.net>2011-05-18 10:16:36 +0000
commit76d4019a355019f2cc3465bd36e3475f80c3d745 (patch)
tree1154649c3eeaadf6041bd119edfdd006dfa1fffc /program/include/rcube_session.php
parent4e3ec4eca8b1bb1f4e3810125b920f696711d7a6 (diff)
Get memcache object from rcmail instance
Diffstat (limited to 'program/include/rcube_session.php')
-rw-r--r--program/include/rcube_session.php12
1 files changed, 2 insertions, 10 deletions
diff --git a/program/include/rcube_session.php b/program/include/rcube_session.php
index e4d9a87aa..a63501079 100644
--- a/program/include/rcube_session.php
+++ b/program/include/rcube_session.php
@@ -59,18 +59,10 @@ class rcube_session
// use memcache backend
if ($config->get('session_storage', 'db') == 'memcache') {
- $this->memcache = new Memcache;
- $mc_available = 0;
- foreach ($config->get('memcache_hosts', array()) as $host) {
- list($host, $port) = explode(':', $host);
- if (!$port) $port = 11211;
- // add server and attempt to connect if not already done yet
- if ($this->memcache->addServer($host, $port) && !$mc_available)
- $mc_available += intval($this->memcache->connect($host, $port));
- }
+ $this->memcache = rcmail::get_instance()->get_memcache();
// set custom functions for PHP session management if memcache is available
- if ($mc_available) {
+ if ($this->memcache) {
session_set_save_handler(
array($this, 'open'),
array($this, 'close'),