Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
Adding in additional logic to the memcache->get() function.
Browse files Browse the repository at this point in the history
  • Loading branch information
gaker committed Aug 21, 2011
1 parent db999a9 commit 1a3a616
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion system/libraries/Cache/drivers/Cache_memcached.php
Expand Up @@ -49,7 +49,17 @@ public function get($id)
{ {
$data = $this->_memcached->get($id); $data = $this->_memcached->get($id);


return (is_array($data)) ? $data[0] : FALSE; if (is_array($data))
{
if (time() > $data[1] + $data[2])
{
return FALSE;
}

return $data[0];
}

return FALSE;
} }


// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
Expand Down

0 comments on commit 1a3a616

Please sign in to comment.