isHit(); return $res; } $res = new CacheItem($key, $default, 0); $res->setHit(false)->expiresAfter(-1); Logger::debug("Cache-get no hit" . $key); return $res; } /** * 获取数据 * @param $key * @param $default * @return mixed|null */ static public function getValue($key, $default = null) { $item = self::get($key, $default); return $item->getValue(); } /** * has数据 * * @param $key * @return bool */ static public function has($key) { $key = self::getKey($key); return \Illuminate\Support\Facades\Cache::has($key); } static public function getTags($key) { $key = self::getKey($key); } /** * 获取键名 * * @param $data * @return string */ static public function getKey($data) { if(is_string($data)){ return $data; } return md5(serialize($data)); } }