Commit 44a48256 authored by Taylor Otwell's avatar Taylor Otwell

Allow cache class to look for existing items in driver's items array.

parent 82d5760a
...@@ -40,6 +40,11 @@ class Cache { ...@@ -40,6 +40,11 @@ class Cache {
*/ */
public static function get($key, $default = null, $driver = null) 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))) if (is_null($item = static::driver($driver)->get($key)))
{ {
return is_callable($default) ? call_user_func($default) : $default; return is_callable($default) ? call_user_func($default) : $default;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment