Esempio n. 1
0
 /**
  * Fetches an entry from the cache.
  *
  * @access public
  * @param string $id The id of the cache entry to fetch.
  * @return mixed The cached data or FALSE, if no cache entry exists for the given id.
  */
 public function fetch($id)
 {
     if (Config::get('system.cache.enabled')) {
         return static::$driver->fetch($id);
     } else {
         return false;
     }
 }
Esempio n. 2
0
 /**
  * Remove one triplet of the user from the store
  *
  * @param mixed     $credential
  * @param string    $persistentToken
  */
 public function cleanTriplet($credential, $persistentToken)
 {
     // Hash the tokens, because they can contain a salt and can be
     // accessed in the file system
     $persistentToken = sha1(trim($persistentToken));
     // Delete token from storage
     $id = $this->getId($credential);
     if ($this->driver->contains($id)) {
         list($expire, $tokens) = $this->driver->fetch($id);
         unset($tokens[$persistentToken]);
         $this->driver->save($id, [$expire, $tokens], $expire);
     }
 }