diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-05-18 10:16:36 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-05-18 10:16:36 +0000 |
| commit | ec59e7a50db0b30d182ad83dc64890da2e00b376 (patch) | |
| tree | 4e069fa2d07e1d4f44e348ea4e1d68e64d0c3131 /roundcubemail/program/include/rcube_session.php | |
| parent | f0be131150d901d4c07aa7a103eeddb7b109fb8c (diff) | |
Get memcache object from rcmail instance
git-svn-id: https://svn.roundcube.net/trunk@4782 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_session.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_session.php | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/roundcubemail/program/include/rcube_session.php b/roundcubemail/program/include/rcube_session.php index e4d9a87aa..a63501079 100644 --- a/roundcubemail/program/include/rcube_session.php +++ b/roundcubemail/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'), |
