时间:2021-07-01 10:21:17 帮助过:6人阅读
include("wx.php");
$wx = new wxClass();
$cache= $wx->cache;
?>
define("X", "1111");
define("Y","2222");
class wxClass
{
var $x= X;
var $y= Y;
public function __construct($x= NULL, $y= NULL)
{
if($x&& $y){
$this->x= $x;
$this->y= $y;
}
//连接新浪sae 的memcache,需开通
$mem = memcache_init();
$this->cache= memcache_get($mem,"cache");//获取Token
if(empty($this->cache))
{
$this->cache= "mmmm";
memcache_set($mem,"cache",$this->cache,0,7200);//过期时间为7200秒
}
}
}
?>