/** * reset to redis * * @param string $uid * @param array $set * @return boolean */ private function _resetCache($uid, $set) { $infoKey = $this->_infoPreKey . $uid; $memcacheConfig = TZ_Loader::config('memcache'); $host = $memcacheConfig['user']['host']; $port = $memcacheConfig['user']['port']; $cache = new HM_Memcached($host, $port); $old = $this->_getCacheByUid($uid); foreach ($set as $key => $value) { $old[$key] = $value; } $json = json_encode($old); return $cache->set($this->_infoPreKey . $uid, $json); }