Ejemplo n.º 1
0
 public function init()
 {
     parent::init();
     $cache = $this->getMemCache();
     if ($cache) {
         $this->enable = true;
         $this->type = "memcache";
     }
 }
Ejemplo n.º 2
0
 /**
  * @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;
 }