diff options
Diffstat (limited to 'includes/cache.inc')
-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) { |