Provides a simple cacheing mechanism using the Alternative PHP Cache extension.
More...
Provides a simple cacheing mechanism using the Alternative PHP Cache extension.
- Author
- Andy Green
Definition at line 294 of file cache.inc.
◆ __construct()
APCUCache::__construct |
( |
| ) |
|
Definition at line 296 of file cache.inc.
298 trace(
"Creating APCU Cache", 4);
trace($msg, $lvl=3, $callStack=null)
Send output to the trace log.
◆ clear()
Definition at line 335 of file cache.inc.
337 apcu_clear_cache(
'user');
◆ dump()
Definition at line 340 of file cache.inc.
342 echo
"<table class='list'><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>\n";
346 foreach (
new APCUIterator(
'/.*/') as $kvp)
348 if (!
startsWith($kvp[
'key'], $prefix))
continue;
349 $key = str_replace($prefix,
"", $kvp[
'key']);
350 $value = htmlSafe($kvp[
'value']);
352 echo
"<tr><td><b>$key</b></td><td>{$value}</td></tr>\n";
354 echo
"</tbody></table>";
startsWith($text, $start)
Tests whether a string starts with a given sub-string.
◆ get()
Definition at line 301 of file cache.inc.
305 $s = apcu_fetch($key, $success);
306 if (!$success)
return null;
308 return unserialize($s);
◆ invalidate()
APCUCache::invalidate |
( |
|
$key | ) |
|
Definition at line 316 of file cache.inc.
318 return apcu_delete($key);
◆ invalidateMatching()
APCUCache::invalidateMatching |
( |
|
$pattern | ) |
|
Definition at line 321 of file cache.inc.
323 trace(
"invalidateMatching: $pattern", 3);
◆ put()
APCUCache::put |
( |
|
$key, |
|
|
|
$obj, |
|
|
|
$ttl = 0 |
|
) |
| |
Definition at line 311 of file cache.inc.
313 return apcu_store($key, serialize($obj), $ttl);
The documentation for this class was generated from the following file: