incr(self::getRealKey('#GROUP:' . $group_name . ':v'), 1) ? true : false; } else { return false; } } /** * Clear all keys from the cache. * * This method returns true on success and false on failure. * * @return bool */ public static function clearAll() { if (self::$_driver !== null) { return self::$_driver->clear() ? true : false; } else { return false; } } /** * Get the actual key used by Rhymix. * * @param string $key * @param string $group_name (optional) * @return string */ public static function getRealKey($key, $group_name = null) { if ($group_name) { $group_version = intval(self::get('#GROUP:' . $group_name . ':v')); return self::getCachePrefix() . '#GROUP:' . $group_name . ':' . $group_version . ':' . $key; } else { return self::getCachePrefix() . $key; } } }