summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-01 00:26:03 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-12-01 00:26:03 +0000
commitaa36d086b48ec6fa4d960cb784251f9c822bde87 (patch)
tree95cfe267eec226de9fd588625e8354d9df9dbc49
parent9f5cd5395a9bae17fbbacf11da5bb1e90fda82a6 (diff)
downloadbrdo-aa36d086b48ec6fa4d960cb784251f9c822bde87.tar.gz
brdo-aa36d086b48ec6fa4d960cb784251f9c822bde87.tar.bz2
#978144 by Damien Tournoud: Fixed cache_get_multiple() inconsistent with cache_get()
-rw-r--r--includes/cache.inc14
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) {