public function __construct($namespace = 'default', \Stash\Pool $pool = null, $ttl = null)
{
parent::__construct();
$this->setNamespace($namespace);
if (!$pool) {
$pool = _elgg_services()->memcacheStashPool;
if (!$pool) {
throw new \ConfigurationException('No memcache servers defined, please populate the $this->CONFIG->memcache_servers variable');
}
}
$this->stash_pool = $pool;
if ($ttl === null) {
$ttl = _elgg_services()->config->get('memcache_expires');
}
if (isset($ttl)) {
$this->ttl = $ttl;
}
// make sure memcache is reset
_elgg_services()->events->registerHandler('cache:flush', 'system', array($this, 'clear'));
}