From 44a48256c7048eb6241bd7f83fce2ca5e6654aa8 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 8 Jul 2011 06:43:02 -0700 Subject: [PATCH] Allow cache class to look for existing items in driver's items array. --- system/cache.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/cache.php b/system/cache.php index 3bff3599..afb641a5 100644 --- a/system/cache.php +++ b/system/cache.php @@ -40,6 +40,11 @@ class Cache { */ public static function get($key, $default = null, $driver = null) { + if (array_key_exists($key, static::driver($driver)->items)) + { + return static::driver($driver)->items[$key]; + } + if (is_null($item = static::driver($driver)->get($key))) { return is_callable($default) ? call_user_func($default) : $default;