Commit e0cf9c21 authored by webchick's avatar webchick

#319403 by Crell: use fetchObject() in cache.inc for consistency with other db fetch routines.

parent 89b0570d
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
// $Id$ // $Id$
/** /**
* Return data from the persistent cache. Data may be stored as either plain * Return data from the persistent cache. Data may be stored as either plain
* text or as serialized data. cache_get will automatically return * text or as serialized data. cache_get will automatically return
* unserialized objects and arrays. * unserialized objects and arrays.
* *
* @param $cid * @param $cid
* The cache ID of the data to retrieve. * The cache ID of the data to retrieve.
* @param $table * @param $table
* The table $table to store the data in. Valid core values are * The table $table to store the data in. Valid core values are
* 'cache_filter', 'cache_menu', 'cache_page', or 'cache' for * 'cache_filter', 'cache_menu', 'cache_page', or 'cache' for
* the default cache. * the default cache.
* @return The cache or FALSE on failure. * @return The cache or FALSE on failure.
*/ */
...@@ -29,7 +29,7 @@ function cache_get($cid, $table = 'cache') { ...@@ -29,7 +29,7 @@ function cache_get($cid, $table = 'cache') {
->execute(); ->execute();
} }
$cache = db_query("SELECT data, created, headers, expire, serialized FROM {" . $table . "} WHERE cid = :cid", array(':cid' => $cid))->fetch(); $cache = db_query("SELECT data, created, headers, expire, serialized FROM {" . $table . "} WHERE cid = :cid", array(':cid' => $cid))->fetchObject();
if (isset($cache->data)) { if (isset($cache->data)) {
// If the data is permanent or we're not enforcing a minimum cache lifetime // If the data is permanent or we're not enforcing a minimum cache lifetime
// always return the cached data. // always return the cached data.
...@@ -87,11 +87,11 @@ function cache_get($cid, $table = 'cache') { ...@@ -87,11 +87,11 @@ function cache_get($cid, $table = 'cache') {
* @param $cid * @param $cid
* The cache ID of the data to store. * The cache ID of the data to store.
* @param $data * @param $data
* The data to store in the cache. Complex data types will be automatically * The data to store in the cache. Complex data types will be automatically
* serialized before insertion. * serialized before insertion.
* Strings will be stored as plain text and not serialized. * Strings will be stored as plain text and not serialized.
* @param $table * @param $table
* The table $table to store the data in. Valid core values are * The table $table to store the data in. Valid core values are
* 'cache_filter', 'cache_menu', 'cache_page', or 'cache'. * 'cache_filter', 'cache_menu', 'cache_page', or 'cache'.
* @param $expire * @param $expire
* One of the following values: * One of the following values:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment