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
 /**
  * Check if a file exists in the filesystem selected
  * 
  * @param string $file The filename (or path)
  * 
  * @return boolean The success of the operation
  */
 public function exists($file)
 {
     return $this->adapter->exists($file);
 }
Esempio n. 3
0
 public function exists($key, array $options = []) : bool
 {
     $key = array_key_exists('noprefix', $options) ? $key : $this->prefix . $key;
     return $this->driver->exists($key, $options);
 }