summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-01-05 15:05:53 -0800
committerBrion Vibber <brion@pobox.com>2010-01-05 15:05:53 -0800
commitaff78e51216e09a6e5c95c775d636530c85736fc (patch)
tree0b10f1c932380b690e912d38635e958852873df6 /lib
parent250bcfa8dc3ebf3c2c8458f363a62c529eb3a7f6 (diff)
Cache fixes:
* We now cache negative lookups; clear them in Memcached_DataObject->insert() * Mark file.url as a unique key in statusnet.ini so its negative lookups are cleared properly (first save of a notice with a new URL was failing due to double-insert) * Now using serialization for default in-process cache instead of just saving objects; avoids potential corruption if you save an object to cache, change the original object, then fetch the same key from cache again
Diffstat (limited to 'lib')
-rw-r--r--lib/cache.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/cache.php b/lib/cache.php
index 85e8badc1..b7b34c050 100644
--- a/lib/cache.php
+++ b/lib/cache.php
@@ -120,7 +120,7 @@ class Cache
if (Event::handle('StartCacheGet', array(&$key, &$value))) {
if (array_key_exists($key, $this->_items)) {
- $value = $this->_items[$key];
+ $value = unserialize($this->_items[$key]);
}
Event::handle('EndCacheGet', array($key, &$value));
}
@@ -146,7 +146,7 @@ class Cache
if (Event::handle('StartCacheSet', array(&$key, &$value, &$flag,
&$expiry, &$success))) {
- $this->_items[$key] = $value;
+ $this->_items[$key] = serialize($value);
$success = true;