示例#1
0
 /**
  * clean cache
  *
  * @param string $telephone
  * @return boolean
  */
 private function _cleanCache($telephone)
 {
     $memcacheConfig = TZ_Loader::config('memcache');
     $host = $memcacheConfig['user']['host'];
     $port = $memcacheConfig['user']['port'];
     $cache = new HM_Memcached($host, $port);
     $uid = $cache->get($this->_telephonePreKey . $telephone);
     if ($uid) {
         $infoKey = $this->_infoPreKey . $uid;
         $cache->delete($infoKey);
     }
     return $cache->delete($this->_telephonePreKey . $telephone);
 }
示例#2
0
 /**
  * clean cache
  *
  * @param string $telephone
  * @return boolean
  */
 private function _cleanCache($telephone)
 {
     /*		$redis = TZ_Redis::connect('user');
     		 $telephoneKey = $this->_telephonePreKey.$telephone;
     		 $uid = $redis->get($telephoneKey);
     		 if ($uid) {
     			$infoKey = $this->_infoPreKey.$uid;
     			$keys = $redis->hKeys($infoKey);
     			foreach ($keys as $key) {
     			$redis->hDel($this->_infoPreKey.$uid, $key);
     			}
     			}
     			return $redis->delete($telephoneKey);*/
     $memcacheConfig = TZ_Loader::config('memcache');
     $host = $memcacheConfig['user']['host'];
     $port = $memcacheConfig['user']['port'];
     $cache = new HM_Memcached($host, $port);
     $uid = $cache->get($this->_telephonePreKey . $telephone);
     if ($uid) {
         $infoKey = $this->_infoPreKey . $uid;
         $cache->delete($infoKey);
     }
     return $cache->delete($this->_telephonePreKey . $telephone);
 }