Browse Source

closes #8, simple docs for admin pages

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@60 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.1
Xuefer 15 years ago
parent
commit
7e0b3b0ea8
  1. 69
      admin/help.php
  2. 1
      admin/xcache.css
  3. 4
      admin/xcache.php
  4. 8
      admin/xcache.tpl.php

69
admin/help.php

@ -0,0 +1,69 @@
<?php
$charset = "UTF-8";
if (file_exists("./config.php")) {
include("./config.php");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Language" content="en-us" />
<?php
echo <<<HEAD
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
<script type="text/javascript" src="tablesort.js" charset="$charset"></script>
HEAD;
?>
<link rel="stylesheet" type="text/css" href="xcache.css" />
<title>XCache Administration Help</title>
<script>
function toggle(o)
{
o.style.display = o.style.display != 'block' ? 'block' : 'none';
}
</script>
</head>
<body>
<h1>XCache Administration Help</h1>
<a href="javascript:" onclick="toggle(document.getElementById('help'));return false" style="display:block; float: right">Help</a>
<div id1="help">
<h2>Cache Legends</h2>
<pre>
<b>Slots: </b>Number of hash slots. the setting from your php.ini
<b>Size: </b>Cache Size, Size of the cache (or cache chunk), in bytes
<b>Avail: </b>Available Memory, free memory in bytes of this cache
<b>Used: </b>Used Percent, A bar shows how much memory used in percent
<b>Clear: </b>Clear Button, Press the button to clean this cache
<b>Compiling: </b>Compiling flag, "yes" if the cache is busy compiling php script
<b>Hits: </b>Cache Hits, hit=a var/php is loaded from this cache
<b>Misses: </b>Cache Misses, miss=a var/php is requested but not in the cache
<b>CLogs: </b>Compiling Clogs, clog=compiling is needed but avoided to wait(be blocked)
for the cache busy compiling
<b>OOMs: </b>Out Of Memory, how many times a new item should be stored but there isn't
enough memory in the cache, think of increasing the xcache.size or xcache.var_size
<b>Protected: </b>Whether readonly_protection is available and enable on this cache
<b>Cached: </b>Number of entries stored in this cache
<b>Deleted: </b>Number of entries is pending in delete list (expired but referenced)
<b>Free Blocks:</b>Free blocks list in the specified cache
</pre>
<h2>List Legends</h2>
<pre>
<b>entry: </b>The entry name or filename
<b>Hits: </b>Times this entry is hit (loaded from this cache)
<b>Refcount: </b>Reference count this entry is holded by a php request
<b>Size: </b>Size in bytes of this entry in the cache
<b>SrcSize: </b>Size of the source file
<b>Modify: </b>Last modified time of the source file
<b>device: </b>device number of the source file
<b>inode: </b>inode number of the source file
<b>Access: </b>Last access time of the cached entry
<b>Create: </b>The time when this entry is stored
</pre>
</div>
See also: <a href="http://trac.lighttpd.net/xcache/wiki/PhpIni">setting php.ini for XCache</a> in the <a href="http://trac.lighttpd.net/xcache/">XCache wiki</a>
</body>
</html>

1
admin/xcache.css

@ -14,3 +14,4 @@ form {margin: 0; padding: 0}
.switcher, h1 { text-align: center; display: block; }
.switcher * { color: blue; }
.switcher a.active { font-weight: bold; font-size: 130%; color: black; }
#help { display: block; float: right; }

4
admin/xcache.php

@ -63,12 +63,12 @@ function age($time)
}
static $seconds = array(1, 60, 3600, 86400, 604800, 2678400, 31536000);
static $name = array('sec', 'min', 'hr', 'day', 'week', 'month', 'year');
static $name = array('s', 'm', 'h', 'd', 'w', 'M', 'Y');
for ($i = 6; $i >= 0; $i --) {
if ($delta >= $seconds[$i]) {
$ret = (int) ($delta / $seconds[$i]);
return $ret . ' ' . $name[$i] . ($ret > 1 ? 's' : '');
return $ret . ' ' . $name[$i];
}
}
}

8
admin/xcache.tpl.php

@ -15,11 +15,13 @@ HEAD;
<body>
<h1>XCache Administration</h1>
<a href="help.php" target="_blank" id="help">Help &raquo;</a>
<span class="switcher"><?php echo switcher("type", $types); ?></span>
<?php
$a = new Cycle('class="col1"', 'class="col2"');
$b = new Cycle('class="col1"', 'class="col2"');
?>
Caches:
<table cellspacing="0" cellpadding="4" class="cycles">
<col />
<col align="right" />
@ -46,12 +48,11 @@ $b = new Cycle('class="col1"', 'class="col2"');
<th>Compiling</th>
<th>Hits</th>
<th>Misses</th>
<th>CLogs</th>
<th>Clogs</th>
<th>OOMs</th>
<th>Protected</th>
<th>Cached</th>
<th>Deleted</th>
<th>Blocks</th>
</tr>
<?php
$numkeys = explode(',', 'slots,size,avail,hits,misses,clogs,ooms,cached,deleted');
@ -86,15 +87,14 @@ $b = new Cycle('class="col1"', 'class="col2"');
<td>{$ci['can_readonly']}</td>
<td>{$ci['cached']}</td>
<td>{$ci['deleted']}</td>
<td>
EOS;
$b->reset();
?>
</td>
</tr>
<?php } ?>
</table>
Free Blocks:
<?php
foreach ($cacheinfos as $i => $ci) {
$b->reset();

Loading…
Cancel
Save