◆ cacheRead()
cacheRead |
( |
|
$key, |
|
|
|
$regenFunction, |
|
|
|
$ttl = null , |
|
|
|
$args = null |
|
) |
| |
cache block wrapper
If the cache read for $key is a miss, call the $regenFunction to update it.
- Parameters
-
string | $key | Identifier for the cache item |
callable | $regenFunction | function to generate cached content |
int | null | $ttl | time to live, number of seconds as integer or null for default |
mixed | $args | variable argument list for $regenFunction |
- Returns
- mixed
◆ delete()
Delete a key from the cache
- Parameters
-
string | $key | Identifier for the data |
- Returns
- void
◆ init()
Initialize parent::__construct calls this after verifying module object.
- Returns
- void
Reimplemented from AbstractHelper.
◆ prefix()
Add our module prefix to a name
- Parameters
-
string | $name | name to prefix |
- Returns
- string module prefixed name
◆ read()
read |
( |
|
$key, |
|
|
|
$default = false |
|
) |
| |
Read value for a key from the cache
- Parameters
-
string | $key | Identifier for the data |
mixed | $default | default value to return if config $key is not set |
- Returns
- mixed value if key was set, false not set or expired
◆ write()
write |
( |
|
$key, |
|
|
|
$value, |
|
|
|
$ttl = null |
|
) |
| |
Write a value for a key to the cache
- Parameters
-
string | $key | Identifier for the data |
mixed | $value | Data to be cached - anything except a resource |
int | null | $ttl | Time to live in seconds |
- Returns
- bool True if the data was successfully cached, false on failure
◆ $cache
◆ $prefix
The documentation for this class was generated from the following file:
- C:/xoops2511b2/htdocs/class/libraries/vendor/xoops/xmf/src/Module/Helper/Cache.php