Skip to content

Commit

Permalink
change json to serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
white-poto committed Jun 22, 2016
1 parent 5d72aa9 commit 20e171b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/Cache/FileCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,19 @@ protected function getItem($key)
return false;
}

$cache_data = file_get_contents($cache_file);
if (empty($cache_data)) return false;
$cache_data = unserialize($cache_data);
if ($cache_data) {
$check_expire = $this->checkExpire($cache_data);
if ($check_expire === false) {
$this->delete($key);
return false;
}
$data = file_get_contents($cache_file);
if (empty($data)) return false;
$cache_data = unserialize($data);

if ($cache_data === false) {
return false;
}

return $cache_data;
$check_expire = $this->checkExpire($cache_data);
if ($check_expire === false) {
$this->delete($key);
return false;
}
}

/**
Expand Down

0 comments on commit 20e171b

Please sign in to comment.