$_REQUEST['maintenanceMessage']]))); } if ($maintenance = gasCache::get('maintenance')) { if ($maintenance !== 1) { $maintenance = json_decode(gzuncompress($maintenance), true); } } if (isset($_REQUEST['admin'])) { switch ($_REQUEST['admin']) { case 'getKeys' : $info = gasCache::getAllKeys(); $data = ''; $foundKeys = array(); if (is_array($info)) { sort($info); foreach($info as $row) { if (!in_array($row, $foundKeys)) { $keyCount++; $data .= ""; $data .= "$row"; $data .= '
'; $foundKeys[] = $row; } } $data .= '


'; $data = 'Key Count: ' . $keyCount . '

' . $data; } break; case 'getStats' : $data = gasCache::get_stats(); break; case 'doFlush' : gasCache::flush_cache(); $data = 'Cache has been flushed'; break; case 'doDeleteAll': $keys = gasCache::getAllKeys(); if (is_array($keys)) { foreach($keys as $key) { if(!gasCache::delete($key)) echo "Could not delete one of the keys"; } echo "Deleted all keys!"; } break; case 'toggleMaintenance': if($maintenance) { gasCache::delete('maintenance'); } else { gasCache::add('maintenance', gzcompress(true)); } header("Location: ".$_SERVER['SCRIPT_NAME']."?admin=getKeys"); die; break; } } elseif (isset($_REQUEST['idhash'], $_REQUEST['delete'])) { $key = $_REQUEST['idhash']; if(!gasCache::delete($key)) $errorMsg[] = 'Could not delete: ' . $key; else { header("Location: ".$_SERVER['SCRIPT_NAME']."?admin=getKeys"); die; } } if (isset($_REQUEST['idhash'])) { $eClass = ''; $idHash = htmlspecialchars(trim($_REQUEST['idhash'])); $allKeys = empty($info) ? gasCache::getAllKeys() : $info; $data = ''; $multi = ''; $realHash = ''; $foundKeys = array(); foreach($allKeys as $key) { if (stripos($key, $idHash) !== false and (!in_array($key, $foundKeys))) { $foundKeys[] = $key; $multi .= ""; $multi .= "$key"; $multi .= '
'; // Side effect is that only the first instance gets saved to $data // but it doesn't matter because if there is more than on e instance // we display all of the instances ($multi) instead of the details if(empty($data)) { $realHash = (strlen($idHash) > 30) ? $key : $idHash; // save the real $idHash of what we might be displaying the details of $data = gasCache::get($realHash); if (is_null($data)) { $data = gasCache::sysGet($realHash); } else { $sizeB = strlen(serialize($data)); $data = json_decode(gzuncompress($data), true); $sizeA = strlen(serialize($data)); } } } } if(substr_count($multi, '
') > 1) $data = $multi; else $idHash = $realHash; // We display the $idHash in the details so display what // the real $idHash is, not what they were looking for if(empty($data)) { $data = 'key not found in-cache: ' . $idHash; } } ?> Cash Peak - Better than a ATM!
Cash Peak
Cash Commands Get All Keys
Get Cache Stats
Flush Cache
Delete All Keys
Toggle Maintenance Mode (Status: )





     
'; } } ?>
Hash Key: ' . $realHash . '
'; if ($sizeA and $sizeB) { echo '
Size In-Cache: ' . $sizeB . '
'; echo '
Size In-Memory: ' . $sizeA . '
'; echo '
Compression: ' . sprintf('%2.2f',(($sizeA - $sizeB) / $sizeA) * 100) . '%
'; } echo "
";
                var_export($data);  // use this one only if you've tweaked your var-dump depth
                echo "
"; } elseif (!empty($realHash)) { echo '
Output for: ' . $realHash . COLON; echo $data; echo '
'; } } ?>