diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-01 00:26:03 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-01 00:26:03 +0000 |
commit | aa36d086b48ec6fa4d960cb784251f9c822bde87 (patch) | |
tree | 95cfe267eec226de9fd588625e8354d9df9dbc49 | |
parent | 9f5cd5395a9bae17fbbacf11da5bb1e90fda82a6 (diff) | |
download | brdo-aa36d086b48ec6fa4d960cb784251f9c822bde87.tar.gz brdo-aa36d086b48ec6fa4d960cb784251f9c822bde87.tar.bz2 |
#978144 by Damien Tournoud: Fixed cache_get_multiple() inconsistent with cache_get()
-rw-r--r-- | includes/cache.inc | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/includes/cache.inc b/includes/cache.inc index 460903913..21630617d 100644 --- a/includes/cache.inc +++ b/includes/cache.inc @@ -316,17 +316,9 @@ class DrupalDatabaseCache implements DrupalCacheInterface { } function get($cid) { - try { - // Garbage collection necessary when enforcing a minimum cache lifetime. - $this->garbageCollection($this->bin); - $cache = db_query("SELECT data, created, expire, serialized FROM {" . $this->bin . "} WHERE cid = :cid", array(':cid' => $cid))->fetchObject(); - return $this->prepareItem($cache); - } - catch (Exception $e) { - // If the database is never going to be available, cache requests should - // return FALSE in order to allow exception handling to occur. - return FALSE; - } + $cids = array($cid); + $cache = $this->getMultiple($cids); + return reset($cache); } function getMultiple(&$cids) { |