Commit f6eecf02 authored by Evan Prodromou's avatar Evan Prodromou

add simple cache getter/setter static functions to Memcached_DataObject

parent 4d3808a8
......@@ -552,4 +552,30 @@ class Memcached_DataObject extends DB_DataObject
{
throw new ServerException("DB_DataObject error [$type]: $message");
}
static function cacheGet($keyPart)
{
$c = self::memcache();
if (empty($c)) {
return false;
}
$cacheKey = common_cache_key($keyPart);
return $c->get($cacheKey);
}
static function cacheSet($keyPart, $value)
{
$c = self::memcache();
if (empty($c)) {
return false;
}
$cacheKey = common_cache_key($keyPart);
return $c->set($cacheKey, $value);
}
}
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