mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +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->iExpire = 0 < $iExpire ? $iExpire : 43200;
|
||||||
|
|
||||||
$this->oMem = \class_exists('Memcache',false) ? new \Memcache : new \Memcached;
|
$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;
|
$this->oMem = null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -695,10 +695,9 @@ class Actions
|
||||||
|
|
||||||
case ('MEMCACHE' === $sDriver || 'MEMCACHED' === $sDriver) &&
|
case ('MEMCACHE' === $sDriver || 'MEMCACHED' === $sDriver) &&
|
||||||
(\class_exists('Memcache',false) || \class_exists('Memcached',false)):
|
(\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(
|
$oDriver = new \MailSo\Cache\Drivers\Memcache(
|
||||||
$sHost,
|
$this->Config()->Get('labs', 'fast_cache_memcache_host', '127.0.0.1'),
|
||||||
strpos($sHost, ':/') ? 0 : (int)$this->Config()->Get('labs', 'fast_cache_memcache_port', 11211),
|
(int) $this->Config()->Get('labs', 'fast_cache_memcache_port', 11211),
|
||||||
43200,
|
43200,
|
||||||
$sKey
|
$sKey
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue