作者:爱lovely壮壮_366 | 来源:互联网 | 2018-03-20 18:27
addServer($INI['memcachehost'], $INI['memcacheport']);
$res['value'] = $m1->get($key, null, $cas);
$res['cas'] = $cas;
}
else
{
$m1 = self::getinstance();
$m1->addServer($INI['memcachehost'], $INI['memcacheport']);
$res['value'] = $m1->get($key);
}
return $res;
}
static public function set($key,$value,$cas)
{
$value = (string)$value;
global $INI;
if(class_exists('Memcached'))
{
$m1 = self::getinstance();
$m1->addServer($INI['memcachehost'], $INI['memcacheport']);
$res = $m1->cas($cas,$key,$value);
}
else
{
$m1 = self::getinstance();
$m1->addServer($INI['memcachehost'], $INI['memcacheport']);
$res = $m1->set($key,$value);
}
return $res;
}
}