mem = new Memcached(); // $this->mem->addServer($host, $port); // $this->keyDic = new \stdClass(); // } // // public function get($key) // { // $cas_token = ""; // $result = $this->mem->get($key, null, $cas_token); // if (!$result || $result == "" || $result == null) { // return null; // } // $this->keyDic->$key = $cas_token; // return JsonUtil::decode($result); // } // // public function set($key, $value, $ts = 0) // { // if ($value == null || $value == "") { // return false; // } // return $this->mem->set($key, JsonUtil::encode($value), $ts); // } // // public function add($key, $value, $ts = 0) // { // if ($value == null || $value == "") { // return false; // } // return $this->mem->add($key, JsonUtil::encode($value), $ts); // } // // public function replace($key, $value, $ts = 0) // { // if ($value == null || $value == "") { // return false; // } // return $this->mem->replace($this->mem, $key, JsonUtil::encode($value), $ts); // } // // public function delete($key) // { // return $this->mem->delete($key); // } // // public function increment($key) // { // return $this->mem->increment($key); // } // // public function getMulti($keys) // { // $resultMulti = $this->mem->getMulti($keys); // $retArray = array(); // foreach ($resultMulti as $result) { // if (!$result || $result == "" || $result == null) { // $retArray[] = null; // } else { // $retArray[] = JsonUtil::decode($result); // } // } // return $retArray; // } // // public function cas($key, $value, $ts) // { // if (!property_exists($this->keyDic, $key)) { // return false; // } // if ($value == null || $value == "") { // return false; // } // $cas_token = $this->keyDic->$key; // return $this->mem->cas($cas_token, $key, JsonUtil::encode($value), $ts); // } // // public function close() // { // return $this->mem->quit(); // } // //// --> 实现抽象类的 功能 // public function copy($surKey, $desKey) // { // return $this->set($desKey, $this->get($surKey)); // } // // /** // * // * @deprecated since version 20160413113950 经过自己考察json_encode对数据的影响并不存在 // * @param type $key // */ // public function getWithoutJson($key) // { // // } // // /** // * // * @deprecated since version 20160413113950 经过自己考察json_encode对数据的影响并不存在 // * @param type $key // * @param type $value // * @param type $ts // */ // public function setWithoutJson($key, $value, $ts = 0) // { // // } // // public function setMutlti($dict, $expireTs = 0) // { // // } // //}