Пример #1
0
 /**
  * 批量获取键值
  * @param array $keys   键名数组
  * @return array|false  键值数组,失败返回false
  */
 public function mGet($keys)
 {
     if ($this->driver->checkDriver()) {
         if (method_exists($this->driver, 'mGet')) {
             return $this->driver->mGet($keys);
         } else {
             $values = [];
             foreach ($keys as $key) {
                 $values[$key] = $this->driver->get($key);
             }
             return $values;
         }
     }
     if ($this->driver->isFallback() && $this->type !== self::$config['fallback']) {
         return $this->driver->backup()->mGet($keys);
     }
     return false;
 }