"; $tmp .= "   " . $key . "
"; $keyData[] = $tmp; } } $keyCount = count($foundKeys); $data = STRING_CACHE_SEARCH; } else { // otherwise, they clicked on a nav-bar option switch ($data) { case STRING_CACHE_FETCH : $cRecord = gasCache::sysGet($_REQUEST[STRING_CACHE_CKEY]); if (!empty($cRecord) and !is_array($cRecord)) { $extractedData = json_decode(gzuncompress($cRecord), true); if (!is_null($extractedData)) $cRecord = $extractedData; } elseif (empty($cRecord)) { $errorMessage = 'Data referenced by key no longer exists in-cache; the key may have expired.'; } break; case STRING_CACHE_FLUSH : $res = gasCache::flush_cache(); $cRecord = 'Cache was ' . ((!$res) ? 'NOT ' : '') . 'flushed successfully!'; break; case STRING_CACHE_STATS : $cData = gasCache::get_stats(); break; case STRING_CACHE_DELETE : gasCache::sysDel($_REQUEST[STRING_CACHE_CKEY]); $delMsg = 'Key ' . $_REQUEST[STRING_CACHE_CKEY] . ' was deleted.'; break; case STRING_CACHE_KEYS : // get a list of all keys in cache $keyList = gasCache::getAllKeys(); sort($keyList); $foundKeys = []; $counter = 1; $keyData = []; if (is_array($keyList)) { foreach ($keyList as $cKey) { if (!in_array($cKey, $foundKeys)) { $foundKeys[] = $cKey; $tmp = "  "; $tmp .= "   " . $cKey . "
"; $keyData[] = $tmp; } } $keyCount = count($foundKeys); } break; case STRING_CACHE_HOME : ; // do nothing break; } } ?> Namaste Tools: Cache Jefe

Namaste Cache Jefe

Diagnostic and Debugging Tool

Making cache your bitch since 2011!



Home displays this page

Keys lists all of the available keys currently stored in cache

Stats displays cache stats output which as some useful information

Flush flushes cache and deletes ALL keys

Search allows you to search by all or part of a cache key

'; break; case STRING_CACHE_FETCH : case STRING_CACHE_FLUSH : echo '

'; if ($data == STRING_CACHE_FETCH) echo 'Cached Content for ' . $_REQUEST[STRING_CACHE_CKEY]; else echo 'Cache Flush Request'; echo '

'; if (!is_null($cRecord) and is_array($cRecord)) var_dump($cRecord); elseif (false !== $cRecord and is_scalar($cRecord)) echo $cRecord . '

'; elseif (!empty($errorMessage)) echo "
" . $errorMessage . "
"; else echo "
" . ERROR_UNKNOWN_EVENT . $data . "
"; echo '
'; break; case STRING_CACHE_STATS : echo '

Cache Stats
'; if (is_array($cData)) { var_dump($cData); } else { echo "Could not retrieve cache stats"; } echo '

'; break; case STRING_CACHE_SEARCH : case STRING_CACHE_KEYS : case STRING_CACHE_DELETE : ?>

Current Cached Key Count:' . $keyCount . ''; } elseif ($data == STRING_CACHE_DELETE) { echo '
' . $delMsg . '
'; } else { echo '
Cached Key Search Results Count: ' . $keyCount . '
'; } ?> to delete a cached record.  "; echo "Click the to view the cached record."; } else { if ($data == STRING_CACHE_KEYS) { echo 'There are no records currently stored in the cache system.'; } else { echo 'Search request: "' . $searchKey . '", returned no data.'; } } } ?>


' . $eos; if (!empty($keyData[$index])) echo '
' . $keyData[$index] . '
' . $eos; if (!empty($keyData[($index + 1)])) echo '
' . $keyData[$index+1] . '
' . $eos; if (!empty($keyData[($index + 2)])) echo '
' . $keyData[$index+2] . '
' . $eos; echo '
' . $eos; } ?>