<?php
/*
* memcache类
*/
class Memcacheds{
//声明静态成员变量
private static $m = null;
private static $cache = null;
private function __construct() {
self::$m = new Memcache();
self::$m->connect('www.cat.com','11211'); //写入缓存地址,端口
}
//为当前类创建对象
private static function Men(){
self::$cache = new Memcacheds();
return self::$m;
}
/*
* 添加缓存数据
* @param string $key 获取数据唯一key
* @param String||A
/*
* memcache类
*/
class Memcacheds{
//声明静态成员变量
private static $m = null;
private static $cache = null;
private function __construct() {
self::$m = new Memcache();
self::$m->connect('www.cat.com','11211'); //写入缓存地址,端口
}
//为当前类创建对象
private static function Men(){
self::$cache = new Memcacheds();
return self::$m;
}
/*
* 添加缓存数据
* @param string $key 获取数据唯一key
* @param String||A