| [371] | 1 | <?php include("header.tpl.php"); ?> |
|---|
| [530] | 2 | <div id="help"> |
|---|
| 3 | <a href="help.php"><?php echo _T("Help") ?> »</a> |
|---|
| 4 | </div> |
|---|
| 5 | <div class="switcher"><?php echo switcher("type", $types); ?></div> |
|---|
| [34] | 6 | <?php |
|---|
| 7 | $a = new Cycle('class="col1"', 'class="col2"'); |
|---|
| 8 | $b = new Cycle('class="col1"', 'class="col2"'); |
|---|
| 9 | ?> |
|---|
| [46] | 10 | <table cellspacing="0" cellpadding="4" class="cycles"> |
|---|
| [530] | 11 | <caption><?php echo _T('Caches'); ?></caption> |
|---|
| [34] | 12 | <col /> |
|---|
| 13 | <col align="right" /> |
|---|
| 14 | <col align="right" /> |
|---|
| 15 | <col align="right" /> |
|---|
| 16 | <col /> |
|---|
| 17 | <col /> |
|---|
| 18 | <col align="right" /> |
|---|
| 19 | <col align="right" /> |
|---|
| 20 | <col align="right" /> |
|---|
| [522] | 21 | <col /> |
|---|
| [34] | 22 | <col align="right" /> |
|---|
| 23 | <col align="right" /> |
|---|
| 24 | <col align="right" /> |
|---|
| 25 | <col align="right" /> |
|---|
| 26 | <col align="right" /> |
|---|
| [522] | 27 | <col align="right" /> |
|---|
| 28 | <col align="right" /> |
|---|
| [34] | 29 | <col /> |
|---|
| 30 | <tr <?php echo $a->next(); ?>> |
|---|
| [46] | 31 | <th>-</th> |
|---|
| [123] | 32 | <th><?php echo _T('Slots'); ?></th> |
|---|
| 33 | <th><?php echo _T('Size'); ?></th> |
|---|
| 34 | <th><?php echo _T('Avail'); ?></th> |
|---|
| [902] | 35 | <th><?php echo _T($config['percent_graph_type'] == 'free' ? '% Free' : '% Used'); ?></th> |
|---|
| [123] | 36 | <th><?php echo _T('Clear'); ?></th> |
|---|
| 37 | <th><?php echo _T('Compiling'); ?></th> |
|---|
| 38 | <th><?php echo _T('Hits'); ?></th> |
|---|
| [522] | 39 | <th><?php echo _T('Hits/H'); ?></th> |
|---|
| 40 | <th><?php echo _T('Hits 24H'); ?></th> |
|---|
| 41 | <th><?php echo _T('Hits/S'); ?></th> |
|---|
| [123] | 42 | <th><?php echo _T('Misses'); ?></th> |
|---|
| 43 | <th><?php echo _T('Clogs'); ?></th> |
|---|
| 44 | <th><?php echo _T('OOMs'); ?></th> |
|---|
| [456] | 45 | <th><?php echo _T('Errors'); ?></th> |
|---|
| [123] | 46 | <th><?php echo _T('Protected'); ?></th> |
|---|
| 47 | <th><?php echo _T('Cached'); ?></th> |
|---|
| 48 | <th><?php echo _T('Deleted'); ?></th> |
|---|
| 49 | <th><?php echo _T('GC'); ?></th> |
|---|
| [34] | 50 | </tr> |
|---|
| 51 | <?php |
|---|
| [456] | 52 | $numkeys = explode(',', 'slots,size,avail,hits,misses,clogs,ooms,errors,cached,deleted'); |
|---|
| [123] | 53 | $l_clear = _T('Clear'); |
|---|
| 54 | $l_clear_confirm = _T('Sure to clear?'); |
|---|
| [34] | 55 | foreach ($cacheinfos as $i => $ci) { |
|---|
| 56 | echo " |
|---|
| [352] | 57 | <tr ", $a->next(), ">"; |
|---|
| [526] | 58 | $pvalue = (int) ($ci['avail'] / $ci['size'] * 100); |
|---|
| 59 | $pempty = 100 - $pvalue; |
|---|
| [902] | 60 | if ($config['percent_graph_type'] == 'used') { |
|---|
| [526] | 61 | // swap |
|---|
| 62 | $tmp = $pvalue; |
|---|
| 63 | $pvalue = $pempty; |
|---|
| 64 | $pempty = $tmp; |
|---|
| 65 | } |
|---|
| [108] | 66 | |
|---|
| [902] | 67 | $w = $config['percent_graph_width']; |
|---|
| [521] | 68 | if (empty($ci['istotal'])) { |
|---|
| 69 | $graph = freeblock_to_graph($ci['free_blocks'], $ci['size']); |
|---|
| [526] | 70 | $blocksgraph = "<div class=\"blocksgraph\" style=\"width: {$w}px\">{$graph}</div>"; |
|---|
| [521] | 71 | } |
|---|
| 72 | else { |
|---|
| [526] | 73 | $blocksgraph = ''; |
|---|
| [521] | 74 | } |
|---|
| [517] | 75 | |
|---|
| [188] | 76 | $ci_slots = size($ci['slots']); |
|---|
| 77 | $ci_size = size($ci['size']); |
|---|
| 78 | $ci_avail = size($ci['avail']); |
|---|
| [34] | 79 | $ci = number_formats($ci, $numkeys); |
|---|
| [522] | 80 | |
|---|
| 81 | $hits_avg_h = number_format(array_avg($ci['hits_by_hour']), 2); |
|---|
| 82 | $hits_avg_s = number_format(array_avg($ci['hits_by_second']), 2); |
|---|
| 83 | $hits_graph_h = hits_to_graph($ci['hits_by_hour']); |
|---|
| 84 | $hits_graph_h_w = count($ci['hits_by_hour']) * 2; |
|---|
| 85 | |
|---|
| [521] | 86 | if (!empty($ci['istotal'])) { |
|---|
| 87 | $ci['compiling'] = '-'; |
|---|
| 88 | $ci['can_readonly'] = '-'; |
|---|
| 89 | } |
|---|
| 90 | else { |
|---|
| 91 | $ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-'; |
|---|
| 92 | $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; |
|---|
| 93 | } |
|---|
| [34] | 94 | echo <<<EOS |
|---|
| 95 | <th>{$ci['cache_name']}</th> |
|---|
| [188] | 96 | <td title="{$ci['slots']}">{$ci_slots}</td> |
|---|
| 97 | <td title="{$ci['size']}">{$ci_size}</td> |
|---|
| 98 | <td title="{$ci['avail']}">{$ci_avail}</td> |
|---|
| [530] | 99 | <td title="{$pvalue} %" |
|---|
| [517] | 100 | ><div class="percent" style="width: {$w}px" |
|---|
| [526] | 101 | ><div style="width: {$pvalue}%" class="pvalue"></div |
|---|
| 102 | ><div style="width: {$pempty}%" class="pempty"></div |
|---|
| [517] | 103 | ></div |
|---|
| [526] | 104 | >{$blocksgraph}</td> |
|---|
| [518] | 105 | <td |
|---|
| [530] | 106 | ><form method="post" action="" |
|---|
| [518] | 107 | ><div |
|---|
| 108 | ><input type="hidden" name="type" value="{$ci['type']}" |
|---|
| 109 | /><input type="hidden" name="cacheid" value="{$ci['cacheid']}" |
|---|
| 110 | /><input type="submit" name="clearcache" value="{$l_clear}" class="submit" onclick="return confirm('{$l_clear_confirm}');" |
|---|
| 111 | /></div |
|---|
| 112 | ></form |
|---|
| 113 | ></td> |
|---|
| [34] | 114 | <td>{$ci['compiling']}</td> |
|---|
| 115 | <td>{$ci['hits']}</td> |
|---|
| [522] | 116 | <td>{$hits_avg_h}</td> |
|---|
| 117 | <td><div class="hitsgraph" style="width: {$hits_graph_h_w}px">{$hits_graph_h}</div></td> |
|---|
| 118 | <td>{$hits_avg_s}</td> |
|---|
| [34] | 119 | <td>{$ci['misses']}</td> |
|---|
| 120 | <td>{$ci['clogs']}</td> |
|---|
| 121 | <td>{$ci['ooms']}</td> |
|---|
| [456] | 122 | <td>{$ci['errors']}</td> |
|---|
| [34] | 123 | <td>{$ci['can_readonly']}</td> |
|---|
| 124 | <td>{$ci['cached']}</td> |
|---|
| 125 | <td>{$ci['deleted']}</td> |
|---|
| [118] | 126 | <td>{$ci['gc']}</td> |
|---|
| [34] | 127 | EOS; |
|---|
| 128 | |
|---|
| 129 | $b->reset(); |
|---|
| 130 | ?> |
|---|
| 131 | </tr> |
|---|
| 132 | <?php } ?> |
|---|
| 133 | </table> |
|---|
| [527] | 134 | <div class="blockarea legends"> |
|---|
| 135 | <div class="legendtitle"><?php echo _T('Legends:'); ?></div> |
|---|
| 136 | <div class="legend pvalue"> </div> |
|---|
| [902] | 137 | <div class="legendtitle"><?php echo _T($config['percent_graph_type'] == 'free' ? '% Free' : '% Used'); ?></div> |
|---|
| [527] | 138 | <div class="legend" style="background: rgb(0,0,255)"> </div> |
|---|
| [902] | 139 | <div class="legendtitle"><?php echo _T($config['percent_graph_type'] == 'free' ? 'Free Blocks' : 'Used Blocks'); ?></div> |
|---|
| [527] | 140 | <div class="legend" style="background: rgb(255,0,0)"> </div> |
|---|
| 141 | <div class="legendtitle"><?php echo _T('Hits'); ?></div> |
|---|
| 142 | </div> |
|---|
| [34] | 143 | <?php |
|---|
| 144 | |
|---|
| 145 | if ($cachelist) { |
|---|
| 146 | $isphp = $cachelist['type'] == $type_php; |
|---|
| [902] | 147 | ob_start($config['path_nicer']); |
|---|
| [34] | 148 | foreach (array('Cached' => $cachelist['cache_list'], 'Deleted' => $cachelist['deleted_list']) as $listname => $entries) { |
|---|
| 149 | $a->reset(); |
|---|
| 150 | ?> |
|---|
| 151 | |
|---|
| [371] | 152 | <form action="" method="post"> |
|---|
| [519] | 153 | <table cellspacing="0" cellpadding="4" class="cycles entries" width="100%"> |
|---|
| [530] | 154 | <caption><?php echo _T("{$cachelist['type_name']} $listname"); ?></caption> |
|---|
| [34] | 155 | <?php |
|---|
| 156 | echo " |
|---|
| 157 | <tr ", $a->next(), ">"; |
|---|
| 158 | ?> |
|---|
| 159 | |
|---|
| [371] | 160 | <?php if (!$isphp) { ?> |
|---|
| 161 | <th width="20">R</th> |
|---|
| 162 | <?php } ?> |
|---|
| [123] | 163 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Cache'); ?></a></th> |
|---|
| 164 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('entry'); ?></a></th> |
|---|
| 165 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Hits'); ?></a></th> |
|---|
| 166 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Refcount'); ?></a></th> |
|---|
| 167 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Size'); ?></a></th> |
|---|
| [34] | 168 | <?php if ($isphp) { ?> |
|---|
| [321] | 169 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('PhpShared'); ?></a></th> |
|---|
| [123] | 170 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('SrcSize'); ?></a></th> |
|---|
| 171 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Modify'); ?></a></th> |
|---|
| [84] | 172 | <?php if ($haveinode) { ?> |
|---|
| [123] | 173 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('device'); ?></a></th> |
|---|
| 174 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('inode'); ?></a></th> |
|---|
| [34] | 175 | <?php } ?> |
|---|
| [84] | 176 | <?php } ?> |
|---|
| [360] | 177 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('hash'); ?></a></th> |
|---|
| [123] | 178 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Access'); ?></a></th> |
|---|
| 179 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Create'); ?></a></th> |
|---|
| [34] | 180 | <?php if ($listname == 'Deleted') { ?> |
|---|
| [123] | 181 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Delete'); ?></a></th> |
|---|
| [34] | 182 | <?php } ?> |
|---|
| 183 | </tr> |
|---|
| 184 | <?php |
|---|
| 185 | foreach ($entries as $i => $entry) { |
|---|
| 186 | echo " |
|---|
| 187 | <tr ", $a->next(), ">"; |
|---|
| 188 | $name = htmlspecialchars($entry['name']); |
|---|
| 189 | $hits = number_format($entry['hits']); |
|---|
| 190 | $refcount = number_format($entry['refcount']); |
|---|
| 191 | $size = size($entry['size']); |
|---|
| 192 | if ($isphp) { |
|---|
| [851] | 193 | $file_size = size($entry['file_size']); |
|---|
| [321] | 194 | $phprefcount = number_format($entry['phprefcount']); |
|---|
| [34] | 195 | } |
|---|
| 196 | |
|---|
| 197 | if ($isphp) { |
|---|
| [868] | 198 | $file_mtime = age($entry['file_mtime']); |
|---|
| [34] | 199 | } |
|---|
| 200 | $ctime = age($entry['ctime']); |
|---|
| 201 | $atime = age($entry['atime']); |
|---|
| [146] | 202 | if ($listname == 'Deleted') { |
|---|
| 203 | $dtime = age($entry['dtime']); |
|---|
| 204 | } |
|---|
| [34] | 205 | |
|---|
| [371] | 206 | if (!$isphp) { |
|---|
| 207 | echo <<<ENTRY |
|---|
| 208 | <td><input type="checkbox" name="remove[]" value="{$name}"/></td> |
|---|
| 209 | ENTRY; |
|---|
| 210 | $uname = urlencode($entry['name']); |
|---|
| 211 | $namelink = "<a href=\"edit.php?name=$uname\">$name</a>"; |
|---|
| 212 | } |
|---|
| 213 | else { |
|---|
| 214 | $namelink = $name; |
|---|
| 215 | } |
|---|
| 216 | |
|---|
| [34] | 217 | echo <<<ENTRY |
|---|
| 218 | <td>{$entry['cache_name']} {$i}</td> |
|---|
| [371] | 219 | <td>{$namelink}</td> |
|---|
| [868] | 220 | <td align="right" int="{$entry['hits']}">{$entry['hits']}</td> |
|---|
| 221 | <td align="right" int="{$entry['refcount']}">{$entry['refcount']}</td> |
|---|
| 222 | <td align="right" int="{$entry['size']}">{$size}</td> |
|---|
| [34] | 223 | ENTRY; |
|---|
| 224 | if ($isphp) { |
|---|
| 225 | echo <<<ENTRY |
|---|
| [868] | 226 | <td align="right" int="{$entry['phprefcount']}">{$phprefcount}</td> |
|---|
| 227 | <td align="right" int="{$entry['file_size']}">{$file_size}</td> |
|---|
| 228 | <td align="right" int="{$entry['file_mtime']}">{$file_mtime}</td> |
|---|
| [34] | 229 | ENTRY; |
|---|
| [851] | 230 | if (isset($entry['file_inode'])) { |
|---|
| [84] | 231 | echo <<<ENTRY |
|---|
| [868] | 232 | <td align="right" int="{$entry['file_device']}">{$entry['file_device']}</td> |
|---|
| 233 | <td align="right" int="{$entry['file_inode']}">{$entry['file_inode']}</td> |
|---|
| [84] | 234 | ENTRY; |
|---|
| 235 | } |
|---|
| [34] | 236 | } |
|---|
| 237 | echo <<<ENTRY |
|---|
| [868] | 238 | <td align="right" int="{$entry['hvalue']}">{$entry['hvalue']}</td> |
|---|
| 239 | <td align="right" int="{$entry['atime']}">{$atime}</td> |
|---|
| 240 | <td align="right" int="{$entry['ctime']}">{$ctime}</td> |
|---|
| [34] | 241 | ENTRY; |
|---|
| 242 | if ($listname == 'Deleted') { |
|---|
| 243 | echo <<<ENTRY |
|---|
| [868] | 244 | <td align="right" int="{$entry['dtime']}">{$dtime}</td> |
|---|
| [34] | 245 | ENTRY; |
|---|
| 246 | } |
|---|
| 247 | |
|---|
| 248 | echo " |
|---|
| 249 | </tr> |
|---|
| 250 | "; |
|---|
| 251 | } |
|---|
| 252 | ?> |
|---|
| 253 | |
|---|
| 254 | </table> |
|---|
| [689] | 255 | <?php if (!$isphp) { ?> |
|---|
| [371] | 256 | <input type="submit" value="<?php echo _T("Remove Selected"); ?>"> |
|---|
| [689] | 257 | <?php } ?> |
|---|
| [371] | 258 | </form> |
|---|
| [34] | 259 | <?php |
|---|
| 260 | } |
|---|
| [902] | 261 | ob_end_flush(); |
|---|
| [34] | 262 | } |
|---|
| [147] | 263 | if ($moduleinfo) { |
|---|
| 264 | $t_moduleinfo = _T("Module Info"); |
|---|
| 265 | echo <<<HTML |
|---|
| 266 | <h2>$t_moduleinfo</h2> |
|---|
| 267 | <div class="moduleinfo">$moduleinfo</div> |
|---|
| 268 | HTML; |
|---|
| 269 | } |
|---|
| [34] | 270 | ?> |
|---|
| [371] | 271 | <?php include("footer.tpl.php"); ?> |
|---|