lithium\storage\cache\adapter\Memcache::_init()
Overrides
lithium\core\Object::_init()
Handles the actual Memcached
connection and server connection
adding for the adapter constructor and sets prefix using the scope
if provided.
Returns
voidSource
protected function _init() {
$this->connection = $this->connection ?: new Memcached();
$servers = array();
if (isset($this->_config['servers'])) {
$this->connection->addServers($this->_config['servers']);
return;
}
$this->connection->addServers($this->_formatHostList($this->_config['host']));
if ($this->_config['scope']) {
$this->connection->setOption(Memcached::OPT_PREFIX_KEY, "{$this->_config['scope']}:");
}
}