public static function init($config): Rhymix\Framework\Drivers\CacheInterface
Initialize the cache system.
public static function getSupportedDrivers(): array
Get the list of supported cache drivers.
public static function getDriverName(): ?string
Get the name of the currently enabled cache driver.
public static function getDriverInstance(
$name = null,
array $config = []
): ?Rhymix\Framework\Drivers\CacheInterface
Get the currently enabled cache driver, or a named driver with the given settings.
public static function getPrefix(): string
Get the automatically generated cache prefix for this installation of Rhymix.
public static function getDefaultTTL(): int
Get the default TTL.
public static function setDefaultTTL(int $ttl): void
Set the default TTL.
public static function get(string $key)
Get the value of a key. This method returns null if the key was not found.
public static function set(
string $key,
$value,
int $ttl = 0,
bool $force = false
): bool
Set the value to a key. This method returns true on success and false on failure. $ttl is measured in seconds. If it is not given, the default TTL is used. $force is used to cache essential data when using the default driver.
public static function delete(string $key): bool
Delete a key. This method returns true on success and false on failure. If the key does not exist, it should return false.
public static function exists(string $key): bool
Check if a key exists. This method returns true on success and false on failure.
public static function incr(
string $key,
int $amount = 1
): int
Increase the value of a key by $amount. If the key does not exist, this method assumes that the current value is zero. This method returns the new value, or -1 on failure.
public static function decr(
string $key,
int $amount = 1
): int
Decrease the value of a key by $amount. If the key does not exist, this method assumes that the current value is zero. This method returns the new value, or -1 on failure.
public static function clearGroup(string $group_name): bool
Clear a group of keys from the cache. This method returns true on success and false on failure.
public static function clearAll(): bool
Clear all keys from the cache. This method returns true on success and false on failure.
public static function getGroupVersion(string $group_name): int
Get the group version.
public static function getRealKey(string $key): string
Get the actual key used by Rhymix.