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