diff --git a/admin/common-en.lang.php b/admin/common-en.lang.php new file mode 100644 index 0000000..64786a9 --- /dev/null +++ b/admin/common-en.lang.php @@ -0,0 +1,5 @@ + diff --git a/admin/common-zh-simplified-utf-8.lang.php b/admin/common-zh-simplified-utf-8.lang.php new file mode 100644 index 0000000..7aa78c4 --- /dev/null +++ b/admin/common-zh-simplified-utf-8.lang.php @@ -0,0 +1,102 @@ + 'Cache 帮助', + 'List Legends' + => 'List 帮助', + 'XCache Administration Help' + => 'XCache 管理页面帮助信息', + 'Help' + => '帮助', + 'Slots' + => '槽', + 'Size' + => '大小', + 'Avail' + => '剩余', + 'Used' + => '已用', + 'Clear' + => '清除', + 'Sure to clear?' + => '确认要清除吗?', + 'Compiling' + => '编译中', + '%' + => '%', + 'Hits' + => '命中', + 'Misses' + => '错过', + 'Clogs' + => '阻塞', + 'OOMs' + => '内存不足', + 'Protected' + => '保护', + 'Cached' + => '缓存', + 'Deleted' + => '待删', + 'Delete' + => '删除', + 'Free Blocks' + => '空闲块', + + 'entry' + => '项目', + 'Refcount' + => '引用数', + 'SrcSize' + => '源大小', + 'Modify' + => '修改', + 'device' + => '设备', + 'inode' + => 'Inode', + 'Access' + => '访问', + 'Create' + => '创建', + 'See also' + => '建议参考', + 'GC' + => 'GC', + 'Cache' + => '缓冲区', + 'Caches' + => '缓冲区', + 'Cached' + => '缓冲', + 'php Cached' + => '缓冲的 php 脚本', + 'php Deleted' + => '待删 php 脚本', + 'var Cached' + => '缓冲的变量', + 'var Deleted' + => '待删变量', + 'Statistics' + => '摘要统计', + 'List PHP' + => '列出PHP', + 'List Var Data' + => '列变量数据', + 'XCache %s Administration' + => 'XCache %s 管理页面', + 'size' + => '大小', + 'offset' + => '位置', + '' + => '', + '' + => '', + '' + => '', + '' + => '', + ); + diff --git a/admin/common.php b/admin/common.php new file mode 100644 index 0000000..46d5269 --- /dev/null +++ b/admin/common.php @@ -0,0 +1,70 @@ + 'zh-simplified', + 'zh-hk' => 'zh-traditional', + 'zh-tw' => 'zh-traditional', + ); + + if (isset($map[$l])) { + $l = $map[$l]; + } + if (file_exists($file = "$name-$l-$s.lang.php")) { + return $file; + } + if (file_exists($file = "$name-$l.lang.php")) { + return $file; + } + return null; +} + +function get_language_file($name) +{ + global $charset, $lang; + $s = strtolower($charset); + if (isset($lang)) { + $file = get_language_file_ex($name, strtolower($lang), $s); + } + else if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + foreach (explode(',', str_replace(' ', '', $_SERVER['HTTP_ACCEPT_LANGUAGE'])) as $l) { + $l = strtok($l, ';'); + $file = get_language_file_ex($name, $l, $s); + if (isset($file)) { + break; + } + if (strpos($l, '-') !== false) { + $l = strtok($l, '-'); + $file = get_language_file_ex($name, $l, $s); + if (isset($file)) { + break; + } + } + } + } + return isset($file) ? $file : "$name-en.lang.php"; +} + +function _T($str) +{ + if (isset($GLOBALS['strings'][$str])) { + return $GLOBALS['strings'][$str]; + } + if (!empty($GLOBALS['show_todo_strings'])) { + return '' . htmlspecialchars($str) . ''; + } + return $str; +} + +error_reporting(E_ALL); +define('REQUEST_TIME', time()); + +$charset = "UTF-8"; +if (file_exists("./config.php")) { + include("./config.php"); +} + +include(get_language_file("common")); + +?> diff --git a/admin/config.php.example b/admin/config.php.example index 79d7b54..0ff88ad 100644 --- a/admin/config.php.example +++ b/admin/config.php.example @@ -3,12 +3,19 @@ // this is an example only // write your own config and name it as config.php +// detected by browser +// $lang = 'en-us'; + $charset = "UTF-8"; +// developers only +$show_todo_strings = false; + // this function is detected by xcache.tpl.php, and enabled if function_exists // this ob filter is applied for the cache list, not the whole page function ob_filter_path_nicer($o) { + $o = str_replace($_SERVER['DOCUMENT_ROOT'], "{DOCROOT}/", $o); $o = str_replace("/home/", "{H}/", $o); return $o; } diff --git a/admin/help-en.lang.php b/admin/help-en.lang.php new file mode 100644 index 0000000..1ac0c6c --- /dev/null +++ b/admin/help-en.lang.php @@ -0,0 +1,32 @@ +

