Tweak APC cache driver to return null for default value.
This commit is contained in:
parent
3eeb69d1bf
commit
9927e3ed4e
|
@ -24,10 +24,9 @@ public function has($key)
|
||||||
* Get an item from the cache.
|
* Get an item from the cache.
|
||||||
*
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param mixed $default
|
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function get($key, $default = null)
|
public function get($key)
|
||||||
{
|
{
|
||||||
if (array_key_exists($key, $this->items))
|
if (array_key_exists($key, $this->items))
|
||||||
{
|
{
|
||||||
|
@ -38,7 +37,7 @@ public function get($key, $default = null)
|
||||||
|
|
||||||
if ($cache === false)
|
if ($cache === false)
|
||||||
{
|
{
|
||||||
return is_callable($default) ? call_user_func($default) : $default;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->items[$key] = $cache;
|
return $this->items[$key] = $cache;
|
||||||
|
|
Loading…
Reference in New Issue