Xmf\Module\Helper\Cacheclass is a module aware helper for using the system cache for module related data. The underlying cache is a key value store. This helper isolates the module related data by applying a module specific prefix to each key.
Creates the cache helper for the module specified by name as $dirname. If the string $dirname is empty, the current module in XOOPS will be used.
Write the value $value for a key named $key to the cache, using the specified number of seconds in $ttl as the time to live.
Read value for the key named $key from the cache. If the key does not exist, it returns $default, or false if $default was not specified.
Deletes any key named $key from the cache.
The cacheRead() method combines reading and any needed regenerating of the cache entry into a single call.
First, it attempts to read the cache entry for $key, and returns it if found.
If the cache read fails, it calls the specified callable, $regenFunction, passing to it any variable arguments, $args. It writes the return of $regenFunction to the cache for $key with time to live $ttl, and returns the new cached value to the caller.