Browse Source

adds xcache.coredump_type, updated ini example

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1182 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
tags/3.0.1-rc1
Xuefer 8 years ago
parent
commit
ad6cbbe3c3
4 changed files with 27 additions and 11 deletions
  1. +10
    -1
      htdocs/diagnosis/index.php
  2. +8
    -6
      xcache-zh-gb2312.ini
  3. +4
    -1
      xcache.c
  4. +5
    -3
      xcache.ini

+ 10
- 1
htdocs/diagnosis/index.php View File

@@ -380,13 +380,22 @@ else {
// }}}
checking(_T("Extension Compatibility")); // {{{
$loadedZendExtensions = get_loaded_extensions(true);
$extensionGood = true;
if (array_search("Zend Optimizer", $loadedZendExtensions) !== false) {
result(N_("info")
, _T("Zend Optimizer loaded")
, _T("Optimizer feature of 'Zend Optimizer' is disabled by XCache due to compatibility reason; the Loader of it is still available, encoded files are still supported")
);
$extensionGood = false;
}
else {
if (array_search("the ionCube PHP Loader", $loadedZendExtensions) !== false) {
result(N_("info")
, _T("the ionCube PHP Loader loaded")
, _T("Compatibility with this the ionCube PHp Loader' is taken care of; But in case if there's any problem, report to ionCube team and/or XCache devs")
);
$extensionGood = false;
}
if (!$extensionGood) {
result(N_("info"), _T("Looks good"));
}
// }}}


+ 8
- 6
xcache-zh-gb2312.ini View File

@@ -15,14 +15,14 @@ xcache.admin.pass = ""
[xcache]
; 这里的多数选项仅在 ini 里可以修改, 这里列出的都是默认值, 除非另外说明

; select low level shm/allocator scheme implemenation
; 选择底层内存共享实现方案
xcache.shm_scheme = "mmap"
; 禁用: xcache.size=0
; 启用: xcache.size=64M 之类 (任意>0的值) 同时请注意您的系统 mmap 上限
xcache.size = 60M
; 建议设置为 cpu 数 (cat /proc/cpuinfo |grep -c processor)
xcache.count = 1
; 只是个参考值, 您可以放心地存储多于此数量的项目(php脚本/变量)
; 只是个 hash 参考值, 实际存储项目(php脚本/变量)可超过这个数字
xcache.slots = 8K
; 缓存项目的 ttl, 0=永久
xcache.ttl = 0
@@ -48,16 +48,18 @@ xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"


; 设置为空(禁用) 或者类似 "/tmp/phpcore/"
; 注意该目录应该能被 php 写入文件 (跟 open_basedir 无关)
; 仅在 XCache 异常时有用. 设置为空(禁用) 或者类似 "/tmp/phpcore/" (能被 php 写入文件)
xcache.coredump_directory = ""
; disable cache after crash
; 仅用于 Windows. 除非 XCache 开发人员告诉你, 否则保持默认值
xcache.coredump_type = 0

; 异常时自动禁止缓存
xcache.disable_on_crash = Off

; 启用实验性功能 (如果有)
xcache.experimental = Off

; per request settings. 可以 ini_set, .htaccess 等
; 以下是 Request 级可改设置. 可以 ini_set, .htaccess 等
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off


+ 4
- 1
xcache.c View File

@@ -36,6 +36,7 @@

/* {{{ globals */
static char *xc_coredump_dir = NULL;
static zend_bool xc_coredump_type = 0;
static zend_bool xc_disable_on_crash = 0;

static zend_compile_file_t *old_compile_file = NULL;
@@ -429,6 +430,7 @@ static LONG WINAPI miniDumperFilter(struct _EXCEPTION_POINTERS *pExceptionInfo)

if (fileHandle != INVALID_HANDLE_VALUE) {
MINIDUMP_EXCEPTION_INFORMATION exceptionInformation;
MINIDUMP_TYPE type = xc_coredump_type ? xc_coredump_type : (MiniDumpNormal|MiniDumpWithDataSegs|MiniDumpWithIndirectlyReferencedMemory);
BOOL ok;

exceptionInformation.ThreadId = GetCurrentThreadId();
@@ -436,7 +438,7 @@ static LONG WINAPI miniDumperFilter(struct _EXCEPTION_POINTERS *pExceptionInfo)
exceptionInformation.ClientPointers = FALSE;

/* write the dump */
ok = dbghelp_MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), fileHandle, MiniDumpNormal|MiniDumpWithDataSegs|MiniDumpWithIndirectlyReferencedMemory, &exceptionInformation, NULL, NULL);
ok = dbghelp_MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), fileHandle, type, &exceptionInformation, NULL, NULL);
CloseHandle(fileHandle);
if (ok) {
zend_error(E_ERROR, "Saved dump file to '%s'", crash_dumpPath);
@@ -718,6 +720,7 @@ static zend_extension xc_zend_extension_entry = {
/* {{{ PHP_INI */
PHP_INI_BEGIN()
PHP_INI_ENTRY1 ("xcache.coredump_directory", "", PHP_INI_SYSTEM, xcache_OnUpdateString, &xc_coredump_dir)
PHP_INI_ENTRY1 ("xcache.coredump_type", "0", PHP_INI_SYSTEM, xcache_OnUpdateULong, &xc_coredump_type)
PHP_INI_ENTRY1_EX ("xcache.disable_on_crash", "0", PHP_INI_SYSTEM, xcache_OnUpdateBool, &xc_disable_on_crash, zend_ini_boolean_displayer_cb)
PHP_INI_ENTRY1_EX ("xcache.test", "0", PHP_INI_SYSTEM, xcache_OnUpdateBool, &xc_test, zend_ini_boolean_displayer_cb)
STD_PHP_INI_BOOLEAN("xcache.experimental", "0", PHP_INI_ALL, OnUpdateBool, experimental, zend_xcache_globals, xcache_globals)


+ 5
- 3
xcache.ini View File

@@ -15,7 +15,7 @@ xcache.admin.pass = ""
[xcache]
; ini only settings, all the values here is default unless explained

; select low level shm/allocator scheme implemenation
; select low level shm implemenation
xcache.shm_scheme = "mmap"
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
@@ -54,9 +54,11 @@ xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"


; leave it blank(disabled) or "/tmp/phpcore/"
; make sure it's writable by php (open_basedir is not checked)
; Useful when XCache crash. leave it blank(disabled) or "/tmp/phpcore/" (writable by php)
xcache.coredump_directory = ""
; Windows only. leave it as 0 (default) until you're told by XCache dev
xcache.coredump_type = 0

; disable cache after crash
xcache.disable_on_crash = Off



Loading…
Cancel
Save