public function init() { parent::init(); $cache = $this->getMemCache(); if ($cache) { $this->enable = true; $this->type = "memcache"; } }
/** * @return Memcache|the */ public function getMemCache() { if ($this->_cache === null) { if (class_exists('Alibaba', false)) { $this->_cache = Alibaba::Cache('memcache'); } else { $memcache = new CMemCache(); $memcache->setServers($this->_servers); $memcache->init(); $this->_cache = $memcache; } } return $this->_cache; }