Esempio n. 1
0
 public function getAllow($id)
 {
     $this->check($id, 0.0);
     $a_key = $this->keyAllow($id);
     if (!$this->adapter->exists($a_key)) {
         return $this->maxRequests;
     } else {
         return max(0, floor($this->adapter->get($a_key)));
     }
 }
Esempio n. 2
0
 public function get($key, array $options = []) : CacheItem
 {
     $key = array_key_exists('noprefix', $options) ? $key : $this->prefix . $key;
     return $this->driver->get($key, $options);
 }