You are here

public function FileSystemCacheHandler::get in Auth0 Single Sign On 8.2

Parameters

string $key:

Return value

mixed|null

Overrides CacheHandler::get

File

vendor/auth0/auth0-php/src/Helpers/Cache/FileSystemCacheHandler.php, line 38

Class

FileSystemCacheHandler

Namespace

Auth0\SDK\Helpers\Cache

Code

public function get($key) {
  $key = md5($key);
  if (!file_exists($this->tmp_dir . $key)) {
    return null;
  }
  $file = fopen($this->tmp_dir . $key, 'r');
  flock($file, LOCK_EX);
  $data = fgets($file);
  flock($file, LOCK_UN);
  fclose($file);
  return unserialize(base64_decode($data));
}