+
+
:
Number of hash slots. the setting from your php.ini
+
:
Cache Size, Size of the cache (or cache chunk), in bytes
+
:
Available Memory, free memory in bytes of this cache
+
:
Percent, A bar shows how much memory available in percent
+
:
Clear Button, Press the button to clean this cache
+
:
Compiling flag, "yes" if the cache is busy compiling php script
+
:
Cache Hits, hit=a var/php is loaded from this cache
+
:
Cache Misses, miss=a var/php is requested but not in the cache
+
:
Compiling Clogs, clog=compiling is needed but avoided to wait(be blocked) when the cache is busy compiling already
+
:
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
+
:
Whether readonly_protection is available and enable on this cache
+
:
Number of entries stored in this cache
+
:
Number of entries is pending in delete list (expired but referenced)
+
:
Seconds count down of Garbage Collection
+
:
Free blocks list in the specified cache
+
+ +

+
+
:
The entry name or filename
+
:
Times this entry is hit (loaded from this cache)
+
:
Reference count this entry is holded by a php request
+
:
Size in bytes of this entry in the cache
+
:
Size of the source file
+
:
Last modified time of the source file
+
:
device number of the source file
+
:
inode number of the source file
+
:
Last access time of the cached entry
+
:
The time when this entry is stored
+
diff --git a/admin/help-zh-simplified-utf-8.lang.php b/admin/help-zh-simplified-utf-8.lang.php new file mode 100644 index 0000000..018b298 --- /dev/null +++ b/admin/help-zh-simplified-utf-8.lang.php @@ -0,0 +1,32 @@ +

+
+
:
Hash 槽个数, 对应 php.ini 里的设置
+
:
共享内存区大小, 单位: 字节
+
:
可用内存, 对应共享内存区的剩余内存字节数
+
:
百分比, 条状显示可用内存的比例
+
:
清除按钮, 点击按钮清除对应共享内存区的数据
+
:
编译标记, 当共享内存区正在编译 php 脚本时标记为 "yes"
+
:
共享内存命中次数, 命中=从该共享内存载入php或者变量
+
:
共享内存错过次数, 错过=请求的php或者变量并不在该共享内存内
+
:
编译阻塞跳过, 阻塞=当需该共享内存区负责编译时, 其他进程/现成无法访问此共享内存. 跳过=XCache 自动判断阻塞的共享内存区自动跳过阻塞等待, 直接使用非共享内存方式继续处理请求
+
:
内存不足次数, 显示需要存储新数据但是共享内存区内存不足的次数. 如果出现太频繁请考虑加大配置中的 xcache.size 或者 xcache.var_size
+
:
显示该 Cache 是否支持并启用 readonly_protection
+
:
共享内存于该共享内存区的项目条数
+
:
共享内存区内将要删除的项目 (已经删除但是还被某些进程占用)
+
:
垃圾回收的倒计时
+
:
共享内存区内的空闲内存块
+
+ +

+
+
:
项目名或者文件名
+
:
该项目被命中的次数 (从共享内存区载入)
+
:
项目依然被其他进程占据的引用次数
+
:
项目在共享内存里占用字节数
+
:
源文件大小
+
:
源文件最后修改时间
+
:
源文件所在设备ID
+
:
源文件的inode
+
:
最后访问该项目的时间
+
:
该项目被创建于共享内的时间
+
diff --git a/admin/help.php b/admin/help.php index ec97f7b..2e317d2 100644 --- a/admin/help.php +++ b/admin/help.php @@ -1,8 +1,5 @@ @@ -11,12 +8,13 @@ if (file_exists("./config.php")) { + HEAD; ?> - XCache Administration Help + <?php echo _T('XCache Administration Help'); ?>