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