|
XOOPS
2.6.0
|

Public Member Functions | |
| cacheRead ($cacheKey, $regenFunction, $ttl=null, $args=null) | |
| clear () | |
| delete ($key) | |
| init () | |
| read ($key) | |
| write ($key, $value, $ttl=null) | |
Public Member Functions inherited from Xmf\Module\Helper\AbstractHelper | |
| __construct ($module=null) | |
| addLog ($log) | |
| init () | |
| setDebug ($bool=true) | |
Protected Attributes | |
| $cache | |
| $prefix | |
Protected Attributes inherited from Xmf\Module\Helper\AbstractHelper | |
| $debug | |
| $module | |
Private Member Functions | |
| prefix ($name) | |
| Xmf\Module\Cache::cacheRead | ( | $cacheKey, | |
| $regenFunction, | |||
$ttl = null, |
|||
$args = null |
|||
| ) |
cache block wrapper
If the cache read for $key is a miss, call the $regenFunction to update it. With the PRECOMPUTE strategy, it will trigger a miss on a read on one caller before the cache expires, so it will be done in advance.
| string|string[] | $cacheKey Identifier for the cache item | |
| callable | $regenFunction | function to generate cached content |
| int | DateTime | null | $ttl | time to live, number ofseconds as integer, DateTime to expire at a specific time, or null for default |
| mixed | ...$args variable argument list for $regenFunction |
Definition at line 130 of file Cache.php.
References Xmf\Module\Cache\prefix().

| Xmf\Module\Cache::clear | ( | ) |
| Xmf\Module\Cache::delete | ( | $key | ) |
Delete a key from the cache
| string | $key | Identifier for the data |
Definition at line 109 of file Cache.php.
References Xmf\Module\Cache\prefix().

| Xmf\Module\Cache::init | ( | ) |
Initialize parent::__constuct calls this after verifying module object.
Definition at line 49 of file Cache.php.
References Xoops\getInstance(), and Xmf\Module\Cache\prefix().

|
private |
Add our module prefix to a name
| string | $name | name to prefix |
Definition at line 62 of file Cache.php.
References $name, and Xmf\Module\Cache\$prefix.
Referenced by Xmf\Module\Cache\cacheRead(), Xmf\Module\Cache\delete(), Xmf\Module\Cache\init(), Xmf\Module\Cache\read(), and Xmf\Module\Cache\write().

| Xmf\Module\Cache::read | ( | $key | ) |
Read value for a key from the cache
| string | $key | Identifier for the data |
Definition at line 97 of file Cache.php.
References Xmf\Module\Cache\prefix().

| Xmf\Module\Cache::write | ( | $key, | |
| $value, | |||
$ttl = null |
|||
| ) |
Write a value for a key to the cache
| string | $key | Identifier for the data |
| mixed | $value | Data to be cached - anything except a resource |
| int | DateTime | null | $ttl | Time to live, integer for ttl in seconds, DateTime object to expire at a specific time, or null for |
Definition at line 85 of file Cache.php.
References Xmf\Module\Cache\prefix().

|
protected |
Definition at line 37 of file Cache.php.
Referenced by Xmf\Module\Cache\prefix().