Caching for CakePHP.
Methods | ||||||||
---|---|---|---|---|---|---|---|---|
public
|
__construct()
XoopsCache::__construct()
XoopsCache::__construct() |
# | ||||||
public
static
|
getInstance(): object
Returns a singleton instance
Returns a singleton instance |
# | ||||||
public
|
config(string|array $name = 'default', array $settings = []): array|false
Set the cache configuration to use
Set the cache configuration to use Parameters
Returns(engine, settings) on success, false on failure |
# | ||||||
public
|
engine(string $name = 'file', array $settings = []): boolean
Set the cache engine to use or modify settings for one instance
Set the cache engine to use or modify settings for one instance Parameters
ReturnsTrue on success, false on failure |
# | ||||||
public
|
gc()
Garbage collection
Garbage collection Permanently remove all expired and deleted data |
# | ||||||
public
static
|
write(string $key, mixed $value, mixed $duration = null): boolean
Write data for key into cache
Write data for key into cache Parameters
ReturnsTrue if the data was successfully cached, false on failure |
# | ||||||
public
static
|
read(string $key, string|array $config = null): mixed
Read a key from the cache
Read a key from the cache Parameters
ReturnsThe cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it |
# | ||||||
public
static
|
delete(string $key, string $config = null): boolean
Delete a key from the cache
Delete a key from the cache Parameters
ReturnsTrue if the value was successfully deleted, false if it didn't exist or couldn't be removed |
# | ||||||
public
|
clear(boolean $check = false, string $config = null): boolean
Delete all keys from the cache
Delete all keys from the cache Parameters
ReturnsTrue if the cache was successfully cleared, false otherwise |
# | ||||||
public
|
settings(string $engine = null): array
Return the settings for current cache engine
Return the settings for current cache engine Parameters
Returnslist of settings for this engine |
# | ||||||
public
|
key(string $key): mixed
generates a safe key
generates a safe key Parameters
Returnsstring $key or false |
# |
Properties | |||
---|---|---|---|
protected
|
object
|
$engine
|
# |