Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/unacms/una
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Sep 17, 2024
2 parents bf79a10 + d316bf6 commit d53c663
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions inc/classes/BxDolCacheMemcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@ function __construct()
parent::__construct();
if (class_exists('Memcache')) {
$this->oMemcache = new Memcache();
if (!$this->oMemcache->connect (getParam('sys_cache_memcache_host'), getParam('sys_cache_memcache_port')))
$this->oMemcache = null;
$sHost = getParam('sys_cache_memcache_host');
if (false === strpos($sHost, ',')) {
if (!$this->oMemcache->connect (getParam('sys_cache_memcache_host'), getParam('sys_cache_memcache_port')))
$this->oMemcache = null;
}
else {
// setting memcache.hash_strategy = consistent is recommended
$aHosts = explode(',', $sHost);
if ($aHosts) {
foreach ($aHosts as $s)
$this->oMemcache->addServer(trim($s), getParam('sys_cache_memcache_port'));
}
else {
$this->oMemcache = null;
}
}
}
}

Expand Down

0 comments on commit d53c663

Please sign in to comment.