示例#1
0
/**
 * Make a cache key with database-agnostic prefix.
 *
 * Doesn't have a wiki-specific namespace. Uses a generic 'global' prefix
 * instead. Must have a prefix as otherwise keys that use a database name
 * in the first segment will clash with wfMemcKey/wfForeignMemcKey.
 *
 * @since 1.26
 * @param string $args,...
 * @return string
 */
function wfGlobalCacheKey()
{
    return call_user_func_array(array(ObjectCache::getMainClusterInstance(), 'makeGlobalKey'), func_get_args());
}
示例#2
0
 public function testWfGlobalCacheKey()
 {
     $cache = ObjectCache::getMainClusterInstance();
     $this->assertEquals($cache->makeGlobalKey('foo', 123, 'bar'), wfGlobalCacheKey('foo', 123, 'bar'));
 }