summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-05-12 18:26:15 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-05-12 18:26:15 +0000
commited768b53c0337cbd632d3ad208a60a48fcc50496 (patch)
tree9b83561e686f400d350cce2d655e3826f497e37e
parente99c1203b823a64945157de99782f1028f1bb620 (diff)
downloadbrdo-ed768b53c0337cbd632d3ad208a60a48fcc50496.tar.gz
brdo-ed768b53c0337cbd632d3ad208a60a48fcc50496.tar.bz2
#136837: fix coding style issues of cache table name concatenation as noted by ChrisKennedy
-rw-r--r--includes/cache.inc18
1 files changed, 9 insertions, 9 deletions
diff --git a/includes/cache.inc b/includes/cache.inc
index a679024a8..992b3749d 100644
--- a/includes/cache.inc
+++ b/includes/cache.inc
@@ -18,11 +18,11 @@ function cache_get($key, $table = 'cache') {
$cache_flush = variable_get('cache_flush', 0);
if ($cache_flush && ($cache_flush + variable_get('cache_lifetime', 0) <= time())) {
// Time to flush old cache data
- db_query("DELETE FROM {".$table."} WHERE expire != %d AND expire <= %d", CACHE_PERMANENT, $cache_flush);
+ db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire <= %d", CACHE_PERMANENT, $cache_flush);
variable_set('cache_flush', 0);
}
- $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {".$table."} WHERE cid = '%s'", $key));
+ $cache = db_fetch_object(db_query("SELECT data, created, headers, expire, serialized FROM {". $table ."} WHERE cid = '%s'", $key));
if (isset($cache->data)) {
// If the data is permanent or we're not enforcing a minimum cache lifetime
// always return the cached data.
@@ -105,9 +105,9 @@ function cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $he
$serialized = 1;
}
db_lock_table($table);
- db_query("UPDATE {".$table."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, time(), $expire, $headers, $serialized, $cid);
+ db_query("UPDATE {". $table ."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, time(), $expire, $headers, $serialized, $cid);
if (!db_affected_rows()) {
- @db_query("INSERT INTO {".$table."} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, time(), $expire, $headers, $serialized);
+ @db_query("INSERT INTO {". $table ."} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, time(), $expire, $headers, $serialized);
}
db_unlock_tables();
}
@@ -154,26 +154,26 @@ function cache_clear_all($cid = NULL, $table = NULL, $wildcard = FALSE) {
else if (time() > ($cache_flush + variable_get('cache_lifetime', 0))) {
// Clear the cache for everyone, cache_flush_delay seconds have
// passed since the first request to clear the cache.
- db_query("DELETE FROM {".$table."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
+ db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
variable_set('cache_flush', 0);
}
}
else {
// No minimum cache lifetime, flush all temporary cache entries now.
- db_query("DELETE FROM {".$table."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
+ db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time());
}
}
else {
if ($wildcard) {
if ($cid == '*') {
- db_query("DELETE FROM {".$table."}");
+ db_query("DELETE FROM {". $table ."}");
}
else {
- db_query("DELETE FROM {".$table."} WHERE cid LIKE '%s%%'", $cid);
+ db_query("DELETE FROM {". $table ."} WHERE cid LIKE '%s%%'", $cid);
}
}
else {
- db_query("DELETE FROM {".$table."} WHERE cid = '%s'", $cid);
+ db_query("DELETE FROM {". $table ."} WHERE cid = '%s'", $cid);
}
}
}