function onStartCacheGet(&$key, &$value)
{
- $value = xcache_get($key);
- if (!is_null($value)) {
+ if (!xcache_isset($key)) {
+ $value = false;
+ } else {
+ $value = xcache_get($key);
$value = unserialize($value);
}
Event::handle('EndCacheGet', array($key, &$value));
function onStartCacheSet(&$key, &$value, &$flag, &$expiry, &$success)
{
- $success = xcache_set($key, serialize($value),
- (is_null($expiry) ? 0 : $expiry));
+ $success = xcache_set($key, serialize($value));
Event::handle('EndCacheSet', array($key, $value, $flag,
$expiry));
Event::handle('EndCacheDelete', array($key));
return false;
}
+
+ function onPluginVersion(&$versions)
+ {
+ $versions[] = array('name' => 'XCache',
+ 'version' => STATUSNET_VERSION,
+ 'author' => 'Craig Andrews',
+ 'homepage' => 'http://status.net/wiki/Plugin:XCache',
+ 'rawdescription' =>
+ _m('Use the <a href="http://xcache.lighttpd.net/">XCache</a> variable cache to cache query results.'));
+ return true;
+ }
}