"10.1.3.89", "port" => "443"); public $parami = array("host" => "10.1.3.89", "port" => "443"); public $memcache = array( 'servers' => array( array('host' => 'livestockmem.r2bd3q.cfg.cnn1.cache.amazonaws.com.cn', 'port' => 11211), ), 'prefix' => 'zjcj', 'expire' => 900, ); function waltmode() { // $this->socket = new CSocket($this->params); $this->cache = new CMemcache($this->memcache); } function isSocketPort($bool = false) { if ($bool) { $this->socket = new CSocket($this->parami); } else { $this->socket = new CSocket($this->params); } } function WalletUser($type, $data, $bool = false) { $this->isSocketPort($bool); $ckey = "WalletUser$type" . $data["UserID"]; $rs = $this->cache->get($ckey); if (!$rs) { $rs = $this->socket->senddata($type, $data); if ($rs["Status"]["Code"] == "00" && $rs["Records"]["Record"]["UserID"] > 0) { $this->cache->set($ckey, $rs["Records"]["Record"]); unset($rs["Records"]["Record"]["Password"]); return $rs["Records"]["Record"]; } else { return array(); } } return $rs; } function wallXhList($type,$data,$bool=true){ $this->isSocketPort($bool); $ckey="wallXhList$type".$data["UserID"].$data["CurrentType"].$data["StartNo"].$data["QryCount"]; $rs=$this->cache->get($ckey); if(!$rs){ $rs = $this->socket->senddata($type, $data); if ($rs["Status"]["Code"] == "00" && $rs["Status"]["RetRecords"] > 0) { if ($rs["Status"]["RetRecords"] == 1) { $rs["Records"]["Record"] = array(0 => $rs["Records"]["Record"]); } $this->cache->set($ckey,$rs["Records"]["Record"]); return $rs["Records"]["Record"]; }else{ return array(); } } return $rs; } }