Skip to content
Browse files

Adding in additional logic to the memcache->get() function.

  • Loading branch information...
1 parent db999a9 commit 1a3a616b9add62b2752fb0c6bf4dab8849fd3e79 @gaker gaker committed
Showing with 11 additions and 1 deletion.
  1. +11 −1 system/libraries/Cache/drivers/Cache_memcached.php
View
12 system/libraries/Cache/drivers/Cache_memcached.php
@@ -49,7 +49,17 @@ public function 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;
}
// ------------------------------------------------------------------------

0 comments on commit 1a3a616

Please sign in to comment.
Something went wrong with that request. Please try again.