Provides a simple cacheing mechanism using the WinCache PHP extension (for use under IIS).
More...
Provides a simple cacheing mechanism using the WinCache PHP extension (for use under IIS).
Definition at line 361 of file cache.inc.
◆ clear()
Definition at line 417 of file cache.inc.
419 wincache_ucache_clear();
◆ dump()
Definition at line 422 of file cache.inc.
424 $info = wincache_ucache_info();
426 echo
"<table class='list'><thead><tr><th>Key</th><th>Value</th></tr></thead><tbody>\n";
427 foreach ($info[
'ucache_entries'] as $kvp)
429 if (!
startsWith($kvp[
'key_name'], $prefix))
continue;
430 $key = str_replace($prefix,
"", $kvp[
'key_name']);
432 echo
"<tr><td><b>{$key}</b></td><td>".htmlSafe(wincache_ucache_get($kvp[
'key_name'])).
"</td></tr>\n";
434 echo
"</tbody></table>";
startsWith($text, $start)
Tests whether a string starts with a given sub-string.
◆ filterKey()
WCCache::filterKey |
( |
|
$key | ) |
|
Internal callback function that supports the invalidateMatching function.
- Parameters
-
string | $key | the key to be filtered. |
Definition at line 412 of file cache.inc.
414 return preg_match(
"/".$this->pattern.
"/", $key);
◆ get()
Definition at line 368 of file cache.inc.
370 $value = wincache_ucache_get($key, $success);
371 if (!$success)
return null;
373 return unserialize($value);
◆ invalidate()
WCCache::invalidate |
( |
|
$key | ) |
|
Definition at line 381 of file cache.inc.
383 return wincache_ucache_delete($key);
◆ invalidateMatching()
WCCache::invalidateMatching |
( |
|
$pattern | ) |
|
Definition at line 386 of file cache.inc.
388 $this->pattern = $pattern;
390 $info = wincache_ucache_info();
394 foreach($info[
'ucache_entries'] as $entry)
396 $keys[] = $entry[
'key_name'];
398 $doomedKeys = array_filter($keys, array($this,
filterKey));
400 foreach($doomedKeys as $key)
405 unset($this->pattern);
filterKey($key)
Internal callback function that supports the invalidateMatching function.
◆ put()
WCCache::put |
( |
|
$key, |
|
|
|
$obj, |
|
|
|
$ttl = 0 |
|
) |
| |
Definition at line 376 of file cache.inc.
378 return wincache_ucache_set($key, serialize($obj), $ttl);
◆ WCCache()
Definition at line 363 of file cache.inc.
365 trace(
"Creating WinCache cache", 4);
trace($msg, $lvl=3, $callStack=null)
Send output to the trace log.
The documentation for this class was generated from the following file: