From 8a50586d9bd9667831433ac860246ba08f26ff42 Mon Sep 17 00:00:00 2001 From: djmaze Date: Mon, 23 Aug 2021 11:52:24 +0200 Subject: [PATCH] Better Memcache --- .../v/0.0.0/app/libraries/MailSo/Cache/Drivers/Memcache.php | 2 +- snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Memcache.php b/snappymail/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Memcache.php index 358f9b933..746789c83 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Memcache.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Cache/Drivers/Memcache.php @@ -38,7 +38,7 @@ class Memcache implements \MailSo\Cache\DriverInterface $this->iExpire = 0 < $iExpire ? $iExpire : 43200; $this->oMem = \class_exists('Memcache',false) ? new \Memcache : new \Memcached; - if (!$this->oMem->addServer($sHost, $this->iPort)) + if (!$this->oMem->addServer($sHost, \strpos($sHost, ':/') ? 0 : $this->iPort)) { $this->oMem = null; } diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index 15457c2b4..66d7781b4 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -695,10 +695,9 @@ class Actions case ('MEMCACHE' === $sDriver || 'MEMCACHED' === $sDriver) && (\class_exists('Memcache',false) || \class_exists('Memcached',false)): - $sHost = $this->Config()->Get('labs', 'fast_cache_memcache_host', '127.0.0.1'); $oDriver = new \MailSo\Cache\Drivers\Memcache( - $sHost, - strpos($sHost, ':/') ? 0 : (int)$this->Config()->Get('labs', 'fast_cache_memcache_port', 11211), + $this->Config()->Get('labs', 'fast_cache_memcache_host', '127.0.0.1'), + (int) $this->Config()->Get('labs', 'fast_cache_memcache_port', 11211), 43200, $sKey );