Force memcached cache driver to return null as default.

This commit is contained in:
Taylor Otwell 2011-07-07 07:42:06 -07:00
parent a29e76f27b
commit 1d96b96828
1 changed files with 2 additions and 12 deletions

View File

@ -24,30 +24,20 @@ public function has($key)
* Get an item from the cache.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
public function get($key, $default = null)
public function get($key)
{
// --------------------------------------------------
// If the item has already been loaded, return it.
// --------------------------------------------------
if (array_key_exists($key, $this->items))
{
return $this->items[$key];
}
// --------------------------------------------------
// Attempt to the get the item from cache.
// --------------------------------------------------
$cache = \System\Memcached::instance()->get(\System\Config::get('cache.key').$key);
// --------------------------------------------------
// Verify that the item was retrieved.
// --------------------------------------------------
if ($cache === false)
{
return $default;
return null;
}
return $this->items[$key] = $cache;