mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-27 19:19:21 +03:00
Better Memcache
This commit is contained in:
parent
8f1d96e86f
commit
8a50586d9b
2 changed files with 3 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue