...
|
...
|
@@ -35,6 +35,7 @@ class Cache |
|
|
*/
|
|
|
public static function set($key, $value, $expire = 3600)
|
|
|
{
|
|
|
if(USE_CACHE) {
|
|
|
try {
|
|
|
// WINDOWS
|
|
|
if (DIRECTORY_SEPARATOR === '\\') {
|
...
|
...
|
@@ -50,6 +51,7 @@ class Cache |
|
|
// do nothing
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取缓存
|
...
|
...
|
@@ -61,7 +63,7 @@ class Cache |
|
|
public static function get($key, $node = 'master')
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
if(USE_CACHE) {
|
|
|
try {
|
|
|
// WINDOWS
|
|
|
if (DIRECTORY_SEPARATOR === '\\') {
|
...
|
...
|
@@ -74,7 +76,7 @@ class Cache |
|
|
} catch (Exception $e) {
|
|
|
$result = array();
|
|
|
}
|
|
|
|
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -86,6 +88,7 @@ class Cache |
|
|
*/
|
|
|
public static function delete($key)
|
|
|
{
|
|
|
if(USE_CACHE) {
|
|
|
// WINDOWS
|
|
|
if (DIRECTORY_SEPARATOR === '\\') {
|
|
|
HoodCache::Memcache('master')->delete(self::makeKey($key, 'master'));
|
...
|
...
|
@@ -97,6 +100,7 @@ class Cache |
|
|
HoodCache::Memcached('slave')->delete(self::makeKey($key, 'slave'));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 生成键名
|
...
|
...
|
|