public function get($key)
{
$key = $this->appendLocale($key);
if (!empty($this->tags)) {
foreach ($this->tags as $tag) {
if (in_array($tag, $this->deleted_tags)) {
// return;
}
}
}
if (!isset($this->memory[$key])) {
$path = $this->path($key);
if (!$this->files->exists($path)) {
return;
}
try {
$expire = substr($contents = @file_get_contents($path), 0, 10);
} catch (\Exception $e) {
return;
}
// If the current time is greater than expiration timestamps we will delete
// the file and return null. This helps clean up the old files and keeps
// this directory much cleaner for us as old files aren't hanging out.
if (time() >= $expire) {
return $this->forget($key);
}
if ($contents) {
$this->memory[$key] = unserialize(substr($contents, 10));
}
}
return $this->memory[$key];
}