| [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> |
|---|
| [526] | 35 | <th><?php echo _T(isset($free_graph_width) ? '% 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; |
|---|
| 60 | if (!isset($free_graph_width)) { |
|---|
| 61 | // swap |
|---|
| 62 | $tmp = $pvalue; |
|---|
| 63 | $pvalue = $pempty; |
|---|
| 64 | $pempty = $tmp; |
|---|
| 65 | } |
|---|
| [108] | 66 | |
|---|
| [526] | 67 | $w = $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> |
|---|
| 137 | <div class="legendtitle"><?php echo _T(isset($free_graph_width) ? '% Free' : '% Used'); ?></div> |
|---|
| 138 | <div class="legend" style="background: rgb(0,0,255)"> </div> |
|---|
| 139 | <div class="legendtitle"><?php echo _T(isset($free_graph_width) ? 'Free Blocks' : 'Used Blocks'); ?></div> |
|---|
| 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; |
|---|
| 147 | if (function_exists("ob_filter_path_nicer")) { |
|---|
| 148 | ob_start("ob_filter_path_nicer"); |
|---|
| 149 | } |
|---|
| 150 | foreach (array('Cached' => $cachelist['cache_list'], 'Deleted' => $cachelist['deleted_list']) as $listname => $entries) { |
|---|
| 151 | $a->reset(); |
|---|
| 152 | ?> |
|---|
| 153 | |
|---|
| [371] | 154 | <form action="" method="post"> |
|---|
| [519] | 155 | <table cellspacing="0" cellpadding="4" class="cycles entries" width="100%"> |
|---|
| [530] | 156 | <caption><?php echo _T("{$cachelist['type_name']} $listname"); ?></caption> |
|---|
| [34] | 157 | <col /> |
|---|
| 158 | <col /> |
|---|
| [371] | 159 | <col /> |
|---|
| [34] | 160 | <col align="right" /> |
|---|
| 161 | <col align="right" /> |
|---|
| 162 | <col align="right" /> |
|---|
| 163 | <col align="right" /> |
|---|
| 164 | <col align="right" /> |
|---|
| 165 | <col align="right" /> |
|---|
| 166 | <?php |
|---|
| 167 | if ($listname == 'Deleted') { |
|---|
| 168 | echo '<col align="right" />'; |
|---|
| 169 | } |
|---|
| 170 | if ($isphp) { |
|---|
| 171 | echo '<col align="right" />'; |
|---|
| 172 | echo '<col align="right" />'; |
|---|
| 173 | echo '<col align="right" />'; |
|---|
| [321] | 174 | echo '<col align="right" />'; |
|---|
| [34] | 175 | } |
|---|
| 176 | |
|---|
| 177 | echo " |
|---|
| 178 | <tr ", $a->next(), ">"; |
|---|
| 179 | ?> |
|---|
| 180 | |
|---|
| [371] | 181 | <?php if (!$isphp) { ?> |
|---|
| 182 | <th width="20">R</th> |
|---|
| 183 | <?php } ?> |
|---|
| [123] | 184 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Cache'); ?></a></th> |
|---|
| 185 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('entry'); ?></a></th> |
|---|
| 186 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Hits'); ?></a></th> |
|---|
| 187 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Refcount'); ?></a></th> |
|---|
| 188 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Size'); ?></a></th> |
|---|
| [34] | 189 | <?php if ($isphp) { ?> |
|---|
| [321] | 190 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('PhpShared'); ?></a></th> |
|---|
| [123] | 191 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('SrcSize'); ?></a></th> |
|---|
| 192 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Modify'); ?></a></th> |
|---|
| [84] | 193 | <?php if ($haveinode) { ?> |
|---|
| [123] | 194 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('device'); ?></a></th> |
|---|
| 195 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('inode'); ?></a></th> |
|---|
| [34] | 196 | <?php } ?> |
|---|
| [84] | 197 | <?php } ?> |
|---|
| [360] | 198 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('hash'); ?></a></th> |
|---|
| [123] | 199 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Access'); ?></a></th> |
|---|
| 200 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Create'); ?></a></th> |
|---|
| [34] | 201 | <?php if ($listname == 'Deleted') { ?> |
|---|
| [123] | 202 | <th><a href="javascript:" onclick="resort(this); return false"><?php echo _T('Delete'); ?></a></th> |
|---|
| [34] | 203 | <?php } ?> |
|---|
| 204 | </tr> |
|---|
| 205 | <?php |
|---|
| 206 | foreach ($entries as $i => $entry) { |
|---|
| 207 | echo " |
|---|
| 208 | <tr ", $a->next(), ">"; |
|---|
| 209 | $name = htmlspecialchars($entry['name']); |
|---|
| 210 | $hits = number_format($entry['hits']); |
|---|
| 211 | $refcount = number_format($entry['refcount']); |
|---|
| 212 | $size = size($entry['size']); |
|---|
| 213 | if ($isphp) { |
|---|
| [321] | 214 | $sourcesize = size($entry['sourcesize']); |
|---|
| 215 | $phprefcount = number_format($entry['phprefcount']); |
|---|
| [34] | 216 | } |
|---|
| 217 | |
|---|
| 218 | if ($isphp) { |
|---|
| 219 | $mtime = age($entry['mtime']); |
|---|
| 220 | } |
|---|
| 221 | $ctime = age($entry['ctime']); |
|---|
| 222 | $atime = age($entry['atime']); |
|---|
| [146] | 223 | if ($listname == 'Deleted') { |
|---|
| 224 | $dtime = age($entry['dtime']); |
|---|
| 225 | } |
|---|
| [34] | 226 | |
|---|
| [371] | 227 | if (!$isphp) { |
|---|
| 228 | echo <<<ENTRY |
|---|
| 229 | <td><input type="checkbox" name="remove[]" value="{$name}"/></td> |
|---|
| 230 | ENTRY; |
|---|
| 231 | $uname = urlencode($entry['name']); |
|---|
| 232 | $namelink = "<a href=\"edit.php?name=$uname\">$name</a>"; |
|---|
| 233 | } |
|---|
| 234 | else { |
|---|
| 235 | $namelink = $name; |
|---|
| 236 | } |
|---|
| 237 | |
|---|
| [34] | 238 | echo <<<ENTRY |
|---|
| 239 | <td>{$entry['cache_name']} {$i}</td> |
|---|
| [371] | 240 | <td>{$namelink}</td> |
|---|
| [34] | 241 | <td int="{$entry['hits']}">{$entry['hits']}</td> |
|---|
| 242 | <td int="{$entry['refcount']}">{$entry['refcount']}</td> |
|---|
| 243 | <td int="{$entry['size']}">{$size}</td> |
|---|
| 244 | ENTRY; |
|---|
| 245 | if ($isphp) { |
|---|
| 246 | echo <<<ENTRY |
|---|
| [321] | 247 | <td int="{$entry['phprefcount']}">{$phprefcount}</td> |
|---|
| [34] | 248 | <td int="{$entry['sourcesize']}">{$sourcesize}</td> |
|---|
| 249 | <td int="{$entry['mtime']}">{$mtime}</td> |
|---|
| 250 | ENTRY; |
|---|
| [84] | 251 | if (isset($entry['inode'])) { |
|---|
| 252 | echo <<<ENTRY |
|---|
| 253 | <td int="{$entry['device']}">{$entry['device']}</td> |
|---|
| 254 | <td int="{$entry['inode']}">{$entry['inode']}</td> |
|---|
| 255 | ENTRY; |
|---|
| 256 | } |
|---|
| [34] | 257 | } |
|---|
| 258 | echo <<<ENTRY |
|---|
| [360] | 259 | <td int="{$entry['hvalue']}">{$entry['hvalue']}</td> |
|---|
| [34] | 260 | <td int="{$entry['atime']}">{$atime}</td> |
|---|
| 261 | <td int="{$entry['ctime']}">{$ctime}</td> |
|---|
| 262 | ENTRY; |
|---|
| 263 | if ($listname == 'Deleted') { |
|---|
| 264 | echo <<<ENTRY |
|---|
| 265 | <td int="{$entry['dtime']}">{$dtime}</td> |
|---|
| 266 | ENTRY; |
|---|
| 267 | } |
|---|
| 268 | |
|---|
| 269 | echo " |
|---|
| 270 | </tr> |
|---|
| 271 | "; |
|---|
| 272 | } |
|---|
| 273 | ?> |
|---|
| 274 | |
|---|
| 275 | </table> |
|---|
| [689] | 276 | <?php if (!$isphp) { ?> |
|---|
| [371] | 277 | <input type="submit" value="<?php echo _T("Remove Selected"); ?>"> |
|---|
| [689] | 278 | <?php } ?> |
|---|
| [371] | 279 | </form> |
|---|
| [34] | 280 | <?php |
|---|
| 281 | } |
|---|
| 282 | if (function_exists("ob_filter_path_nicer")) { |
|---|
| 283 | ob_end_flush(); |
|---|
| 284 | } |
|---|
| 285 | } |
|---|
| [147] | 286 | if ($moduleinfo) { |
|---|
| 287 | $t_moduleinfo = _T("Module Info"); |
|---|
| 288 | echo <<<HTML |
|---|
| 289 | <h2>$t_moduleinfo</h2> |
|---|
| 290 | <div class="moduleinfo">$moduleinfo</div> |
|---|
| 291 | HTML; |
|---|
| 292 | } |
|---|
| [34] | 293 | ?> |
|---|
| [371] | 294 | <?php include("footer.tpl.php"); ?> |
|---|