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