Memcache类

class Memcache{
private static $mem = null;
public function mem_create(){
self::$mem = new \Memcache();
self::$mem->connect('127.0.0.1');
}
public function __destruct(){
if(self::$mem instanceof \Memcache) self::$mem->close();
}
public fucntion mem_set($k,$v,$boolean = false,$expire = ){
if(!self::$mem instanceof \Memcache) $this->mem_create();
return self::$mem->set($k,$v,$boolean,$e);
}
public fucntion mem_add($k,$v,$boolean = false,$expire = ){
if(!self::$mem instanceof \Memcache) $this->mem_create();
return self::$mem->add($k,$v,$boolean,$e);
}
public fucntion mem_get($k){
if(!self::$mem instanceof \Memcache) $this->mem_create();
return self::$mem->get($k);
}
}
上一篇:Sublime Text3 高亮显示Jade语法 (Windows 环境)


下一篇:【PMP】项目和运营的区别