Showing
2 changed files
with
25 additions
and
2 deletions
@@ -83,6 +83,29 @@ class Cache | @@ -83,6 +83,29 @@ class Cache | ||
83 | } | 83 | } |
84 | 84 | ||
85 | /** | 85 | /** |
86 | + * 直接查询缓存,不对key做任何处理 | ||
87 | + */ | ||
88 | + public static function getBy($key, $node = 'master') | ||
89 | + { | ||
90 | + $result = array(); | ||
91 | + | ||
92 | + try { | ||
93 | + // WINDOWS | ||
94 | + if (DIRECTORY_SEPARATOR === '\\') { | ||
95 | + $result = HoodCache::Memcache($node)->getBy($key); | ||
96 | + } | ||
97 | + // LINUX | ||
98 | + else { | ||
99 | + $result = HoodCache::Memcached($node)->getBy($key); | ||
100 | + } | ||
101 | + } catch (Exception $e) { | ||
102 | + $result = array(); | ||
103 | + } | ||
104 | + | ||
105 | + return $result; | ||
106 | + } | ||
107 | + | ||
108 | + /** | ||
86 | * 清除缓存 | 109 | * 清除缓存 |
87 | * | 110 | * |
88 | * @param string $key 键名 | 111 | * @param string $key 键名 |
-
Please register or login to post a comment