cleaning up code.
This commit is contained in:
parent
8a687053a8
commit
a77196db86
|
@ -75,7 +75,7 @@ public function put($key, $value, $minutes)
|
||||||
$expiration = $this->expiration($minutes);
|
$expiration = $this->expiration($minutes);
|
||||||
|
|
||||||
// To update the value, we'll first attempt an insert against the
|
// To update the value, we'll first attempt an insert against the
|
||||||
// database and if we catch an exception, we'll assume that the
|
// database and if we catch an exception we'll assume that the
|
||||||
// primary key already exists in the table and update.
|
// primary key already exists in the table and update.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,9 +42,8 @@ protected function retrieve($key)
|
||||||
if ( ! file_exists($this->path.$key)) return null;
|
if ( ! file_exists($this->path.$key)) return null;
|
||||||
|
|
||||||
// File based caches store have the expiration timestamp stored in
|
// File based caches store have the expiration timestamp stored in
|
||||||
// UNIX format prepended to their contents. This timestamp is then
|
// UNIX format prepended to their contents. We'll compare the
|
||||||
// extracted and removed when the cache is read to determine if
|
// timestamp to the current time when we read the file.
|
||||||
// the file is still valid.
|
|
||||||
if (time() >= substr($cache = file_get_contents($this->path.$key), 0, 10))
|
if (time() >= substr($cache = file_get_contents($this->path.$key), 0, 10))
|
||||||
{
|
{
|
||||||
return $this->forget($key);
|
return $this->forget($key);
|
||||||
|
|
Loading…
Reference in New Issue