| [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 | <meta http-equiv="Content-Language" content="en-us" /> |
|---|
| 5 | <?php |
|---|
| 6 | echo <<<HEAD |
|---|
| 7 | <meta http-equiv="Content-Type" content="text/html; charset=$charset" /> |
|---|
| 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" /> |
|---|
| [107] | 13 | <title>XCache <?php echo $xcache_version; ?> Administration</title> |
|---|
| [34] | 14 | </head> |
|---|
| 15 | |
|---|
| 16 | <body> |
|---|
| [107] | 17 | <h1>XCache <?php echo $xcache_version; ?> Administration</h1> |
|---|
| [60] | 18 | <a href="help.php" target="_blank" id="help">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 | ?> |
|---|
| [60] | 24 | 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> |
|---|
| [34] | 43 | <th>Slots</th> |
|---|
| 44 | <th>Size</th> |
|---|
| 45 | <th>Avail</th> |
|---|
| 46 | <th>Used</th> |
|---|
| 47 | <th>Clear</th> |
|---|
| 48 | <th>Compiling</th> |
|---|
| 49 | <th>Hits</th> |
|---|
| 50 | <th>Misses</th> |
|---|
| [60] | 51 | <th>Clogs</th> |
|---|
| [34] | 52 | <th>OOMs</th> |
|---|
| 53 | <th>Protected</th> |
|---|
| 54 | <th>Cached</th> |
|---|
| 55 | <th>Deleted</th> |
|---|
| 56 | </tr> |
|---|
| 57 | <?php |
|---|
| 58 | $numkeys = explode(',', 'slots,size,avail,hits,misses,clogs,ooms,cached,deleted'); |
|---|
| 59 | foreach ($cacheinfos as $i => $ci) { |
|---|
| 60 | echo " |
|---|
| 61 | <tr ", $a->next(), ">"; |
|---|
| 62 | $ci = number_formats($ci, $numkeys); |
|---|
| 63 | $ci['compiling'] = $ci['type'] == $type_php ? ($ci['compiling'] ? 'yes' : 'no') : '-'; |
|---|
| 64 | $ci['can_readonly'] = $ci['can_readonly'] ? 'yes' : 'no'; |
|---|
| 65 | |
|---|
| 66 | $percent = (int) (($ci['size'] - $ci['avail']) / $ci['size'] * 100); |
|---|
| 67 | echo <<<EOS |
|---|
| 68 | <th>{$ci['cache_name']}</th> |
|---|
| 69 | <td>{$ci['slots']}</td> |
|---|
| 70 | <td>{$ci['size']}</td> |
|---|
| 71 | <td>{$ci['avail']}</td> |
|---|
| 72 | <td><div class="percent"><div style="width: $percent%" class="v"> </div></div></td> |
|---|
| 73 | <td> |
|---|
| 74 | <form method="post"> |
|---|
| 75 | <div> |
|---|
| 76 | <input type="hidden" name="type" value="{$ci['type']}"> |
|---|
| 77 | <input type="hidden" name="cacheid" value="{$ci['cacheid']}"> |
|---|
| 78 | <input type="submit" name="clearcache" value="Clear" class="submit" onclick="return confirm('Sure to clear?');" /> |
|---|
| 79 | </div> |
|---|
| 80 | </form> |
|---|
| 81 | </td> |
|---|
| 82 | <td>{$ci['compiling']}</td> |
|---|
| 83 | <td>{$ci['hits']}</td> |
|---|
| 84 | <td>{$ci['misses']}</td> |
|---|
| 85 | <td>{$ci['clogs']}</td> |
|---|
| 86 | <td>{$ci['ooms']}</td> |
|---|
| 87 | <td>{$ci['can_readonly']}</td> |
|---|
| 88 | <td>{$ci['cached']}</td> |
|---|
| 89 | <td>{$ci['deleted']}</td> |
|---|
| 90 | EOS; |
|---|
| 91 | |
|---|
| 92 | $b->reset(); |
|---|
| 93 | ?> |
|---|
| 94 | </tr> |
|---|
| 95 | <?php } ?> |
|---|
| 96 | </table> |
|---|
| [60] | 97 | Free Blocks: |
|---|
| [34] | 98 | <?php |
|---|
| 99 | foreach ($cacheinfos as $i => $ci) { |
|---|
| [47] | 100 | $b->reset(); |
|---|
| [34] | 101 | ?> |
|---|
| [46] | 102 | <table cellspacing="0" cellpadding="4" class="cycles freeblocks"> |
|---|
| [34] | 103 | <tr> |
|---|
| 104 | <th><?php echo $ci['cache_name']; ?> size<br>offset</th> |
|---|
| 105 | <?php |
|---|
| 106 | foreach ($ci['free_blocks'] as $block) { |
|---|
| 107 | $size = number_format($block['size']); |
|---|
| 108 | $offset = number_format($block['offset']); |
|---|
| 109 | |
|---|
| 110 | $c = $b->next(); |
|---|
| 111 | echo " |
|---|
| 112 | <td $c><nobr>$size<br>$offset</nobr></td>"; |
|---|
| 113 | } |
|---|
| 114 | ?> |
|---|
| 115 | |
|---|
| 116 | </tr> |
|---|
| 117 | </table> |
|---|
| 118 | <?php |
|---|
| 119 | } |
|---|
| 120 | ?> |
|---|
| 121 | <div style="clear: both"> </div> |
|---|
| 122 | <?php |
|---|
| 123 | |
|---|
| 124 | if ($cachelist) { |
|---|
| 125 | $isphp = $cachelist['type'] == $type_php; |
|---|
| 126 | if (function_exists("ob_filter_path_nicer")) { |
|---|
| 127 | ob_start("ob_filter_path_nicer"); |
|---|
| 128 | } |
|---|
| 129 | foreach (array('Cached' => $cachelist['cache_list'], 'Deleted' => $cachelist['deleted_list']) as $listname => $entries) { |
|---|
| 130 | $a->reset(); |
|---|
| 131 | echo " |
|---|
| 132 | <caption>{$cachelist['type_name']} $listname</caption>"; |
|---|
| 133 | ?> |
|---|
| 134 | |
|---|
| [46] | 135 | <table cellspacing="0" cellpadding="4" class="cycles entrys" width="100%"> |
|---|
| [34] | 136 | <col /> |
|---|
| 137 | <col /> |
|---|
| 138 | <col align="right" /> |
|---|
| 139 | <col align="right" /> |
|---|
| 140 | <col align="right" /> |
|---|
| 141 | <col align="right" /> |
|---|
| 142 | <col align="right" /> |
|---|
| 143 | <col align="right" /> |
|---|
| 144 | <?php |
|---|
| 145 | if ($listname == 'Deleted') { |
|---|
| 146 | echo '<col align="right" />'; |
|---|
| 147 | } |
|---|
| 148 | if ($isphp) { |
|---|
| 149 | echo '<col align="right" />'; |
|---|
| 150 | echo '<col align="right" />'; |
|---|
| 151 | echo '<col align="right" />'; |
|---|
| 152 | } |
|---|
| 153 | |
|---|
| 154 | echo " |
|---|
| 155 | <tr ", $a->next(), ">"; |
|---|
| 156 | ?> |
|---|
| 157 | |
|---|
| 158 | <th><a href="javascript:" onclick="resort(this); return false">Cache</a></th> |
|---|
| 159 | <th><a href="javascript:" onclick="resort(this); return false">entry</a></th> |
|---|
| 160 | <th><a href="javascript:" onclick="resort(this); return false">Hits</a></th> |
|---|
| 161 | <th><a href="javascript:" onclick="resort(this); return false">Ref count</a></th> |
|---|
| 162 | <th><a href="javascript:" onclick="resort(this); return false">Size</a></th> |
|---|
| 163 | <?php if ($isphp) { ?> |
|---|
| 164 | <th><a href="javascript:" onclick="resort(this); return false">SrcSize</a></th> |
|---|
| 165 | <th><a href="javascript:" onclick="resort(this); return false">Modify</a></th> |
|---|
| [84] | 166 | <?php if ($haveinode) { ?> |
|---|
| [34] | 167 | <th><a href="javascript:" onclick="resort(this); return false">device</a></th> |
|---|
| 168 | <th><a href="javascript:" onclick="resort(this); return false">inode</a></th> |
|---|
| 169 | <?php } ?> |
|---|
| [84] | 170 | <?php } ?> |
|---|
| [34] | 171 | <th><a href="javascript:" onclick="resort(this); return false">Access</a></th> |
|---|
| 172 | <th><a href="javascript:" onclick="resort(this); return false">Create</a></th> |
|---|
| 173 | <?php if ($listname == 'Deleted') { ?> |
|---|
| 174 | <th><a href="javascript:" onclick="resort(this); return false">Delete</a></th> |
|---|
| 175 | <?php } ?> |
|---|
| 176 | </tr> |
|---|
| 177 | <?php |
|---|
| 178 | foreach ($entries as $i => $entry) { |
|---|
| 179 | echo " |
|---|
| 180 | <tr ", $a->next(), ">"; |
|---|
| 181 | $name = htmlspecialchars($entry['name']); |
|---|
| 182 | $hits = number_format($entry['hits']); |
|---|
| 183 | $refcount = number_format($entry['refcount']); |
|---|
| 184 | $size = size($entry['size']); |
|---|
| 185 | if ($isphp) { |
|---|
| 186 | $sourcesize = size($entry['sourcesize']); |
|---|
| 187 | } |
|---|
| 188 | |
|---|
| 189 | if ($isphp) { |
|---|
| 190 | $mtime = age($entry['mtime']); |
|---|
| 191 | } |
|---|
| 192 | $ctime = age($entry['ctime']); |
|---|
| 193 | $atime = age($entry['atime']); |
|---|
| 194 | $dtime = age($entry['dtime']); |
|---|
| 195 | |
|---|
| 196 | echo <<<ENTRY |
|---|
| 197 | <td>{$entry['cache_name']} {$i}</td> |
|---|
| 198 | <td>{$name}</td> |
|---|
| 199 | <td int="{$entry['hits']}">{$entry['hits']}</td> |
|---|
| 200 | <td int="{$entry['refcount']}">{$entry['refcount']}</td> |
|---|
| 201 | <td int="{$entry['size']}">{$size}</td> |
|---|
| 202 | ENTRY; |
|---|
| 203 | if ($isphp) { |
|---|
| 204 | echo <<<ENTRY |
|---|
| 205 | <td int="{$entry['sourcesize']}">{$sourcesize}</td> |
|---|
| 206 | <td int="{$entry['mtime']}">{$mtime}</td> |
|---|
| 207 | ENTRY; |
|---|
| [84] | 208 | if (isset($entry['inode'])) { |
|---|
| 209 | echo <<<ENTRY |
|---|
| 210 | <td int="{$entry['device']}">{$entry['device']}</td> |
|---|
| 211 | <td int="{$entry['inode']}">{$entry['inode']}</td> |
|---|
| 212 | ENTRY; |
|---|
| 213 | } |
|---|
| [34] | 214 | } |
|---|
| 215 | echo <<<ENTRY |
|---|
| 216 | <td int="{$entry['atime']}">{$atime}</td> |
|---|
| 217 | <td int="{$entry['ctime']}">{$ctime}</td> |
|---|
| 218 | ENTRY; |
|---|
| 219 | if ($listname == 'Deleted') { |
|---|
| 220 | echo <<<ENTRY |
|---|
| 221 | <td int="{$entry['dtime']}">{$dtime}</td> |
|---|
| 222 | ENTRY; |
|---|
| 223 | } |
|---|
| 224 | |
|---|
| 225 | echo " |
|---|
| 226 | </tr> |
|---|
| 227 | "; |
|---|
| 228 | } |
|---|
| 229 | ?> |
|---|
| 230 | |
|---|
| 231 | </table> |
|---|
| 232 | <?php |
|---|
| 233 | } |
|---|
| 234 | if (function_exists("ob_filter_path_nicer")) { |
|---|
| 235 | ob_end_flush(); |
|---|
| 236 | } |
|---|
| 237 | } |
|---|
| 238 | ?> |
|---|
| [107] | 239 | <div class="footnote"> |
|---|
| 240 | <?php echo <<<EOS |
|---|
| 241 | Powered By: {$xcache_version}, {$xcache_modules} |
|---|
| 242 | EOS; |
|---|
| 243 | ?> |
|---|
| 244 | </div> |
|---|
| 245 | |
|---|
| [34] | 246 | </body> |
|---|
| 247 | </html> |
|---|