Пример #1
0
 /**
  * 批量判断键值是否存在
  * @param array $keys   键名数组
  * @return array  返回存在的keys
  */
 public function mHas($keys)
 {
     if ($this->driver->checkDriver()) {
         if (method_exists($this->driver, 'mHas')) {
             return $this->driver->mHas($keys);
         } else {
             $hasKeys = [];
             foreach ($keys as $key) {
                 if ($this->driver->has($key)) {
                     $hasKeys[] = $key;
                 }
             }
             return $hasKeys;
         }
     }
     if ($this->driver->isFallback() && $this->type !== self::$config['fallback']) {
         return $this->driver->backup()->mHas($keys);
     }
     return false;
 }