Allow cache class to look for existing items in driver's items array.
This commit is contained in:
parent
82d5760a32
commit
44a48256c7
|
@ -40,6 +40,11 @@ public static function driver($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)))
|
||||
{
|
||||
return is_callable($default) ? call_user_func($default) : $default;
|
||||
|
|
Loading…
Reference in New Issue