Changes of Revision 12
[-] | Changed | php-xcache.changes |
1
2 ------------------------------------------------------------------- 3 +Sun Jan 13 10:00:51 UTC 2013 - cs@linux-administrator.com 4 + 5 +- update to version 3.0.1 6 + 7 +------------------------------------------------------------------- 8 Sun Nov 25 11:38:20 UTC 2012 - cs@linux-administrator.com 9 10 - update to version 3.0.0 11 |
||
[-] | Changed | php-xcache.spec ^ |
10 1
2 %define default_apiver 20041225 3 %define default_version 5.2.6 4 5 -%define module_version 3.0.0 6 +%define module_version 3.0.1 7 8 %define php_extdir %(php-config --extension-dir 2>/dev/null || echo %{default_extdir}) 9 %{!?php_version:%define php_version %(php-config --version 2>/dev/null || echo %{default_version})} 10 |
||
[+] | Changed | xcache-3.0.1.tar.bz2/COPYING ^ |
@@ -1,6 +1,6 @@ -Copyright (c) 2005-2009, mOo, phpxcache@gmail.com, XCache +Copyright (c) 2005-2012, mOo, phpxcache@gmail.com, XCache All rights reserved. Redistribution and use in source and binary forms, with or without | ||
[+] | Changed | xcache-3.0.1.tar.bz2/ChangeLog ^ |
@@ -1,3 +1,16 @@ +3.0.1 2013-01-11 +ChangeLog +======== + * fixes crash when cache is too small on start up + * fixes #295: crash using traits with PHP 5.4.8+ + * fixes #290: workaround phpize vs fbsd make bug again + * improve compatibility with "the ionCube PHP Loader", Zend Optimizer + * fix random crash when cache is reinitialized yet failed (Thanks to Brad Baker for generating crash dump) + * fix locking impl: improve stability on threaded env (Thanks to Mircea Nicolae for reproducing the bug) + * diagnosis: undefined variable when ini is not found + * PHP_5_4 optimizer: fix ZEND_JMP_SET_VAR + * PHP_5_4 optimizer: fix for goto + 3.0.0 2012-10-29 API Changes ======== @@ -12,6 +25,8 @@ * new: xcache.coverager_autostart = On * new: xcache.allocator = bestfit (no other option value yet) * new: xcache.var_allocator = bestfit (no other option value yet) + * new: xcache.var_namespace_mode = 0 + * new: xcache.var_namespace = "" ChangeLog ======== | ||
[+] | Changed | xcache-3.0.1.tar.bz2/Makefile.frag.deps ^ |
@@ -1,25 +1,25 @@ -$(XCACHE_INCLUDES_I) $(builddir)/includes.lo: $(srcdir)/mod_cacher/xc_cache.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h -$(builddir)/mod_assembler/xc_assembler.lo: -$(builddir)/mod_cacher/xc_cacher.lo: $(srcdir)/mod_cacher/xc_cache.h $(srcdir)/mod_cacher/xc_cacher.h $(srcdir)/util/xc_align.h $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h $(srcdir)/util/xc_vector.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_extension.h $(srcdir)/xcache/xc_ini.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_sandbox.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h $(XCACHE_PROC_H) -$(builddir)/mod_coverager/xc_coverager.lo: $(srcdir)/mod_coverager/xc_coverager.h $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_extension.h $(srcdir)/xcache/xc_ini.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h -$(builddir)/mod_decoder/xc_decoder.lo: -$(builddir)/mod_disassembler/xc_disassembler.lo: $(srcdir)/mod_cacher/xc_cache.h $(srcdir)/mod_disassembler/xc_disassembler.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_ini.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_sandbox.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h $(XCACHE_PROC_H) -$(builddir)/mod_encoder/xc_encoder.lo: -$(builddir)/mod_optimizer/xc_optimizer.lo: $(srcdir)/mod_optimizer/xc_optimizer.h $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_extension.h $(srcdir)/xcache/xc_ini.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h -$(builddir)/util/xc_stack.lo: $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h -$(builddir)/util/xc_trace.lo: $(srcdir)/util/xc_trace.h -$(builddir)/xcache.lo: $(srcdir)/util/xc_foreachcoresig.h $(srcdir)/util/xc_stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_const_string.h $(srcdir)/xcache/xc_extension.h $(srcdir)/xcache/xc_ini.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_opcode_spec.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h -$(builddir)/xcache/xc_allocator_bestfit.lo: $(srcdir)/util/xc_align.h $(srcdir)/util/xc_trace.h $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_shm.h -$(builddir)/xcache/xc_allocator.lo: $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_shm.h -$(builddir)/xcache/xc_compatibility.lo: $(srcdir)/xcache/xc_compatibility.h -$(builddir)/xcache/xc_const_string.lo: $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_const_string.h $(srcdir)/xcache/xc_const_string_opcodes_php5.4.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h -$(builddir)/xcache/xc_extension.lo: $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_extension.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h -$(builddir)/xcache/xc_ini.lo: $(srcdir)/xcache/xc_ini.h -$(builddir)/xcache/xc_lock.lo: $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h -$(builddir)/xcache/xc_malloc.lo: $(srcdir)/util/xc_align.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h -$(builddir)/xcache/xc_opcode_spec.lo: $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_const_string.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_opcode_spec_def.h $(srcdir)/xcache/xc_opcode_spec.h $(srcdir)/xcache/xc_shm.h -$(builddir)/xcache/xc_processor.lo: $(srcdir)/mod_cacher/xc_cache.h $(srcdir)/util/xc_align.h $(srcdir)/util/xc_stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_const_string.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h $(XCACHE_PROC_C) $(XCACHE_PROC_H) -$(builddir)/xcache/xc_sandbox.lo: $(srcdir)/util/xc_stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_sandbox.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h -$(builddir)/xcache/xc_shm.lo: $(srcdir)/xcache/xc_shm.h -$(builddir)/xcache/xc_shm_mmap.lo: $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h -$(builddir)/xcache/xc_utils.lo: $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_opcode_spec.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h +$(XCACHE_INCLUDES_I) includes.lo $(builddir)/includes.lo: $(srcdir)/mod_cacher/xc_cache.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h +mod_assembler/xc_assembler.lo $(builddir)/mod_assembler/xc_assembler.lo: +mod_cacher/xc_cacher.lo $(builddir)/mod_cacher/xc_cacher.lo: $(srcdir)/mod_cacher/xc_cache.h $(srcdir)/mod_cacher/xc_cacher.h $(srcdir)/util/xc_align.h $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h $(srcdir)/util/xc_vector.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_extension.h $(srcdir)/xcache/xc_ini.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_sandbox.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h $(XCACHE_PROC_H) +mod_coverager/xc_coverager.lo $(builddir)/mod_coverager/xc_coverager.lo: $(srcdir)/mod_coverager/xc_coverager.h $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_extension.h $(srcdir)/xcache/xc_ini.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h +mod_decoder/xc_decoder.lo $(builddir)/mod_decoder/xc_decoder.lo: +mod_disassembler/xc_disassembler.lo $(builddir)/mod_disassembler/xc_disassembler.lo: $(srcdir)/mod_cacher/xc_cache.h $(srcdir)/mod_disassembler/xc_disassembler.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_ini.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_sandbox.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h $(XCACHE_PROC_H) +mod_encoder/xc_encoder.lo $(builddir)/mod_encoder/xc_encoder.lo: +mod_optimizer/xc_optimizer.lo $(builddir)/mod_optimizer/xc_optimizer.lo: $(srcdir)/mod_optimizer/xc_optimizer.h $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_extension.h $(srcdir)/xcache/xc_ini.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h +util/xc_stack.lo $(builddir)/util/xc_stack.lo: $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h +util/xc_trace.lo $(builddir)/util/xc_trace.lo: $(srcdir)/util/xc_trace.h +xcache.lo $(builddir)/xcache.lo: $(srcdir)/util/xc_foreachcoresig.h $(srcdir)/util/xc_stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_const_string.h $(srcdir)/xcache/xc_extension.h $(srcdir)/xcache/xc_ini.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_opcode_spec.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h +xcache/xc_allocator_bestfit.lo $(builddir)/xcache/xc_allocator_bestfit.lo: $(srcdir)/util/xc_align.h $(srcdir)/util/xc_trace.h $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_shm.h +xcache/xc_allocator.lo $(builddir)/xcache/xc_allocator.lo: $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_shm.h +xcache/xc_compatibility.lo $(builddir)/xcache/xc_compatibility.lo: $(srcdir)/xcache/xc_compatibility.h +xcache/xc_const_string.lo $(builddir)/xcache/xc_const_string.lo: $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_const_string.h $(srcdir)/xcache/xc_const_string_opcodes_php5.4.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h +xcache/xc_extension.lo $(builddir)/xcache/xc_extension.lo: $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_extension.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h +xcache/xc_ini.lo $(builddir)/xcache/xc_ini.lo: $(srcdir)/xcache/xc_ini.h +xcache/xc_lock.lo $(builddir)/xcache/xc_lock.lo: $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h +xcache/xc_malloc.lo $(builddir)/xcache/xc_malloc.lo: $(srcdir)/util/xc_align.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h +xcache/xc_opcode_spec.lo $(builddir)/xcache/xc_opcode_spec.lo: $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_const_string.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_opcode_spec_def.h $(srcdir)/xcache/xc_opcode_spec.h $(srcdir)/xcache/xc_shm.h +xcache/xc_processor.lo $(builddir)/xcache/xc_processor.lo: $(srcdir)/mod_cacher/xc_cache.h $(srcdir)/util/xc_align.h $(srcdir)/util/xc_stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_allocator.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_const_string.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h $(XCACHE_PROC_C) $(XCACHE_PROC_H) +xcache/xc_sandbox.lo $(builddir)/xcache/xc_sandbox.lo: $(srcdir)/util/xc_stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_sandbox.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h +xcache/xc_shm.lo $(builddir)/xcache/xc_shm.lo: $(srcdir)/xcache/xc_shm.h +xcache/xc_shm_mmap.lo $(builddir)/xcache/xc_shm_mmap.lo: $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h +xcache/xc_utils.lo $(builddir)/xcache/xc_utils.lo: $(srcdir)/util/xc_stack.h $(srcdir)/util/xc_trace.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.h $(srcdir)/xcache/xc_compatibility.h $(srcdir)/xcache/xc_lock.h $(srcdir)/xcache/xc_opcode_spec.h $(srcdir)/xcache/xc_shm.h $(srcdir)/xcache/xc_utils.h | ||
[+] | Changed | xcache-3.0.1.tar.bz2/NEWS ^ |
@@ -1,3 +1,11 @@ +3.0.1 2013-01-11 +======== + * bug fixes + * improve compatibility with "the ionCube PHP Loader", Zend Optimizer + * improve stability + * improve support for PHP_5_4 + * improve stability on threaded env + 3.0.0 2012-10-29 ======== * lots of improvements | ||
[+] | Changed | xcache-3.0.1.tar.bz2/devel/prepare.mak ^ |
@@ -89,11 +89,11 @@ ifeq (${PHP_DEVEL_DIR},) tags: - echo "* Making tags without php source files" + @echo "* Making tags without php source files" "$(CTAGS)" -R . else tags: - echo "* Making tags with ${PHP_DEVEL_DIR}" + @echo "* Making tags with ${PHP_DEVEL_DIR}" "$(CTAGS)" -R . "${PHP_DEVEL_DIR}/main" "${PHP_DEVEL_DIR}/Zend" "${PHP_DEVEL_DIR}/TSRM" "${PHP_DEVEL_DIR}/ext/standard" endif | ||
[+] | Changed | xcache-3.0.1.tar.bz2/devel/run ^ |
@@ -82,7 +82,7 @@ echo '$(XCACHE_INCLUDES_I)' ;; esac - echo '$(builddir)/'${sourceFile%.c}.lo: + echo ${sourceFile%.c}.lo '$(builddir)/'${sourceFile%.c}.lo: hiecho "Checking $sourceFile ..." >&2 for dependency in $(gcc -MM $sourceFile -I$HOME/test/php5-debug-zts/include/php/{,main,Zend,TSRM} -I. -I${builddir} -MG | sed 's#.*:##g' | sed 's#\\##g'); do dependency=$(readlink -f "$dependency") @@ -141,7 +141,7 @@ case "$basename" in *-*) # in build dir, starts from src dir - dirs="$basename" + dirs="${basename#*-}" xcachesrcdir=../${basename%%-*} cd $xcachesrcdir ;; @@ -170,7 +170,7 @@ esac phpize --clean \ && phpize \ - && CFLAGS="-g -O0 $pedanti -Wno-variadic-macros -Wno-long-long -Wall -Wno-unused-parameter -Wno-unused-function -W -Wshadow -Werror=implicit-function-declaration -std=c89 -D_GNU_SOURCE -D_POSIX_SOURCE -Dinline=" ./configure \ + && CFLAGS="-g -O0 $pedantic -Wno-variadic-macros -Wno-long-long -Wall -Wno-unused-parameter -Wno-unused-function -W -Wshadow -Werror=implicit-function-declaration -Wconversion -std=c89 -D_GNU_SOURCE -D_POSIX_SOURCE -Dinline=" ./configure \ --enable-xcache-cacher \ --enable-xcache-optimizer \ --enable-xcache-encoder \ @@ -214,9 +214,10 @@ esac rm -f php-src - find -L . -type l | xargs rm -fv + find -L . -type d -print0 | xargs -0 rmdir -p 2>/dev/null || true + find -L . -type l -print0 | xargs -0 rm -fv lndir "$xcachesrcdir" >/dev/null || true - find . -iname .\*.swp | xargs rm -f + find . -iname .\*.swp -print0 | xargs -0 rm -f ln -snf ~/src/php/$phpbasename php-src for i in ~/src/php/$phpbasename/sapi/cgi/php{,-cgi}; do if [[ -r $i ]]; then @@ -300,7 +301,7 @@ esac # pick sapi {{{1 - case "$basename" in + case "$phpbasename" in *-apache1*) cmd=($HOME/apache1/bin/httpd -X) ;; @@ -350,8 +351,8 @@ } for phpbasename in "${dirs[@]}"; do - mkdir -p ../${basename}-${phpbasename} - cd ../${basename}-${phpbasename} || exit + mkdir -p ${xcachesrcdir}-${phpbasename} + cd ${xcachesrcdir}-${phpbasename} || exit lndir ${xcachesrcdir} >/dev/null || true pwd | ||
[+] | Changed | xcache-3.0.1.tar.bz2/htdocs/diagnosis/index.php ^ |
@@ -64,10 +64,10 @@ $loadedIni = ''; $iniDirectory = ''; if (preg_match('!<td class="v">(.*?\\.ini)!', $info, $m)) { - $loadedIni = $m[1]; + $loadedIni = trim($m[1]); } else if (preg_match('!Configuration File \\(php.ini\\) Path *</td><td class="v">([^<]+)!', $info, $m)) { - $iniDirectory = $m[1]; + $iniDirectory = trim($m[1]); } return array($loadedIni, $iniDirectory, $iniInfo); } @@ -80,7 +80,7 @@ if ($loadedIni) { echo sprintf(_T("Add extension=xcache.so (or xcache.dll) in %s"), $loadedIni); } - else if (preg_match('!Configuration File \\(php.ini\\) Path *</td><td class="v">([^<]+)!', $info, $m)) { + else if ($iniDirectory) { echo sprintf(_T("Please put a php.ini in %s and add extension=xcache.so (or xcache.dll) in it"), $iniDirectory); } else { @@ -150,8 +150,8 @@ } else if ($errors) { result(N_("warning") - , _T("Error happened when compiling at least one of your PHP code") - , _T("This usually means there is syntax error in your PHP code. Enable PHP error_log to see what parser error is it, fix your code") + , _T("Error happened when compiling one or some of your PHP code") + , _T("PHP code failed to be compiled cannot be cached. This usually means there was syntax error in your PHP code. Enable PHP error_log to see what parser error is it, fix your code. This warning won't go away until PHP is restarted") ); } else { @@ -180,9 +180,9 @@ result(N_("skipped"), "XCache not loaded"); } else if (!ini_get("xcache.var_size")) { - result(N_("error") + result(N_("warning") , _T("Not enabled") - , _T("PHP code that use XCache caching backend have to use other caching backend instead. Set xcache.var_size to non-zero") + , _T("PHP code that use XCache caching backend have to use other caching backend instead. Set xcache.var_size to non-zero if you have any PHP code that can use XCache Data Caching API") ); } else { @@ -217,35 +217,40 @@ } // }}} checking(_T("Hash Slots")); // {{{ -$slotsTooBig = null; -$slotsTooSmall = null; -foreach ($cacheInfos as $cacheInfo) { - if ($cacheInfo['size'] < '1024000' && $cacheInfo['slots'] >= '8192') { - $slotsTooBig = $cacheInfo['type']; - break; - } - if ($cacheInfo['slots'] < $cacheInfo['cached'] / 2) { - $slotsTooSmall = $cacheInfo['type']; - break; - } -} -if (isset($slotsTooBig)) { - $prefix = $slotsTooBig == XC_TYPE_PHP ? '' : 'var_'; - result(N_("warning") - , _T("Slots value too big") - , sprintf(_T("A very small value is set to %s value and leave %s value is too big.\n" - . "Decrease %s if small cache is really what you want"), "xcache.{$prefix}size", "xcache.{$prefix}slots", "xcache.{$prefix}slots") - ); -} -else if (isset($slotsTooSmall)) { - $prefix = $slotsTooSmall == XC_TYPE_PHP ? '' : 'var_'; - result(N_("warning") - , _T("Slots value too small") - , sprintf(_T("So many item are cached. Increase %s to a more proper value"), "xcache.{$prefix}slots") - ); +if (!$xcacheLoaded) { + result(N_("skipped"), "XCache not loaded"); } else { - result(N_("info"), _T('Looks good')); + $slotsTooBig = null; + $slotsTooSmall = null; + foreach ($cacheInfos as $cacheInfo) { + if ($cacheInfo['size'] < '1024000' && $cacheInfo['slots'] >= '8192') { + $slotsTooBig = $cacheInfo['type']; + break; + } + if ($cacheInfo['slots'] < $cacheInfo['cached'] / 2) { + $slotsTooSmall = $cacheInfo['type']; + break; + } + } + if (isset($slotsTooBig)) { + $prefix = $slotsTooBig == XC_TYPE_PHP ? '' : 'var_'; + result(N_("warning") + , _T("Slots value too big") + , sprintf(_T("A very small value is set to %s value and leave %s value is too big.\n" + . "Decrease %s if small cache is really what you want"), "xcache.{$prefix}size", "xcache.{$prefix}slots", "xcache.{$prefix}slots") + ); + } + else if (isset($slotsTooSmall)) { + $prefix = $slotsTooSmall == XC_TYPE_PHP ? '' : 'var_'; + result(N_("warning") + , _T("Slots value too small") + , sprintf(_T("So many item are cached. Increase %s to a more proper value"), "xcache.{$prefix}slots") + ); + } + else { + result(N_("info"), _T('Looks good')); + } } // }}} checking(_T("Cache Status")); // {{{ @@ -375,13 +380,22 @@ // }}} 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")); } // }}} | ||
[+] | Changed | xcache-3.0.1.tar.bz2/htdocs/diagnosis/lang/en.po ^ |
@@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-09-02 00:52+0800\n" +"POT-Creation-Date: 2012-11-20 10:32+0800\n" "Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -54,8 +54,8 @@ msgid "Not loaded" msgstr "" -#: index.php:90 index.php:129 index.php:135 index.php:183 index.php:285 -#: index.php:303 index.php:368 index.php:391 index.php:394 +#: index.php:90 index.php:129 index.php:135 index.php:290 index.php:308 +#: index.php:373 index.php:396 index.php:399 msgid "error" msgstr "" @@ -64,9 +64,9 @@ msgstr "" #: index.php:93 index.php:141 index.php:158 index.php:175 index.php:189 -#: index.php:200 index.php:216 index.php:248 index.php:264 index.php:273 -#: index.php:291 index.php:309 index.php:332 index.php:347 index.php:373 -#: index.php:379 index.php:385 index.php:399 +#: index.php:200 index.php:216 index.php:252 index.php:269 index.php:278 +#: index.php:296 index.php:314 index.php:337 index.php:352 index.php:378 +#: index.php:384 index.php:390 index.php:404 msgid "info" msgstr "" @@ -75,12 +75,12 @@ msgstr "" #: index.php:126 index.php:146 index.php:149 index.php:163 index.php:166 -#: index.php:180 index.php:207 index.php:253 index.php:270 index.php:300 -#: index.php:318 index.php:338 +#: index.php:180 index.php:207 index.php:221 index.php:258 index.php:275 +#: index.php:305 index.php:323 index.php:343 msgid "skipped" msgstr "" -#: index.php:130 index.php:184 index.php:274 +#: index.php:130 index.php:184 index.php:279 msgid "Not enabled" msgstr "" @@ -98,7 +98,7 @@ msgid "Your PHP pages is not accelerated by XCache. Set xcache.cacher = On" msgstr "" -#: index.php:141 index.php:189 index.php:292 index.php:310 index.php:342 +#: index.php:141 index.php:189 index.php:297 index.php:315 index.php:347 msgid "Enabled" msgstr "" @@ -106,19 +106,20 @@ msgid "PHP Compile Time Error" msgstr "" -#: index.php:152 index.php:169 index.php:193 index.php:210 index.php:234 -#: index.php:242 index.php:256 index.php:324 index.php:341 +#: index.php:152 index.php:169 index.php:183 index.php:193 index.php:210 +#: index.php:238 index.php:246 index.php:261 index.php:329 index.php:346 msgid "warning" msgstr "" #: index.php:153 -msgid "Error happened when compiling at least one of your PHP code" +msgid "Error happened when compiling one or some of your PHP code" msgstr "" #: index.php:154 msgid "" -"This usually means there is syntax error in your PHP code. Enable PHP " -"error_log to see what parser error is it, fix your code" +"PHP code failed to be compiled cannot be cached. This usually means there " +"was syntax error in your PHP code. Enable PHP error_log to see what parser " +"error is it, fix your code. This warning won't go away until PHP is restarted" msgstr "" #: index.php:158 @@ -139,7 +140,7 @@ "PHP crash/coredump, report to XCache devs" msgstr "" -#: index.php:175 index.php:264 index.php:332 +#: index.php:175 index.php:269 index.php:337 msgid "Idle" msgstr "" @@ -150,7 +151,8 @@ #: index.php:185 msgid "" "PHP code that use XCache caching backend have to use other caching backend " -"instead. Set xcache.var_size to non-zero" +"instead. Set xcache.var_size to non-zero if you have any PHP code that can " +"use XCache Data Caching API" msgstr "" #: index.php:191 @@ -192,108 +194,108 @@ msgid "Hash Slots" msgstr "" -#: index.php:235 +#: index.php:239 msgid "Slots value too big" msgstr "" -#: index.php:236 +#: index.php:240 #, php-format msgid "" "A very small value is set to %s value and leave %s value is too big.\n" "Decrease %s if small cache is really what you want" msgstr "" -#: index.php:243 +#: index.php:247 msgid "Slots value too small" msgstr "" -#: index.php:244 +#: index.php:248 #, php-format msgid "So many item are cached. Increase %s to a more proper value" msgstr "" -#: index.php:248 index.php:373 index.php:385 index.php:399 +#: index.php:252 index.php:378 index.php:390 index.php:404 msgid "Looks good" msgstr "" -#: index.php:251 +#: index.php:256 msgid "Cache Status" msgstr "" -#: index.php:257 +#: index.php:262 msgid "At least one of the caches is disabled. " msgstr "" -#: index.php:258 +#: index.php:263 msgid "Enable the cache." msgstr "" -#: index.php:259 +#: index.php:264 msgid "" "It was disabled by PHP crash/coredump handler or you disabled it manually." msgstr "" -#: index.php:259 +#: index.php:264 msgid "You disabled it manually." msgstr "" -#: index.php:260 +#: index.php:265 msgid "If it was caused by PHP crash/coredump, report to XCache devs" msgstr "" -#: index.php:268 +#: index.php:273 msgid "Coredump Directory" msgstr "" -#: index.php:275 +#: index.php:280 msgid "" "Enable coredump to save debugging information in case when PHP crash. It can " "also be enabled in other module like php-fpm beside XCache" msgstr "" -#: index.php:286 +#: index.php:291 msgid "Core files found:\n" msgstr "" -#: index.php:287 +#: index.php:292 msgid "" "Disable XCache PHP Cacher (set xcache.size=0), remove the core file(s), then " "restart PHP. If core file appears again, report call stack backtrace in the " "core to XCache devs" msgstr "" -#: index.php:293 +#: index.php:298 #, php-format msgid "You can see core files if PHP crash in %s if PHP crash" msgstr "" -#: index.php:298 +#: index.php:303 msgid "Readonly Protection" msgstr "" -#: index.php:304 +#: index.php:309 msgid "Set to enabled but not available" msgstr "" -#: index.php:305 +#: index.php:310 msgid "Use xcache.mmap_path other than /dev/zero" msgstr "" -#: index.php:310 index.php:347 +#: index.php:315 index.php:352 msgid "Disabled" msgstr "" -#: index.php:311 +#: index.php:316 msgid "" "Enable readonly_protection == --performance & ++stability. Disable " "readonly_protection == ++performance & --stability" msgstr "" -#: index.php:316 +#: index.php:321 msgid "XCache modules" msgstr "" -#: index.php:326 +#: index.php:331 msgid "" "Acceptable. Module(s) listed are built into XCache but not for production " "server.\n" @@ -302,54 +304,54 @@ "security." msgstr "" -#: index.php:336 +#: index.php:341 msgid "XCache test setting" msgstr "" -#: index.php:343 +#: index.php:348 msgid "xcache.test is for testing only, not for server. set it to off" msgstr "" -#: index.php:350 +#: index.php:355 msgid "PHP Version" msgstr "" -#: index.php:369 +#: index.php:374 msgid "The version of PHP you're using is known to be unstable: " msgstr "" -#: index.php:370 +#: index.php:375 msgid "Upgrade to new version of PHP" msgstr "" -#: index.php:376 +#: index.php:381 msgid "Extension Compatibility" msgstr "" -#: index.php:380 +#: index.php:385 msgid "Zend Optimizer loaded" msgstr "" -#: index.php:381 +#: index.php:386 msgid "" "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" msgstr "" -#: index.php:388 +#: index.php:393 msgid "SAPI Compatibility" msgstr "" -#: index.php:391 +#: index.php:396 msgid "CGI is not supported" msgstr "" -#: index.php:391 +#: index.php:396 msgid "Use FastCGI or FPM instead" msgstr "" -#: index.php:396 +#: index.php:401 msgid "" "PHP_FCGI_CHILDREN should be >= 1 and use 1 group of parent/childs model. See " "http://xcache.lighttpd.net/wiki/Faq" | ||
[+] | Changed | xcache-3.0.1.tar.bz2/htdocs/diagnosis/lang/zh-simplified.php ^ |
@@ -47,10 +47,10 @@ => "PHP 编译时错误", "warning" => "警告", - "Error happened when compiling at least one of your PHP code" - => "至少在编译其中一个您的 PHP 代码时发生编译错误", - "This usually means there is syntax error in your PHP code. Enable PHP error_log to see what parser error is it, fix your code" - => "这通常意味着您的 PHP 代码有语法错误. 请启用 error_log 调查具体错误原因并修复您的代码", + "Error happened when compiling one or some of your PHP code" + => "至少在编译一个或多个您的 PHP 代码时发生编译错误", + "PHP code failed to be compiled cannot be cached. This usually means there was syntax error in your PHP code. Enable PHP error_log to see what parser error is it, fix your code. This warning won't go away until PHP is restarted" + => "编译失败的 PHP 代码是无法缓存的. 这通常意味着您的 PHP 代码有语法错误. 请启用 error_log 调查具体错误原因并修复您的代码. 重启 PHP 前这个警告不会消失", "No error happened" => "未发生过错误", "Busy Compiling" @@ -63,8 +63,8 @@ => "空闲", "Enabling VAR Cacher" => "启用 VAR 缓存器", - "PHP code that use XCache caching backend have to use other caching backend instead. Set xcache.var_size to non-zero" - => "使用 XCache 作为数据缓存器的 PHP 代码将不得不采用其他缓存器代替. 设置 xcache.var_size 为非 0", + "PHP code that use XCache caching backend have to use other caching backend instead. Set xcache.var_size to non-zero if you have any PHP code that can use XCache Data Caching API" + => "支持使用 XCache 作为数据缓存器的 PHP 代码将不得不采用其他缓存器代替. 如果您有代码支持 XCache 缓存 API 的话, 您可以设置 xcache.var_size 为非 0", "Using VAR Cacher" => "使用 VAR 缓存器", "No variable data cached" @@ -147,5 +147,11 @@ => "由于兼容性问题, 'Zend Optimizer' 的优化器已被 XCache 禁止; 其加载器依然可用, 可继续使用 Zend 加密的文件", "SAPI Compatibility" => "Extension 兼容性", + "CGI is not supported" + => "不支持 CGI", + "Use FastCGI or FPM instead" + => "请改用 FastCGI 或者 FPM", + "PHP_FCGI_CHILDREN should be >= 1 and use 1 group of parent/childs model. See http://xcache.lighttpd.net/wiki/Faq" + => "PHP_FCGI_CHILDREN 应该设为 >= 1 并且使用 1 组单父多子模型. 参见 http://xcache.lighttpd.net/wiki/Faq", ); | ||
[+] | Changed | xcache-3.0.1.tar.bz2/htdocs/diagnosis/lang/zh-simplified.po ^ |
@@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-09-02 00:52+0800\n" +"POT-Creation-Date: 2012-11-20 10:32+0800\n" "Language: zh\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -55,8 +55,8 @@ msgid "Not loaded" msgstr "未载入" -#: index.php:90 index.php:129 index.php:135 index.php:183 index.php:285 -#: index.php:303 index.php:368 index.php:391 index.php:394 +#: index.php:90 index.php:129 index.php:135 index.php:290 index.php:308 +#: index.php:373 index.php:396 index.php:399 msgid "error" msgstr "错误" @@ -65,9 +65,9 @@ msgstr "已载入" #: index.php:93 index.php:141 index.php:158 index.php:175 index.php:189 -#: index.php:200 index.php:216 index.php:248 index.php:264 index.php:273 -#: index.php:291 index.php:309 index.php:332 index.php:347 index.php:373 -#: index.php:379 index.php:385 index.php:399 +#: index.php:200 index.php:216 index.php:252 index.php:269 index.php:278 +#: index.php:296 index.php:314 index.php:337 index.php:352 index.php:378 +#: index.php:384 index.php:390 index.php:404 msgid "info" msgstr "信息" @@ -76,12 +76,12 @@ msgstr "启用 PHP 缓存器" #: index.php:126 index.php:146 index.php:149 index.php:163 index.php:166 -#: index.php:180 index.php:207 index.php:253 index.php:270 index.php:300 -#: index.php:318 index.php:338 +#: index.php:180 index.php:207 index.php:221 index.php:258 index.php:275 +#: index.php:305 index.php:323 index.php:343 msgid "skipped" msgstr "跳过" -#: index.php:130 index.php:184 index.php:274 +#: index.php:130 index.php:184 index.php:279 msgid "Not enabled" msgstr "尚未启用" @@ -101,7 +101,7 @@ msgid "Your PHP pages is not accelerated by XCache. Set xcache.cacher = On" msgstr "XCache 并未对您的 PHP 网页起到加速作用. 设置 xcache.cacher = On" -#: index.php:141 index.php:189 index.php:292 index.php:310 index.php:342 +#: index.php:141 index.php:189 index.php:297 index.php:315 index.php:347 msgid "Enabled" msgstr "已启用" @@ -109,22 +109,23 @@ msgid "PHP Compile Time Error" msgstr "PHP 编译时错误" -#: index.php:152 index.php:169 index.php:193 index.php:210 index.php:234 -#: index.php:242 index.php:256 index.php:324 index.php:341 +#: index.php:152 index.php:169 index.php:183 index.php:193 index.php:210 +#: index.php:238 index.php:246 index.php:261 index.php:329 index.php:346 msgid "warning" msgstr "警告" #: index.php:153 -msgid "Error happened when compiling at least one of your PHP code" -msgstr "至少在编译其中一个您的 PHP 代码时发生编译错误" +msgid "Error happened when compiling one or some of your PHP code" +msgstr "至少在编译一个或多个您的 PHP 代码时发生编译错误" #: index.php:154 msgid "" -"This usually means there is syntax error in your PHP code. Enable PHP " -"error_log to see what parser error is it, fix your code" +"PHP code failed to be compiled cannot be cached. This usually means there " +"was syntax error in your PHP code. Enable PHP error_log to see what parser " +"error is it, fix your code. This warning won't go away until PHP is restarted" msgstr "" -"这通常意味着您的 PHP 代码有语法错误. 请启用 error_log 调查具体错误原因并修复" -"您的代码" +"编译失败的 PHP 代码是无法缓存的. 这通常意味着您的 PHP 代码有语法错误. 请启用 " +"error_log 调查具体错误原因并修复您的代码. 重启 PHP 前这个警告不会消失" #: index.php:158 msgid "No error happened" @@ -146,7 +147,7 @@ "这个状态如果持续不就则无影响. 否则可能标志着 PHP 曾经发生异常退出, 如果是的话" "请报告给 XCache 开发组" -#: index.php:175 index.php:264 index.php:332 +#: index.php:175 index.php:269 index.php:337 msgid "Idle" msgstr "空闲" @@ -155,12 +156,14 @@ msgstr "启用 VAR 缓存器" #: index.php:185 +#, fuzzy msgid "" "PHP code that use XCache caching backend have to use other caching backend " -"instead. Set xcache.var_size to non-zero" +"instead. Set xcache.var_size to non-zero if you have any PHP code that can " +"use XCache Data Caching API" msgstr "" -"使用 XCache 作为数据缓存器的 PHP 代码将不得不采用其他缓存器代替. 设置 xcache." -"var_size 为非 0" +"支持使用 XCache 作为数据缓存器的 PHP 代码将不得不采用其他缓存器代替. 如果您有" +"代码支持 XCache 缓存 API 的话, 您可以设置 xcache.var_size 为非 0" #: index.php:191 msgid "Using VAR Cacher" @@ -204,11 +207,11 @@ msgid "Hash Slots" msgstr "哈希槽" -#: index.php:235 +#: index.php:239 msgid "Slots value too big" msgstr "哈希槽设定太大" -#: index.php:236 +#: index.php:240 #, php-format msgid "" "A very small value is set to %s value and leave %s value is too big.\n" @@ -217,49 +220,49 @@ "设置给 %s 的值很小, 却采用过大的 %s. 如果您的确想要配置占用很少内存的缓存器, " "可减少 %s" -#: index.php:243 +#: index.php:247 msgid "Slots value too small" msgstr "哈希槽设定太小" -#: index.php:244 +#: index.php:248 #, php-format msgid "So many item are cached. Increase %s to a more proper value" msgstr "相当多的项目缓存了. 请适量加大 %s" -#: index.php:248 index.php:373 index.php:385 index.php:399 +#: index.php:252 index.php:378 index.php:390 index.php:404 msgid "Looks good" msgstr "看起来还行" -#: index.php:251 +#: index.php:256 msgid "Cache Status" msgstr "缓存状态" -#: index.php:257 +#: index.php:262 msgid "At least one of the caches is disabled. " msgstr "至少一个缓存器是禁止状态" -#: index.php:258 +#: index.php:263 msgid "Enable the cache." msgstr "启用已禁止的缓存器." -#: index.php:259 +#: index.php:264 msgid "" "It was disabled by PHP crash/coredump handler or you disabled it manually." msgstr "可能是在 PHP 异常退出时自动标记为禁止了, 或者您手工禁止了" -#: index.php:259 +#: index.php:264 msgid "You disabled it manually." msgstr "您手工禁止了" -#: index.php:260 +#: index.php:265 msgid "If it was caused by PHP crash/coredump, report to XCache devs" msgstr "如果是由于 PHP 异常退出造成, 请报告给 XCache 开发组" -#: index.php:268 +#: index.php:273 msgid "Coredump Directory" msgstr "Coredump 目录" -#: index.php:275 +#: index.php:280 msgid "" "Enable coredump to save debugging information in case when PHP crash. It can " "also be enabled in other module like php-fpm beside XCache" @@ -267,11 +270,11 @@ "启用 coredump 设置. 这样万一发生 PHP 异常退出时可保存调试信息. 这个功能也可以" "在其他地方启用, 如 php-fpm" -#: index.php:286 +#: index.php:291 msgid "Core files found:\n" msgstr "发现 core 文件:\n" -#: index.php:287 +#: index.php:292 msgid "" "Disable XCache PHP Cacher (set xcache.size=0), remove the core file(s), then " "restart PHP. If core file appears again, report call stack backtrace in the " @@ -281,28 +284,28 @@ "用 XCache 时不出现 Core, 请从 Core 中取得 call stack back trace 信息报告回 " "XCache 开发组" -#: index.php:293 +#: index.php:298 #, php-format msgid "You can see core files if PHP crash in %s if PHP crash" msgstr "如果 PHP 异常退出, 您可以在 %s 目录看到 Core 文件" -#: index.php:298 +#: index.php:303 msgid "Readonly Protection" msgstr "只读保护" -#: index.php:304 +#: index.php:309 msgid "Set to enabled but not available" msgstr "设置为启用, 但目前不可用" -#: index.php:305 +#: index.php:310 msgid "Use xcache.mmap_path other than /dev/zero" msgstr "设置 xcache.mmap_path 使用 /dev/zero 以外的值" -#: index.php:310 index.php:347 +#: index.php:315 index.php:352 msgid "Disabled" msgstr "已禁止" -#: index.php:311 +#: index.php:316 msgid "" "Enable readonly_protection == --performance & ++stability. Disable " "readonly_protection == ++performance & --stability" @@ -310,11 +313,11 @@ "启用 readonly_protection == --性能 & ++稳定性. 禁用 readonly_protection == +" "+性能 & --稳定性" -#: index.php:316 +#: index.php:321 msgid "XCache modules" msgstr "XCache 模块" -#: index.php:326 +#: index.php:331 msgid "" "Acceptable. Module(s) listed are built into XCache but not for production " "server.\n" @@ -326,35 +329,35 @@ "如果您觉得没大碍, 就保持现状.\n" "如果您对稳定性/安全性要求极其严格, 建议重新编译 XCache 不启用这些模块\n" -#: index.php:336 +#: index.php:341 msgid "XCache test setting" msgstr "XCache 测试设置" -#: index.php:343 +#: index.php:348 msgid "xcache.test is for testing only, not for server. set it to off" msgstr "xcache.test 仅用于开发测试用, 不用于服务器. 将它设置为 off" -#: index.php:350 +#: index.php:355 msgid "PHP Version" msgstr "PHP 版本" -#: index.php:369 +#: index.php:374 msgid "The version of PHP you're using is known to be unstable: " msgstr "您所使用的 PHP 版本, 是众所周知的不稳定版本: " -#: index.php:370 +#: index.php:375 msgid "Upgrade to new version of PHP" msgstr "升级到更新的 PHP 版本" -#: index.php:376 +#: index.php:381 msgid "Extension Compatibility" msgstr "Extension 兼容性" -#: index.php:380 +#: index.php:385 msgid "Zend Optimizer loaded" msgstr "Zend Optimizer 载入了" -#: index.php:381 +#: index.php:386 msgid "" "Optimizer feature of 'Zend Optimizer' is disabled by XCache due to " "compatibility reason; the Loader of it is still available, encoded files are " @@ -363,21 +366,22 @@ "由于兼容性问题, 'Zend Optimizer' 的优化器已被 XCache 禁止; 其加载器依然可用, " "可继续使用 Zend 加密的文件" -#: index.php:388 -#, fuzzy +#: index.php:393 msgid "SAPI Compatibility" msgstr "Extension 兼容性" -#: index.php:391 +#: index.php:396 msgid "CGI is not supported" -msgstr "" +msgstr "不支持 CGI" -#: index.php:391 +#: index.php:396 msgid "Use FastCGI or FPM instead" -msgstr "" +msgstr "请改用 FastCGI 或者 FPM" -#: index.php:396 +#: index.php:401 msgid "" "PHP_FCGI_CHILDREN should be >= 1 and use 1 group of parent/childs model. See " "http://xcache.lighttpd.net/wiki/Faq" msgstr "" +"PHP_FCGI_CHILDREN 应该设为 >= 1 并且使用 1 组单父多子模型. 参见 http://" +"xcache.lighttpd.net/wiki/Faq" | ||
[+] | Changed | xcache-3.0.1.tar.bz2/htdocs/diagnosis/lang/zh-traditional.po ^ |
@@ -1,7 +1,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-09-02 00:52+0800\n" +"POT-Creation-Date: 2012-11-20 10:32+0800\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -54,8 +54,8 @@ msgid "Not loaded" msgstr "" -#: index.php:90 index.php:129 index.php:135 index.php:183 index.php:285 -#: index.php:303 index.php:368 index.php:391 index.php:394 +#: index.php:90 index.php:129 index.php:135 index.php:290 index.php:308 +#: index.php:373 index.php:396 index.php:399 msgid "error" msgstr "" @@ -64,9 +64,9 @@ msgstr "" #: index.php:93 index.php:141 index.php:158 index.php:175 index.php:189 -#: index.php:200 index.php:216 index.php:248 index.php:264 index.php:273 -#: index.php:291 index.php:309 index.php:332 index.php:347 index.php:373 -#: index.php:379 index.php:385 index.php:399 +#: index.php:200 index.php:216 index.php:252 index.php:269 index.php:278 +#: index.php:296 index.php:314 index.php:337 index.php:352 index.php:378 +#: index.php:384 index.php:390 index.php:404 msgid "info" msgstr "" @@ -75,12 +75,12 @@ msgstr "" #: index.php:126 index.php:146 index.php:149 index.php:163 index.php:166 -#: index.php:180 index.php:207 index.php:253 index.php:270 index.php:300 -#: index.php:318 index.php:338 +#: index.php:180 index.php:207 index.php:221 index.php:258 index.php:275 +#: index.php:305 index.php:323 index.php:343 msgid "skipped" msgstr "" -#: index.php:130 index.php:184 index.php:274 +#: index.php:130 index.php:184 index.php:279 msgid "Not enabled" msgstr "" @@ -98,7 +98,7 @@ msgid "Your PHP pages is not accelerated by XCache. Set xcache.cacher = On" msgstr "" -#: index.php:141 index.php:189 index.php:292 index.php:310 index.php:342 +#: index.php:141 index.php:189 index.php:297 index.php:315 index.php:347 msgid "Enabled" msgstr "" @@ -106,19 +106,20 @@ msgid "PHP Compile Time Error" msgstr "" -#: index.php:152 index.php:169 index.php:193 index.php:210 index.php:234 -#: index.php:242 index.php:256 index.php:324 index.php:341 +#: index.php:152 index.php:169 index.php:183 index.php:193 index.php:210 +#: index.php:238 index.php:246 index.php:261 index.php:329 index.php:346 msgid "warning" msgstr "" #: index.php:153 -msgid "Error happened when compiling at least one of your PHP code" +msgid "Error happened when compiling one or some of your PHP code" msgstr "" #: index.php:154 msgid "" -"This usually means there is syntax error in your PHP code. Enable PHP " -"error_log to see what parser error is it, fix your code" +"PHP code failed to be compiled cannot be cached. This usually means there " +"was syntax error in your PHP code. Enable PHP error_log to see what parser " +"error is it, fix your code. This warning won't go away until PHP is restarted" msgstr "" #: index.php:158 @@ -139,7 +140,7 @@ "PHP crash/coredump, report to XCache devs" msgstr "" -#: index.php:175 index.php:264 index.php:332 +#: index.php:175 index.php:269 index.php:337 msgid "Idle" msgstr "" @@ -150,7 +151,8 @@ #: index.php:185 msgid "" "PHP code that use XCache caching backend have to use other caching backend " -"instead. Set xcache.var_size to non-zero" +"instead. Set xcache.var_size to non-zero if you have any PHP code that can " +"use XCache Data Caching API" msgstr "" #: index.php:191 @@ -192,108 +194,108 @@ msgid "Hash Slots" msgstr "" -#: index.php:235 +#: index.php:239 msgid "Slots value too big" msgstr "" -#: index.php:236 +#: index.php:240 #, php-format msgid "" "A very small value is set to %s value and leave %s value is too big.\n" "Decrease %s if small cache is really what you want" msgstr "" -#: index.php:243 +#: index.php:247 msgid "Slots value too small" msgstr "" -#: index.php:244 +#: index.php:248 #, php-format msgid "So many item are cached. Increase %s to a more proper value" msgstr "" -#: index.php:248 index.php:373 index.php:385 index.php:399 +#: index.php:252 index.php:378 index.php:390 index.php:404 msgid "Looks good" msgstr "" -#: index.php:251 +#: index.php:256 msgid "Cache Status" msgstr "" -#: index.php:257 +#: index.php:262 msgid "At least one of the caches is disabled. " msgstr "" -#: index.php:258 +#: index.php:263 msgid "Enable the cache." msgstr "" -#: index.php:259 +#: index.php:264 msgid "" "It was disabled by PHP crash/coredump handler or you disabled it manually." msgstr "" -#: index.php:259 +#: index.php:264 msgid "You disabled it manually." msgstr "" -#: index.php:260 +#: index.php:265 msgid "If it was caused by PHP crash/coredump, report to XCache devs" msgstr "" -#: index.php:268 +#: index.php:273 msgid "Coredump Directory" msgstr "" -#: index.php:275 +#: index.php:280 msgid "" "Enable coredump to save debugging information in case when PHP crash. It can " "also be enabled in other module like php-fpm beside XCache" msgstr "" -#: index.php:286 +#: index.php:291 msgid "Core files found:\n" msgstr "" -#: index.php:287 +#: index.php:292 msgid "" "Disable XCache PHP Cacher (set xcache.size=0), remove the core file(s), then " "restart PHP. If core file appears again, report call stack backtrace in the " "core to XCache devs" msgstr "" -#: index.php:293 +#: index.php:298 #, php-format msgid "You can see core files if PHP crash in %s if PHP crash" msgstr "" -#: index.php:298 +#: index.php:303 msgid "Readonly Protection" msgstr "" -#: index.php:304 +#: index.php:309 msgid "Set to enabled but not available" msgstr "" -#: index.php:305 +#: index.php:310 msgid "Use xcache.mmap_path other than /dev/zero" msgstr "" -#: index.php:310 index.php:347 +#: index.php:315 index.php:352 msgid "Disabled" msgstr "" -#: index.php:311 +#: index.php:316 msgid "" "Enable readonly_protection == --performance & ++stability. Disable " "readonly_protection == ++performance & --stability" msgstr "" -#: index.php:316 +#: index.php:321 msgid "XCache modules" msgstr "" -#: index.php:326 +#: index.php:331 msgid "" "Acceptable. Module(s) listed are built into XCache but not for production " "server.\n" @@ -302,54 +304,54 @@ "security." msgstr "" -#: index.php:336 +#: index.php:341 msgid "XCache test setting" msgstr "" -#: index.php:343 +#: index.php:348 msgid "xcache.test is for testing only, not for server. set it to off" msgstr "" -#: index.php:350 +#: index.php:355 msgid "PHP Version" msgstr "" -#: index.php:369 +#: index.php:374 msgid "The version of PHP you're using is known to be unstable: " msgstr "" -#: index.php:370 +#: index.php:375 msgid "Upgrade to new version of PHP" msgstr "" -#: index.php:376 +#: index.php:381 msgid "Extension Compatibility" msgstr "" -#: index.php:380 +#: index.php:385 msgid "Zend Optimizer loaded" msgstr "" -#: index.php:381 +#: index.php:386 msgid "" "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" msgstr "" -#: index.php:388 +#: index.php:393 msgid "SAPI Compatibility" msgstr "" -#: index.php:391 +#: index.php:396 msgid "CGI is not supported" msgstr "" -#: index.php:391 +#: index.php:396 msgid "Use FastCGI or FPM instead" msgstr "" -#: index.php:396 +#: index.php:401 msgid "" "PHP_FCGI_CHILDREN should be >= 1 and use 1 group of parent/childs model. See " "http://xcache.lighttpd.net/wiki/Faq" | ||
[+] | Changed | xcache-3.0.1.tar.bz2/mod_cacher/xc_cache.h ^ |
@@ -154,12 +154,12 @@ zend_ulong refcount; /* count of php instances holding this entry */ time_t file_mtime; size_t file_size; - int file_device; - int file_inode; + size_t file_device; + size_t file_inode; - int filepath_len; + size_t filepath_len; ZEND_24(NOTHING, const) char *filepath; - int dirpath_len; + size_t dirpath_len; char *dirpath; #ifdef IS_UNICODE int ufilepath_len; @@ -184,9 +184,9 @@ } xc_entry_hash_t; /* }}} */ -int xc_is_rw(const void *p); -int xc_is_ro(const void *p); -int xc_is_shm(const void *p); +zend_bool xc_is_rw(const void *p); +zend_bool xc_is_ro(const void *p); +zend_bool xc_is_shm(const void *p); /* {{{ xc_gc_op_array_t */ typedef struct { #ifdef ZEND_ENGINE_2 | ||
[+] | Changed | xcache-3.0.1.tar.bz2/mod_cacher/xc_cacher.c ^ |
@@ -24,7 +24,10 @@ #include "ext/standard/info.h" #include "ext/standard/md5.h" #ifdef ZEND_ENGINE_2_1 -#include "ext/date/php_date.h" +# include "ext/date/php_date.h" +#endif +#ifdef ZEND_WIN32 +# include <process.h> #endif #include "ext/standard/php_math.h" #include "SAPI.h" @@ -37,7 +40,7 @@ #define UNLOCK(x) xc_unlock((x)->lck) #define ENTER_LOCK_EX(x) \ - xc_lock((x)->lck); \ + LOCK((x)); \ zend_try { \ do #define LEAVE_LOCK_EX(x) \ @@ -45,7 +48,7 @@ } zend_catch { \ catched = 1; \ } zend_end_try(); \ - xc_unlock((x)->lck) + UNLOCK((x)) #define ENTER_LOCK(x) do { \ int catched = 0; \ @@ -220,7 +223,7 @@ } /* }}} */ -static inline int xc_entry_equal_unlocked(xc_entry_type_t type, const xc_entry_t *entry1, const xc_entry_t *entry2 TSRMLS_DC) /* {{{ */ +static inline zend_bool xc_entry_equal_unlocked(xc_entry_type_t type, const xc_entry_t *entry1, const xc_entry_t *entry2 TSRMLS_DC) /* {{{ */ { /* this function isn't required but can be in unlocked */ switch (type) { @@ -407,7 +410,7 @@ { time_t n = XG(request_time) / interval; if (*curtime != n) { - zend_uint target_slot = n % count; + zend_uint target_slot = ((zend_uint) n) % count; zend_uint slot; for (slot = advance_wrapped(*curslot, count); slot != target_slot; @@ -445,7 +448,7 @@ static void xc_entry_apply_unlocked(xc_entry_type_t type, xc_cache_t *cache, cache_apply_unlocked_func_t apply_func TSRMLS_DC) /* {{{ */ { xc_entry_t *p, **pp; - int i, c; + size_t i, c; for (i = 0, c = cache->hentry->size; i < c; i ++) { pp = &(cache->cached->entries[i]); @@ -513,7 +516,7 @@ /* }}} */ static void xc_gc_expires_var(TSRMLS_D) /* {{{ */ { - int i, c; + size_t i, c; if (!xc_var_gc_interval || !xc_var_caches) { return; @@ -732,7 +735,7 @@ static void xc_filllist_unlocked(xc_entry_type_t type, xc_cache_t *cache, zval *return_value TSRMLS_DC) /* {{{ */ { zval* list; - int i, c; + size_t i, c; xc_entry_t *e; ALLOC_INIT_ZVAL(list); @@ -930,7 +933,7 @@ char *paths, *path; char *tokbuf; size_t path_buffer_len; - int size; + size_t size; char tokens[] = { DEFAULT_DIR_SEPARATOR, '\0' }; int ret; ALLOCA_FLAG(use_heap) @@ -965,7 +968,7 @@ /* fall back to current directory */ if (zend_is_executing(TSRMLS_C)) { const char *executing_filename = zend_get_executed_filename(TSRMLS_C); - int dirname_len = strlen(executing_filename); + int dirname_len = (int) strlen(executing_filename); size_t filename_len = strlen(filepath); while ((--dirname_len >= 0) && !IS_SLASH(executing_filename[dirname_len])); @@ -1062,7 +1065,7 @@ xc_compiler_t *compiler = entry_checker_data->compiler; compiler->new_entry.entry.name.str.val = xc_expand_url(filepath, compiler->opened_path_buffer TSRMLS_CC); - compiler->new_entry.entry.name.str.len = strlen(compiler->new_entry.entry.name.str.val); + compiler->new_entry.entry.name.str.len = (int) strlen(compiler->new_entry.entry.name.str.val); *entry_checker_data->stored_entry = (xc_entry_php_t *) xc_entry_find_unlocked( XC_TYPE_PHP @@ -1140,7 +1143,7 @@ /* fall back to real stat call */ else { #ifdef ZEND_ENGINE_2_3 - char *opened_path = php_resolve_path(compiler->filename, compiler->filename_len, PG(include_path) TSRMLS_CC); + char *opened_path = php_resolve_path(compiler->filename, (int) compiler->filename_len, PG(include_path) TSRMLS_CC); if (opened_path) { strcpy(compiler->opened_path_buffer, opened_path); efree(opened_path); @@ -1178,7 +1181,7 @@ } delta = XG(request_time) - buf.st_mtime; - if (abs(delta) < 2 && !xc_test) { + if (abs((int) delta) < 2 && !xc_test) { return FAILURE; } @@ -1210,7 +1213,7 @@ /* get back to basename_begin */ ++basename_begin; - basename_hash_value = HASH_STR_L(basename_begin, filename_end - basename_begin); + basename_hash_value = HASH_STR_L(basename_begin, (uint) (filename_end - basename_begin)); } compiler->entry_hash.cacheid = xc_php_hcache.size > 1 ? xc_hash_fold(basename_hash_value, &xc_php_hcache) : 0; @@ -1250,7 +1253,7 @@ } PHP_MD5Init(&context); - while ((n = php_stream_read(stream, (char *) buf, sizeof(buf))) > 0) { + while ((n = php_stream_read(stream, (char *) buf, (int) sizeof(buf))) > 0) { PHP_MD5Update(&context, buf, n); } PHP_MD5Final((unsigned char *) compiler->new_php.md5.digest, &context); @@ -1945,7 +1948,6 @@ #endif memset(&compiler->new_php.op_array_info, 0, sizeof(compiler->new_php.op_array_info)); - XG(initial_compile_file_called) = 0; zend_try { compiler->new_php.op_array = NULL; xc_compile_php(compiler, sandboxed_compiler->h, sandboxed_compiler->type TSRMLS_CC); @@ -2201,7 +2203,7 @@ /* }}} */ /* gdb helper functions, but N/A for coredump */ -int xc_is_rw(const void *p) /* {{{ */ +zend_bool xc_is_rw(const void *p) /* {{{ */ { xc_shm_t *shm; size_t i; @@ -2226,7 +2228,7 @@ return 0; } /* }}} */ -int xc_is_ro(const void *p) /* {{{ */ +zend_bool xc_is_ro(const void *p) /* {{{ */ { xc_shm_t *shm; size_t i; @@ -2251,7 +2253,7 @@ return 0; } /* }}} */ -int xc_is_shm(const void *p) /* {{{ */ +zend_bool xc_is_shm(const void *p) /* {{{ */ { return xc_is_ro(p) || xc_is_rw(p); } @@ -2557,7 +2559,7 @@ xc_free_alloca(name##_buffer.buffer, name##_buffer.useheap); \ } -static inline int xc_var_has_prefix(xc_entry_t *entry, zval *prefix TSRMLS_DC) /* {{{ */ +static inline zend_bool xc_var_has_prefix(xc_entry_t *entry, zval *prefix TSRMLS_DC) /* {{{ */ { zend_bool result = 0; VAR_BUFFER_FLAGS(prefix); @@ -2590,7 +2592,7 @@ { zend_register_long_constant(ZEND_STRS("XC_TYPE_PHP"), XC_TYPE_PHP, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC); zend_register_long_constant(ZEND_STRS("XC_TYPE_VAR"), XC_TYPE_VAR, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC); - return 0; + return SUCCESS; } /* }}} */ static xc_shm_t *xc_cache_destroy(xc_cache_t *caches, xc_hash_t *hcache) /* {{{ */ @@ -2608,7 +2610,9 @@ } /* do NOT touch cached data */ shm = cache->shm; - cache->shm->handlers->memdestroy(cache->allocator); + if (shm) { + cache->shm->handlers->memdestroy(cache->allocator); + } } } free(caches); @@ -2646,12 +2650,13 @@ goto err; } CHECK(allocator->vtable->init(shm, allocator, memsize), "Failed init allocator"); - CHECK(cache->cached = allocator->vtable->calloc(allocator, 1, sizeof(xc_cached_t)), "cache OOM"); - CHECK(cache->cached->entries = allocator->vtable->calloc(allocator, hentry->size, sizeof(xc_entry_t*)), "entries OOM"); + CHECK(cache->cached = allocator->vtable->calloc(allocator, 1, sizeof(xc_cached_t)), "create cache OOM"); + CHECK(cache->cached->entries = allocator->vtable->calloc(allocator, hentry->size, sizeof(xc_entry_t*)), "create entries OOM"); if (hphp) { - CHECK(cache->cached->phps = allocator->vtable->calloc(allocator, hphp->size, sizeof(xc_entry_data_php_t*)), "phps OOM"); + CHECK(cache->cached->phps = allocator->vtable->calloc(allocator, hphp->size, sizeof(xc_entry_data_php_t*)), "create phps OOM"); } - CHECK(cache->lck = xc_lock_init(NULL), "can't create lock"); + CHECK(cache->lck = allocator->vtable->calloc(allocator, 1, xc_lock_size()), "create lock OOM"); + CHECK(xc_lock_init(cache->lck, NULL, 1), "can't create lock"); cache->hcache = hcache; cache->hentry = hentry; @@ -2734,7 +2739,7 @@ xc_shm_destroy(shm); shm = NULL; } - return 0; + return FAILURE; } /* }}} */ static void xc_request_init(TSRMLS_D) /* {{{ */ @@ -2806,7 +2811,7 @@ /* }}} */ /* user functions */ -static int xcache_admin_auth_check(TSRMLS_D) /* {{{ */ +static zend_bool xcache_admin_auth_check(TSRMLS_D) /* {{{ */ { zval **server = NULL; zval **user = NULL; @@ -3468,11 +3473,7 @@ } xc_initized = 1; xc_init_time = time(NULL); -#ifdef PHP_WIN32 - xc_init_instance_id = GetCurrentProcessId(); -#else xc_init_instance_id = getpid(); -#endif #ifdef ZTS xc_init_instance_subid = tsrm_thread_id(); #endif | ||
[+] | Changed | xcache-3.0.1.tar.bz2/mod_coverager/xc_coverager.c ^ |
@@ -39,7 +39,7 @@ efree(cov); } /* }}} */ -static void xcache_mkdirs_ex(char *root, int rootlen, char *path, int pathlen TSRMLS_DC) /* {{{ */ +static void xcache_mkdirs_ex(char *root, long rootlen, char *path, long pathlen TSRMLS_DC) /* {{{ */ { char *fullpath; struct stat st; @@ -75,7 +75,7 @@ long *buf = NULL, *p; long covlines, *phits; int fd = -1; - int size; + size_t size; int newfile; struct stat srcstat, outstat; HashPosition pos; @@ -183,7 +183,7 @@ goto bailout; } lseek(fd, 0, SEEK_SET); - if (write(fd, (char *) buf, size) != size) { + if (write(fd, (char *) buf, size) != (ssize_t) size) { goto bailout; } @@ -276,7 +276,7 @@ coverager_t *pcov; zstr s; char *outfilename; - int dumpdir_len, outfilelen, alloc_len = 0; + size_t dumpdir_len, outfilelen, alloc_len = 0; uint size; HashPosition pos; @@ -333,7 +333,7 @@ add_index_long(lines, pos2->h, hits >= 0 ? hits : 0); zend_hash_move_forward_ex(cov, &pos2); } - add_assoc_zval_ex(return_value, ZSTR_S(filename), strlen(ZSTR_S(filename)) + 1, lines); + add_assoc_zval_ex(return_value, ZSTR_S(filename), (uint) strlen(ZSTR_S(filename)) + 1, lines); zend_hash_move_forward_ex(XG(coverages), &pos); } @@ -356,7 +356,7 @@ /* helper func to store hits into coverages */ static coverager_t xc_coverager_get(const char *filename TSRMLS_DC) /* {{{ */ { - int len = strlen(filename) + 1; + uint len = (uint) strlen(filename) + 1; coverager_t cov, *pcov; if (zend_u_hash_find(XG(coverages), IS_STRING, filename, len, (void **) &pcov) == SUCCESS) { @@ -472,7 +472,7 @@ if (XG(coverages) && XG(coverager_started)) { int size = xc_coverager_get_op_array_size_no_tail(op_array); - int oplineno = (*EG(opline_ptr)) - op_array->opcodes; + int oplineno = (int) ((*EG(opline_ptr)) - op_array->opcodes); if (oplineno < size) { xc_coverager_add_hits(xc_coverager_get(op_array->filename TSRMLS_CC), (*EG(opline_ptr))->lineno, 1 TSRMLS_CC); } @@ -497,7 +497,7 @@ array_init(return_value); p = (long*) str; - len -= sizeof(long); + len -= (int) sizeof(long); if (len < 0) { return; } @@ -506,7 +506,7 @@ return; } - for (; len >= (int) sizeof(long) * 2; len -= sizeof(long) * 2, p += 2) { + for (; len >= (int) sizeof(long) * 2; len -= (int) sizeof(long) * 2, p += 2) { add_index_long(return_value, p[0], p[1] < 0 ? 0 : p[1]); } } @@ -657,7 +657,7 @@ REGISTER_INI_ENTRIES(); if (cfg_get_string("xcache.coveragedump_directory", &xc_coveragedump_dir) == SUCCESS && xc_coveragedump_dir) { - int len; + size_t len; xc_coveragedump_dir = pestrdup(xc_coveragedump_dir, 1); len = strlen(xc_coveragedump_dir); if (len) { | ||
[+] | Changed | xcache-3.0.1.tar.bz2/mod_optimizer/xc_optimizer.c ^ |
@@ -167,6 +167,9 @@ case ZEND_EXIT: return SUCCESS; /* no fall */ +#ifdef ZEND_GOTO + case ZEND_GOTO: +#endif case ZEND_JMP: fi->jmpout_op1 = Z_OP(opline->op1).opline_num; return SUCCESS; /* no fall */ @@ -183,6 +186,9 @@ #ifdef ZEND_JMP_SET case ZEND_JMP_SET: #endif +#ifdef ZEND_JMP_SET_VAR + case ZEND_JMP_SET_VAR: +#endif #ifdef ZEND_JMP_NO_CTOR case ZEND_JMP_NO_CTOR: #endif | ||
[+] | Changed | xcache-3.0.1.tar.bz2/processor/hashtable.m4 ^ |
@@ -71,7 +71,7 @@ zend_bool first = 1; dnl only used for copy IFCOPY(`uint n;') - IFCALCCOPY(`int bucketsize;') + IFCALCCOPY(`size_t bucketsize;') #if defined(HARDENING_PATCH_HASH_PROTECT) && HARDENING_PATCH_HASH_PROTECT IFASM(`dst->canary = zend_hash_canary; DONE(canary)', ` | ||
[+] | Changed | xcache-3.0.1.tar.bz2/processor/head.m4 ^ |
@@ -88,7 +88,7 @@ /* export: typedef struct _xc_processor_t xc_processor_t; :export {{{ */ struct _xc_processor_t { char *p; - zend_uint size; + size_t size; HashTable strings; HashTable zvalptrs; zend_bool reference; /* enable if to deal with reference */ @@ -158,20 +158,20 @@ /* }}} */ #endif /* {{{ xc_zstrlen_char */ -static inline int xc_zstrlen_char(const_zstr s) +static inline size_t xc_zstrlen_char(const_zstr s) { return strlen(ZSTR_S(s)); } /* }}} */ #ifdef IS_UNICODE /* {{{ xc_zstrlen_uchar */ -static inline int xc_zstrlen_uchar(zstr s) +static inline size_t xc_zstrlen_uchar(zstr s) { return u_strlen(ZSTR_U(s)); } /* }}} */ /* {{{ xc_zstrlen */ -static inline int xc_zstrlen(int type, const_zstr s) +static inline size_t xc_zstrlen(int type, const_zstr s) { return type == IS_UNICODE ? xc_zstrlen_uchar(s) : xc_zstrlen_char(s); } @@ -191,13 +191,13 @@ ') static inline void xc_calc_string_n(xc_processor_t *processor, zend_uchar type, const_zstr str, long size IFAUTOCHECK(`, int relayline')) { pushdef(`__LINE__', `relayline') - int realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size); + size_t realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size); long dummy = 1; if (realsize > MAX_DUP_STR_LEN) { ALLOC(, char, realsize) } - else if (zend_u_hash_add(&processor->strings, type, str, size, (void *) &dummy, sizeof(dummy), NULL) == SUCCESS) { + else if (zend_u_hash_add(&processor->strings, type, str, (uint) size, (void *) &dummy, sizeof(dummy), NULL) == SUCCESS) { /* new string */ ALLOC(, char, realsize) } @@ -213,7 +213,7 @@ REDEF(`PROCESSOR_TYPE', `store') static inline zstr xc_store_string_n(xc_processor_t *processor, zend_uchar type, const_zstr str, long size IFAUTOCHECK(`, int relayline')) { pushdef(`__LINE__', `relayline') - int realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size); + size_t realsize = UNISW(size, (type == IS_UNICODE) ? UBYTES(size) : size); zstr ret, *pret; if (realsize > MAX_DUP_STR_LEN) { @@ -222,14 +222,14 @@ return ret; } - if (zend_u_hash_find(&processor->strings, type, str, size, (void **) &pret) == SUCCESS) { + if (zend_u_hash_find(&processor->strings, type, str, (uint) size, (void **) &pret) == SUCCESS) { return *pret; } /* new string */ ALLOC(ZSTR_V(ret), char, realsize) memcpy(ZSTR_V(ret), ZSTR_V(str), realsize); - zend_u_hash_add(&processor->strings, type, str, size, (void *) &ret, sizeof(zstr), NULL); + zend_u_hash_add(&processor->strings, type, str, (uint) size, (void *) &ret, sizeof(zstr), NULL); return ret; popdef(`__LINE__') @@ -238,8 +238,8 @@ /* {{{ xc_get_class_num * return class_index + 1 */ -static zend_ulong xc_get_class_num(xc_processor_t *processor, zend_class_entry *ce) { - zend_ulong i; +static zend_uint xc_get_class_num(xc_processor_t *processor, zend_class_entry *ce) { + zend_uint i; const xc_entry_data_php_t *php = processor->php_src; zend_class_entry *ceptr; @@ -356,15 +356,15 @@ /* }}} */ /* {{{ field name checker */ IFAUTOCHECK(`dnl -static int xc_check_names(const char *file, int line, const char *functionName, const char **assert_names, int assert_names_count, HashTable *done_names) +static int xc_check_names(const char *file, int line, const char *functionName, const char **assert_names, size_t assert_names_count, HashTable *done_names) { int errors = 0; if (assert_names_count) { - int i; + size_t i; Bucket *b; for (i = 0; i < assert_names_count; ++i) { - if (!zend_u_hash_exists(done_names, IS_STRING, assert_names[i], strlen(assert_names[i]) + 1)) { + if (!zend_u_hash_exists(done_names, IS_STRING, assert_names[i], (uint) strlen(assert_names[i]) + 1)) { fprintf(stderr , "Error: missing field at %s `#'%d %s`' : %s\n" , file, line, functionName | ||
[+] | Changed | xcache-3.0.1.tar.bz2/processor/main.m4 ^ |
@@ -206,7 +206,7 @@ dnl }}} dnl {{{ DONE_* define(`DONE_SIZE', `IFAUTOCHECK(`dnl - xc_autocheck_done_size += $1`'; + xc_autocheck_done_size += (int) $1`'; xc_autocheck_done_count ++; ')') define(`DONE', ` | ||
[+] | Changed | xcache-3.0.1.tar.bz2/processor/processor.m4 ^ |
@@ -719,6 +719,11 @@ /* really fast shallow copy */ memcpy(dst, src, sizeof(src[0])); dst->refcount[0] = 1000; +#ifdef ZEND_ACC_ALIAS + if ((processor->active_class_entry_src && (processor->active_class_entry_src->ce_flags & ZEND_ACC_TRAIT))) { + PROC_ZSTRING(, function_name) + } +#endif /* deep */ STRUCT_P(HashTable, static_variables, HashTable_zval_ptr) #ifdef ZEND_ENGINE_2 @@ -1172,12 +1177,12 @@ IFSTORE(`dst->refcount = 0; DONE(refcount)', `PROCESS(long, refcount)') PROCESS(time_t, file_mtime) PROCESS(size_t, file_size) - PROCESS(int, file_device) - PROCESS(int, file_inode) + PROCESS(size_t, file_device) + PROCESS(size_t, file_inode) - PROCESS(int, filepath_len) + PROCESS(size_t, filepath_len) IFRESTORE(`COPY(filepath)', `PROC_STRING_L(filepath, filepath_len)') - PROCESS(int, dirpath_len) + PROCESS(size_t, dirpath_len) IFRESTORE(`COPY(dirpath)', `PROC_STRING_L(dirpath, dirpath_len)') #ifdef IS_UNICODE PROCESS(int, ufilepath_len) | ||
[+] | Changed | xcache-3.0.1.tar.bz2/util/xc_trace.c ^ |
@@ -1,7 +1,15 @@ +#include "php.h" #include "xc_trace.h" #include <stdio.h> #include <stdarg.h> +#include <string.h> +const char *xc_trace_get_basename(const char *path) /* {{{ */ +{ + const char *last_separator = strrchr(path, PHP_DIR_SEPARATOR); + return last_separator ? last_separator + 1 : path; +} +/* }}} */ int xc_vtrace(const char *fmt, va_list args) /* {{{ */ { return vfprintf(stderr, fmt, args); | ||
[+] | Changed | xcache-3.0.1.tar.bz2/util/xc_trace.h ^ |
@@ -32,8 +32,9 @@ return ret; } # else +const char *xc_trace_get_basename(const char *path); # define TRACE(fmt, ...) \ - xc_trace("%s:%d: " fmt "\r\n", __FILE__, __LINE__, __VA_ARGS__) + xc_trace("%s:%04d: " fmt "\r\n", xc_trace_get_basename(__FILE__), __LINE__, __VA_ARGS__) # endif /* ZEND_WIN32 */ # undef NDEBUG # undef inline | ||
[+] | Changed | xcache-3.0.1.tar.bz2/xcache-zh-gb2312.ini ^ |
@@ -15,14 +15,14 @@ [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.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 | ||
[+] | Changed | xcache-3.0.1.tar.bz2/xcache.c ^ |
@@ -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; @@ -246,7 +247,7 @@ name = getter((zend_uchar) spec); if (name) { /* RETURN_STRING */ - int len = strlen(name); + int len = (int) strlen(name); return_value->value.str.len = len; return_value->value.str.val = estrndup(name, len); return_value->type = IS_STRING; @@ -348,6 +349,8 @@ PHP_FUNCTION(xcache_coredump) { if (xc_test) { + char *null_ptr = NULL; + *null_ptr = 0; raise(SIGSEGV); } else { @@ -427,6 +430,7 @@ 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(); @@ -434,7 +438,7 @@ 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); @@ -560,8 +564,10 @@ startup_func_t old_startup; } xc_incompatible_zend_extension_info_t; static xc_incompatible_zend_extension_info_t xc_incompatible_zend_extensions[] = { - { "Zend Optimizer", NULL } + { "Zend Optimizer", NULL }, + { "the ionCube PHP Loader", NULL } }; +zend_llist_element **xc_zend_extension_elements; static xc_incompatible_zend_extension_info_t *xc_get_incompatible_zend_extension_info(const char *name) { @@ -577,30 +583,82 @@ return NULL; } /* }}} */ +static void xc_zend_llist_add_element(zend_llist *list, zend_llist_element *element) /* {{{ */ +{ + if (!zend_extensions.head) { + zend_extensions.head = zend_extensions.tail = element; + } + else { + zend_extensions.tail->next = element; + element->prev = zend_extensions.tail; + zend_extensions.tail = element; + } +} +/* }}} */ static int xc_incompatible_zend_extension_startup_hook(zend_extension *extension) /* {{{ */ { xc_incompatible_zend_extension_info_t *incompatible_zend_extension_info = xc_get_incompatible_zend_extension_info(extension->name); int status; zend_bool catched = 0; - zend_llist old_zend_extensions = zend_extensions; + zend_llist old_zend_extensions; + zend_extension *ext; + size_t i; + zend_llist_element *element; TSRMLS_FETCH(); - /* hide all extensions from it */ - zend_extensions.head = NULL; - zend_extensions.count = 0; - /* restore */ extension->startup = incompatible_zend_extension_info->old_startup; incompatible_zend_extension_info->old_startup = NULL; assert(extension->startup); + /* save */ + assert(!xc_zend_extension_elements); + old_zend_extensions = zend_extensions; + xc_zend_extension_elements = malloc(sizeof(zend_llist_element *) * old_zend_extensions.count); + for (i = 0, element = old_zend_extensions.head; element; ++i, element = element->next) { + xc_zend_extension_elements[i] = element; + } + + /* hide all XCache extensions from it */ + zend_extensions.head = NULL; + zend_extensions.tail = NULL; + zend_extensions.count = 0; + + for (i = 0; i < old_zend_extensions.count; ++i) { + element = xc_zend_extension_elements[i]; + element->next = element->prev = NULL; + + ext = (zend_extension *) element->data; + + if (!(strcmp(ext->name, XCACHE_NAME) == 0 || strncmp(ext->name, XCACHE_NAME " ", sizeof(XCACHE_NAME " ") - 1) == 0)) { + xc_zend_llist_add_element(&zend_extensions, element); + ++zend_extensions.count; + } + } + + assert(extension->startup != xc_incompatible_zend_extension_startup_hook); zend_try { status = extension->startup(extension); } zend_catch { catched = 1; } zend_end_try(); + /* restore */ zend_extensions = old_zend_extensions; + zend_extensions.head = NULL; + zend_extensions.tail = NULL; + zend_extensions.count = 0; + for (i = 0; i < old_zend_extensions.count; ++i) { + element = xc_zend_extension_elements[i]; + element->next = element->prev = NULL; + + xc_zend_llist_add_element(&zend_extensions, element); + ++zend_extensions.count; + } + + free(xc_zend_extension_elements); + xc_zend_extension_elements = NULL; + if (catched) { zend_bailout(); } @@ -662,6 +720,7 @@ /* {{{ 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) @@ -694,7 +753,7 @@ if (strcmp(sapi_module.name, "cli") == 0) { char *env; if ((env = getenv("XCACHE_TEST")) != NULL) { - xc_test = atoi(env); + xc_test = (zend_bool) atoi(env); } } | ||
[+] | Changed | xcache-3.0.1.tar.bz2/xcache.h ^ |
@@ -2,10 +2,10 @@ #define __XCACHE_H #define XCACHE_NAME "XCache" #ifndef XCACHE_VERSION -# define XCACHE_VERSION "3.0.0" +# define XCACHE_VERSION "3.0.1" #endif #define XCACHE_AUTHOR "mOo" -#define XCACHE_COPYRIGHT "Copyright (c) 2005-2012" +#define XCACHE_COPYRIGHT "Copyright (c) 2005-2013" #define XCACHE_URL "http://xcache.lighttpd.net" #define XCACHE_WIKI_URL XCACHE_URL "/wiki" | ||
[+] | Changed | xcache-3.0.1.tar.bz2/xcache.ini ^ |
@@ -15,7 +15,7 @@ [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.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 | ||
[+] | Changed | xcache-3.0.1.tar.bz2/xcache/xc_lock.c ^ |
@@ -3,7 +3,51 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> +#ifdef ZEND_WIN32 +# include <process.h> +#else +# include <unistd.h> +# include <fcntl.h> +# include <errno.h> +#endif + +/* {{{ detect what type of lock is needed */ +#ifdef ZTS +# define XC_LOCK_NEED_TS +#endif + +#ifndef ZEND_WIN32 +# define XC_LOCK_NEED_INTERPROCESS +#endif + +#if defined(XC_LOCK_NEED_TS) && defined(XC_LOCK_NEED_INTERPROCESS) +/* allow switching off interprocess support */ +# define XC_LOCK_HAVE_INTERPROCESS_SWITCH +#endif +/* }}} */ + +/* {{{ detect which lock is needed */ +#if defined(XC_LOCK_NEED_TS) && defined(XC_LOCK_NEED_INTERPROCESS) +# ifdef PTHREAD +# define XC_LOCK_USE_PTHREAD +# ifndef _POSIX_THREAD_PROCESS_SHARED +# define XC_LOCK_USE_FCNTL +# endif +# else +# define XC_LOCK_USE_TSRM +# define XC_LOCK_USE_FCNTL +# endif +#elif defined(XC_LOCK_NEED_TS) +# define XC_LOCK_USE_TSRM +#elif defined(XC_LOCK_NEED_INTERPROCESS) +# define XC_LOCK_USE_FCNTL +#else +# define XC_LOCK_USE_NOOP +#endif +/* }}} */ +/* {{{ fcntl lock impl */ +#ifdef XC_LOCK_USE_FCNTL #ifndef ZEND_WIN32 typedef int HANDLE; # ifndef INVALID_HANDLE_VALUE @@ -19,23 +63,19 @@ FILE_ATTRIBUTE_NORMAL, \ NULL) #endif -#include "xc_lock.h" -struct _xc_lock_t { +typedef struct { HANDLE fd; char *pathname; -}; +} xc_fcntl_lock_t; #ifndef ZEND_WIN32 -# include <unistd.h> -# include <fcntl.h> -# include <errno.h> # define LCK_WR F_WRLCK # define LCK_RD F_RDLCK # define LCK_UN F_UNLCK # define LCK_NB 0 -static inline int dolock(xc_lock_t *lck, int type) /* {{{ */ -{ +static inline int dolock(xc_fcntl_lock_t *lck, int type) +{ int ret; struct flock lock; @@ -50,7 +90,6 @@ } while (ret < 0 && errno == EINTR); return ret; } -/* }}} */ #else # include <win32/flock.h> @@ -65,24 +104,23 @@ # define LCK_RD 0 # define LCK_UN 0 # define LCK_NB LOCKFILE_FAIL_IMMEDIATELY -static inline int dolock(xc_lock_t *lck, int type) /* {{{ */ -{ +static inline int dolock(xc_fcntl_lock_t *lck, int type) +{ static OVERLAPPED offset = {0, 0, 0, 0, NULL}; if (type == LCK_UN) { - return UnlockFileEx((HANDLE)lck->fd, 0, 1, 0, &offset); + return UnlockFileEx(lck->fd, 0, 1, 0, &offset); } else { - return LockFileEx((HANDLE)lck->fd, type, 0, 1, 0, &offset); + return LockFileEx(lck->fd, type, 0, 1, 0, &offset); } } -/* }}} */ #endif +/* }}} */ -xc_lock_t *xc_fcntl_init(const char *pathname) /* {{{ */ +static zend_bool xc_fcntl_init(xc_fcntl_lock_t *lck, const char *pathname) /* {{{ */ { HANDLE fd; - xc_lock_t *lck; int size; char *myname; @@ -110,7 +148,6 @@ fd = open(pathname, O_RDWR|O_CREAT, 0666); if (fd != INVALID_HANDLE_VALUE) { - lck = malloc(sizeof(lck[0])); #ifndef __CYGWIN__ unlink(pathname); @@ -129,37 +166,206 @@ free(myname); } - return lck; + return lck ? 1 : 0; } /* }}} */ -void xc_fcntl_destroy(xc_lock_t *lck) /* {{{ */ -{ +static void xc_fcntl_destroy(xc_fcntl_lock_t *lck) /* {{{ */ +{ close(lck->fd); #ifdef __CYGWIN__ unlink(lck->pathname); #endif free(lck->pathname); - free(lck); } /* }}} */ -void xc_fcntl_lock(xc_lock_t *lck) /* {{{ */ -{ +static void xc_fcntl_lock(xc_fcntl_lock_t *lck) /* {{{ */ +{ if (dolock(lck, LCK_WR) < 0) { zend_error(E_ERROR, "xc_fcntl_lock failed errno:%d", errno); } } /* }}} */ -void xc_fcntl_rdlock(xc_lock_t *lck) /* {{{ */ -{ +static void xc_fcntl_rdlock(xc_fcntl_lock_t *lck) /* {{{ */ +{ if (dolock(lck, LCK_RD) < 0) { zend_error(E_ERROR, "xc_fcntl_lock failed errno:%d", errno); } } /* }}} */ -void xc_fcntl_unlock(xc_lock_t *lck) /* {{{ */ -{ +static void xc_fcntl_unlock(xc_fcntl_lock_t *lck) /* {{{ */ +{ if (dolock(lck, LCK_UN) < 0) { zend_error(E_ERROR, "xc_fcntl_unlock failed errno:%d", errno); } } /* }}} */ +#endif /* XC_LOCK_USE_FCNTL */ + +struct _xc_lock_t { +#ifdef XC_LOCK_USE_NOOP + int dummy; +#endif + +#ifdef XC_LOCK_USE_TSRM + MUTEX_T tsrm_mutex; +#endif + +#ifdef XC_LOCK_HAVE_INTERPROCESS_SWITCH + zend_bool interprocess; +#endif + +#ifdef XC_LOCK_USE_PTHREAD + pthread_mutex_t pthread_mutex; +#endif + +#ifdef XC_LOCK_USE_FCNTL + xc_fcntl_lock_t fcntl_lock; +#endif + +#ifndef NDEBUG + zend_bool locked; +#endif +}; + +#ifdef XC_LOCK_HAVE_INTERPROCESS_SWITCH +# define XC_LOCK_INTERPROCESS (lck->interprocess) +#else +# define XC_LOCK_INTERPROCESS 1 +#endif + +size_t xc_lock_size(void) /* {{{ */ +{ + return sizeof(xc_lock_t); +} +/* }}} */ +xc_lock_t *xc_lock_init(xc_lock_t *lck, const char *pathname, unsigned char interprocess) /* {{{ */ +{ +#ifdef XC_LOCK_HAVE_INTERPROCESS_SWITCH + lck->interprocess = interprocess; +#endif + +#ifdef XC_LOCK_USE_PTHREAD + { + pthread_mutexattr_t psharedm; + pthread_mutexattr_init(&psharedm); + pthread_mutexattr_setpshared(&psharedm, XC_LOCK_INTERPROCESS ? PTHREAD_PROCESS_PRIVATE : PTHREAD_PROCESS_SHARED); + pthread_mutex_init(&lck->pthread_mutex, &psharedm); + } +#endif + +#ifdef XC_LOCK_USE_TSRM + lck->tsrm_mutex = tsrm_mutex_alloc(); +#endif + +#ifdef XC_LOCK_USE_FCNTL + if (XC_LOCK_INTERPROCESS) { + xc_fcntl_init(&lck->fcntl_lock, pathname); + } +#endif + +#ifndef NDEBUG + lck->locked = 0; +#endif + + return lck; +} +/* }}} */ +void xc_lock_destroy(xc_lock_t *lck) /* {{{ */ +{ +#ifdef XC_LOCK_USE_PTHREAD + pthread_mutex_destroy(&lck->pthread_mutex); +#endif + +#ifdef XC_LOCK_USE_TSRM + tsrm_mutex_free(lck->tsrm_mutex); + lck->tsrm_mutex = NULL; +#endif + +#ifdef XC_LOCK_USE_FCNTL + if (XC_LOCK_INTERPROCESS) { + xc_fcntl_destroy(&lck->fcntl_lock); + } +#endif +} +/* }}} */ +void xc_lock(xc_lock_t *lck) /* {{{ */ +{ +#ifdef XC_LOCK_USE_PTHREAD + if (pthread_mutex_lock(&lck->pthread_mutex) < 0) { + zend_error(E_ERROR, "xc_lock failed errno:%d", errno); + } +#endif + +#ifdef XC_LOCK_USE_TSRM + if (tsrm_mutex_lock(lck->tsrm_mutex) < 0) { + zend_error(E_ERROR, "xc_lock failed errno:%d", errno); + } +#endif + +#ifdef XC_LOCK_USE_FCNTL + if (XC_LOCK_INTERPROCESS) { + xc_fcntl_lock(&lck->fcntl_lock); + } +#endif + +#ifndef NDEBUG + assert(!lck->locked); + lck->locked = 1; + assert(lck->locked); +#endif +} +/* }}} */ +void xc_rdlock(xc_lock_t *lck) /* {{{ */ +{ +#ifdef XC_LOCK_USE_PTHREAD + if (pthread_mutex_lock(&lck->pthread_mutex) < 0) { + zend_error(E_ERROR, "xc_rdlock failed errno:%d", errno); + } +#endif + +#ifdef XC_LOCK_USE_TSRM + if (tsrm_mutex_lock(lck->tsrm_mutex) < 0) { + zend_error(E_ERROR, "xc_rdlock failed errno:%d", errno); + } +#endif + +#ifdef XC_LOCK_USE_FCNTL + if (XC_LOCK_INTERPROCESS) { + xc_fcntl_lock(&lck->fcntl_lock); + } +#endif + +#ifndef NDEBUG + assert(!lck->locked); + lck->locked = 1; + assert(lck->locked); +#endif +} +/* }}} */ +void xc_unlock(xc_lock_t *lck) /* {{{ */ +{ +#ifndef NDEBUG + assert(lck->locked); + lck->locked = 0; + assert(!lck->locked); +#endif + +#ifdef XC_LOCK_USE_FCNTL + if (XC_LOCK_INTERPROCESS) { + xc_fcntl_unlock(&lck->fcntl_lock); + } +#endif + +#ifdef XC_LOCK_USE_TSRM + if (tsrm_mutex_unlock(lck->tsrm_mutex) < 0) { + zend_error(E_ERROR, "xc_unlock failed errno:%d", errno); + } +#endif + +#ifdef XC_LOCK_USE_PTHREAD + if (pthread_mutex_unlock(&lck->pthread_mutex) < 0) { + zend_error(E_ERROR, "xc_unlock failed errno:%d", errno); + } +#endif +} +/* }}} */ | ||
[+] | Changed | xcache-3.0.1.tar.bz2/xcache/xc_lock.h ^ |
@@ -5,16 +5,14 @@ #pragma once #endif /* _MSC_VER > 1000 */ -typedef struct _xc_lock_t xc_lock_t; +#include <stdlib.h> -xc_lock_t *xc_fcntl_init(const char *pathname); -void xc_fcntl_destroy(xc_lock_t *lck); -void xc_fcntl_lock(xc_lock_t *lck); -void xc_fcntl_unlock(xc_lock_t *lck); +typedef struct _xc_lock_t xc_lock_t; -#define xc_lock_init(name) xc_fcntl_init(name) -#define xc_lock_destroy(fd) xc_fcntl_destroy(fd) -#define xc_lock(fd) xc_fcntl_lock(fd) -#define xc_unlock(fd) xc_fcntl_unlock(fd) +size_t xc_lock_size(void); +xc_lock_t *xc_lock_init(xc_lock_t *lck, const char *pathname, unsigned char interprocess /* only with ZTS */); +void xc_lock_destroy(xc_lock_t *lck); +void xc_lock(xc_lock_t *lck); +void xc_unlock(xc_lock_t *lck); #endif /* XC_LOCK_H_1913F3DED68715D7CDA5A055E79FE0FF */ | ||
[+] | Changed | xcache-3.0.1.tar.bz2/xcache/xc_sandbox.c ^ |
@@ -229,6 +229,7 @@ #endif XG(sandbox) = (void *) sandbox; + XG(initial_compile_file_called) = 0; return sandbox; } /* }}} */ @@ -290,13 +291,16 @@ } #endif + /* CG(compiler_options) applies only if initial_compile_file_called */ + if (XG(initial_compile_file_called)) { #ifdef ZEND_COMPILE_DELAYED_BINDING - zend_do_delayed_early_binding(CG(active_op_array) TSRMLS_CC); + zend_do_delayed_early_binding(CG(active_op_array) TSRMLS_CC); #else - xc_undo_pass_two(CG(active_op_array) TSRMLS_CC); - xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC); - xc_redo_pass_two(CG(active_op_array) TSRMLS_CC); + xc_undo_pass_two(CG(active_op_array) TSRMLS_CC); + xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC); + xc_redo_pass_two(CG(active_op_array) TSRMLS_CC); #endif + } #ifdef XCACHE_ERROR_CACHING /* restore trigger errors */ | ||
[+] | Changed | xcache-3.0.1.tar.bz2/xcache/xc_utils.c ^ |
@@ -248,11 +248,14 @@ #ifdef ZEND_JMP_SET case ZEND_JMP_SET: #endif +#ifdef ZEND_JMP_SET_VAR + case ZEND_JMP_SET_VAR: +#endif assert(Z_OP(opline->op2).opline_num < op_array->last); Z_OP(opline->op2).jmp_addr = op_array->opcodes + Z_OP(opline->op2).opline_num; break; } - ZEND_VM_SET_OPCODE_HANDLER(opline); + /* ZEND_VM_SET_OPCODE_HANDLER(opline); this is not undone, don't redo. only do this for loader */ #endif opline++; } @@ -357,6 +360,9 @@ #ifdef ZEND_JMP_SET case ZEND_JMP_SET: #endif +#ifdef ZEND_JMP_SET_VAR + case ZEND_JMP_SET_VAR: +#endif next = begin + Z_OP(opline->op2).opline_num; break; @@ -573,9 +579,6 @@ p = source->pListHead; while (p) { if (checker(p->pData)) { - if (setTargetPointer && source->pInternalPointer == p) { - target->pInternalPointer = NULL; - } if (p->nKeyLength) { zend_u_hash_quick_update(target, p->key.type, ZSTR(BUCKET_KEY_S(p)), p->nKeyLength, p->h, p->pData, size, &new_entry); } else { @@ -584,6 +587,9 @@ if (pCopyConstructor) { pCopyConstructor(new_entry); } + if (setTargetPointer && source->pInternalPointer == p) { + target->pInternalPointer = new_entry; + } } p = p->pListNext; } | ||
[+] | Changed | xcache-3.0.1.tar.bz2/xcache_globals.h ^ |
@@ -1,7 +1,7 @@ #include "util/xc_stack.h" ZEND_BEGIN_MODULE_GLOBALS(xcache) - zend_bool initial_compile_file_called; /* true is origin_compile_file is called */ + zend_bool initial_compile_file_called; /* true if origin_compile_file is called */ zend_bool cacher; /* true if enabled */ zend_bool stat; zend_bool experimental; @@ -28,6 +28,9 @@ zval var_namespace_soft; zend_llist gc_op_arrays; +#ifdef ZEND_ACC_ALIAS + zend_llist gc_class_entries; +#endif #ifdef HAVE_XCACHE_CONSTANT HashTable internal_constant_table; |