mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[feature/memcache-multi-server] Changing format for multiple memcache hosts. Fixing code style issues in changes.
Host and ports are now represented like this in config: host1/port1,host2/port2,host3/port3
This commit is contained in:
parent
559313eda6
commit
c57c1f3fc6
1 changed files with 8 additions and 6 deletions
|
@ -37,9 +37,10 @@ if (!defined('PHPBB_ACM_MEMCACHE_HOST'))
|
||||||
define('PHPBB_ACM_MEMCACHE_HOST', 'localhost');
|
define('PHPBB_ACM_MEMCACHE_HOST', 'localhost');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('PHPBB_ACM_MEMCACHE')){
|
if (!defined('PHPBB_ACM_MEMCACHE'))
|
||||||
//can define multiple servers with host1::port1,host2::port2 format
|
{
|
||||||
define('PHPBB_ACM_MEMCACHE', PHPBB_ACM_MEMCACHE_HOST . '::' . PHPBB_ACM_MEMCACHE_PORT);
|
//can define multiple servers with host1/port1,host2/port2 format
|
||||||
|
define('PHPBB_ACM_MEMCACHE', PHPBB_ACM_MEMCACHE_HOST . '/' . PHPBB_ACM_MEMCACHE_PORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,9 +60,10 @@ class acm extends acm_memory
|
||||||
parent::acm_memory();
|
parent::acm_memory();
|
||||||
|
|
||||||
$this->memcache = new Memcache;
|
$this->memcache = new Memcache;
|
||||||
foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u){
|
foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u)
|
||||||
$parts = explode('::', $u);
|
{
|
||||||
$this->memcache->addServer($parts[0], $parts[1]);
|
$parts = explode('/', $u);
|
||||||
|
$this->memcache->addServer(trim($parts[0]), trim($parts[1]));
|
||||||
}
|
}
|
||||||
$this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0;
|
$this->flags = (PHPBB_ACM_MEMCACHE_COMPRESS) ? MEMCACHE_COMPRESSED : 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue