Authored by 郝肖肖

plugin改成webplugin

@@ -11,8 +11,8 @@ @@ -11,8 +11,8 @@
11 11
12 namespace Api; 12 namespace Api;
13 13
14 -use Plugin\Cache;  
15 -use Plugin\UdpLog; 14 +use WebPlugin\Cache;
  15 +use WebPlugin\UdpLog;
16 16
17 class Yohobuy 17 class Yohobuy
18 { 18 {
@@ -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 键名