mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Merge branch 'feature/arstechnica/memcache-multi-server' into develop-olympus
* feature/arstechnica/memcache-multi-server: [feature/memcache-multi-server] Changing format for multiple memcache hosts. Fixing code style issues in changes. [feature/memcache-multi-server] Adding support for multiple memcache servers to acm_memcache.php
This commit is contained in:
commit
da5c36fdeb
1 changed files with 12 additions and 2 deletions
|
@ -37,6 +37,12 @@ if (!defined('PHPBB_ACM_MEMCACHE_HOST'))
|
||||||
define('PHPBB_ACM_MEMCACHE_HOST', 'localhost');
|
define('PHPBB_ACM_MEMCACHE_HOST', 'localhost');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ACM for Memcached
|
* ACM for Memcached
|
||||||
* @package acm
|
* @package acm
|
||||||
|
@ -54,7 +60,11 @@ class acm extends acm_memory
|
||||||
parent::acm_memory();
|
parent::acm_memory();
|
||||||
|
|
||||||
$this->memcache = new Memcache;
|
$this->memcache = new Memcache;
|
||||||
$this->memcache->connect(PHPBB_ACM_MEMCACHE_HOST, PHPBB_ACM_MEMCACHE_PORT);
|
foreach(explode(',', PHPBB_ACM_MEMCACHE) as $u)
|
||||||
|
{
|
||||||
|
$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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,4 +135,4 @@ class acm extends acm_memory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Add table
Reference in a new issue