Changeset 625 for branches/1.3
- Timestamp:
- 2009-07-05T11:01:49+02:00 (4 years ago)
- Location:
- branches/1.3
- Files:
-
- 13 edited
- 1 copied
-
. (modified) (1 prop)
-
ChangeLog (modified) (2 diffs)
-
NEWS (modified) (1 diff)
-
admin/common.php (modified) (1 diff)
-
admin/mkpassword.php (copied) (copied from trunk/admin/mkpassword.php)
-
admin/xcache.php (modified) (1 diff)
-
coverager.c (modified) (4 diffs)
-
mem.c (modified) (2 diffs)
-
mmap.c (modified) (1 diff)
-
processor/processor.m4 (modified) (4 diffs)
-
utils.c (modified) (6 diffs)
-
utils.h (modified) (4 diffs)
-
xcache.c (modified) (15 diffs)
-
xcache.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/ChangeLog
r624 r625 1 1 1.3.0 2009-??-?? 2 2 == ChangeLog == 3 * PHP 5.3 Supported 3 4 * fixed #138: no segv if cache is not initialized correctly 4 5 * default to 64M for xcache.size in xcache.ini … … 6 7 * wrong http auth realm 7 8 * coverager: font-size and newline fix for firefox 8 * PHP 5.3 Supported9 * admin page is now magic quote gpc aware 9 10 10 11 1.2.2 2007-12-29 -
branches/1.3/NEWS
r624 r625 4 4 * many cacher/coverager bug fixes 5 5 * improved admin pages 6 * admin page is now magic quote gpc aware 6 7 7 8 1.2.2 2007-12-29 -
branches/1.3/admin/common.php
r623 r625 92 92 define('REQUEST_TIME', time()); 93 93 94 if ( get_magic_quotes_gpc()) {94 if (function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc()) { 95 95 $mqs = (bool) ini_get('magic_quotes_sybase'); 96 96 $_GET = stripaddslashes_array($_GET, $mqs); -
branches/1.3/admin/xcache.php
r623 r625 130 130 else { 131 131 switch ($k) { 132 case 'hi s_by_hour':133 case 'hi s_by_second':132 case 'hits_by_hour': 133 case 'hits_by_second': 134 134 foreach ($data[$k] as $kk => $vv) { 135 135 $total[$k][$kk] += $vv; -
branches/1.3/coverager.c
r623 r625 1 #if 0 2 #define XCACHE_DEBUG 3 #endif 4 1 5 #include <stdio.h> 2 6 #include "xcache.h" … … 18 22 static char *xc_coveragedump_dir = NULL; 19 23 static zend_compile_file_t *old_compile_file = NULL; 20 21 #if 022 #define DEBUG23 #endif24 24 25 25 /* dumper */ … … 246 246 if (XG(coverager)) { 247 247 xc_coverager_enable(TSRMLS_C); 248 #ifdef ZEND_COMPILE_EXTENDED_INFO 249 CG(compiler_options) |= ZEND_COMPILE_EXTENDED_INFO; 250 #else 248 251 CG(extended_info) = 1; 252 #endif 249 253 } 250 254 else { … … 470 474 471 475 if (cfg_get_string("xcache.coveragedump_directory", &xc_coveragedump_dir) == SUCCESS && xc_coveragedump_dir) { 476 int len; 472 477 xc_coveragedump_dir = pestrdup(xc_coveragedump_dir, 1); 473 intlen = strlen(xc_coveragedump_dir);478 len = strlen(xc_coveragedump_dir); 474 479 if (len) { 475 480 if (xc_coveragedump_dir[len - 1] == '/') { -
branches/1.3/mem.c
r593 r625 2 2 #include <limits.h> 3 3 #include <stdio.h> 4 # define XCACHE_DEBUG 4 5 #else 5 6 #include <php.h> 6 7 #endif 8 9 #ifdef XCACHE_DEBUG 10 # define ALLOC_DEBUG_BLOCK_CHECK 11 #endif 12 7 13 8 14 #include <assert.h> … … 14 20 #include "align.h" 15 21 #include "utils.h" 16 17 #ifdef TEST18 # define DEBUG19 #endif20 #ifdef DEBUG21 # define ALLOC_DEBUG_BLOCK_CHECK22 #endif23 22 24 23 #if 0 -
branches/1.3/mmap.c
r593 r625 199 199 if (shm->ptr == XCACHE_MAP_FAILED) { 200 200 perror(shm->name); 201 errstr = "Failed creating file mapp ping";201 errstr = "Failed creating file mapping"; 202 202 shm->ptr = NULL; 203 203 goto err; -
branches/1.3/processor/processor.m4
r623 r625 506 506 dnl main op_array && have early binding 507 507 zend_uint ii; 508 if (!processor->readonly_protection && !(src == processor->xce_src->data.php->op_array && processor->xce_src->data.php->have_early_binding)) { 508 #ifdef ZEND_COMPILE_DELAYED_BINDING 509 zend_bool need_early_binding = 0; 510 #else 511 zend_bool need_early_binding = processor->xce_src->data.php->have_early_binding; 512 #endif 513 if (!processor->readonly_protection && !(src == processor->xce_src->data.php->op_array && need_early_binding)) { 509 514 /* really fast shallow copy */ 510 515 memcpy(dst, src, sizeof(src[0])); … … 633 638 PROC_ZSTRING_L(, doc_comment, doc_comment_len) 634 639 #endif 640 #ifdef ZEND_COMPILE_DELAYED_BINDING 641 DISPATCH(zend_uint, early_binding); 642 #endif 635 643 636 644 /* reserved */ … … 730 738 STRUCT(zend_class_entry, cest) 731 739 #endif 740 #ifndef ZEND_COMPILE_DELAYED_BINDING 732 741 DISPATCH(int, oplineno) 742 #endif 733 743 ') 734 744 dnl }}} … … 783 793 ') 784 794 #endif 795 #ifndef ZEND_COMPILE_DELAYED_BINDING 785 796 DISPATCH(zend_bool, have_early_binding) 797 #endif 798 DISPATCH(zend_bool, have_references) 786 799 ') 787 800 dnl }}} -
branches/1.3/utils.c
r623 r625 500 500 ZESW(&stored_ce_ptr, NULL) 501 501 ); 502 #ifndef ZEND_COMPILE_DELAYED_BINDING 502 503 if (oplineno != -1) { 503 504 xc_do_early_binding(CG(active_op_array), CG(class_table), oplineno TSRMLS_CC); 504 505 } 506 #endif 505 507 } 506 508 else if (zend_u_hash_quick_add(CG(class_table), type, key, len, h, … … 526 528 #define OG(x) (sandbox->orig_##x) 527 529 /* }}} */ 530 <<<<<<< .working 531 ======= 532 #ifdef E_STRICT 533 static void xc_sandbox_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) /* {{{ */ 534 { 535 xc_compilererror_t *compilererror; 536 xc_sandbox_t *sandbox; 537 TSRMLS_FETCH(); 538 539 sandbox = (xc_sandbox_t *) XG(sandbox); 540 assert(sandbox != NULL); 541 if (type != E_STRICT) { 542 /* give up, and user handler is not supported in this case */ 543 zend_uint i; 544 zend_uint orig_lineno = CG(zend_lineno); 545 zend_error_cb = sandbox->orig_zend_error_cb; 546 547 for (i = 0; i < sandbox->compilererror_cnt; i ++) { 548 compilererror = &sandbox->compilererrors[i]; 549 CG(zend_lineno) = compilererror->lineno; 550 zend_error(E_STRICT, "%s", compilererror->error); 551 } 552 CG(zend_lineno) = orig_lineno; 553 sandbox->compilererror_cnt = 0; 554 555 sandbox->orig_zend_error_cb(type, error_filename, error_lineno, format, args); 556 return; 557 } 558 559 if (sandbox->compilererror_cnt <= sandbox->compilererror_size) { 560 if (sandbox->compilererror_size) { 561 sandbox->compilererror_size += 16; 562 sandbox->compilererrors = erealloc(sandbox->compilererrors, sandbox->compilererror_size * sizeof(sandbox->compilererrors)); 563 } 564 else { 565 sandbox->compilererror_size = 16; 566 sandbox->compilererrors = emalloc(sandbox->compilererror_size * sizeof(sandbox->compilererrors)); 567 } 568 } 569 compilererror = &sandbox->compilererrors[sandbox->compilererror_cnt++]; 570 compilererror->lineno = error_lineno; 571 compilererror->error_len = vspprintf(&compilererror->error, 0, format, args); 572 } 573 /* }}} */ 574 #endif 575 >>>>>>> .merge-right.r559 528 576 #ifdef ZEND_ENGINE_2_1 529 577 static zend_bool xc_auto_global_callback(char *name, uint name_len TSRMLS_DC) /* {{{ */ … … 625 673 #endif 626 674 675 #ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES 676 sandbox->orig_compiler_options = CG(compiler_options); 677 /* Using ZEND_COMPILE_IGNORE_INTERNAL_CLASSES for ZEND_FETCH_CLASS_RT_NS_CHECK 678 */ 679 CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_DELAYED_BINDING; 680 #endif 681 682 XG(sandbox) = (void *) sandbox; 627 683 return sandbox; 628 684 } … … 636 692 static void xc_sandbox_install(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC) /* {{{ */ 637 693 { 638 int i;694 zend_uint i; 639 695 Bucket *b; 640 696 … … 679 735 680 736 if (install != XC_InstallNoBinding) { 737 #ifdef ZEND_COMPILE_DELAYED_BINDING 738 zend_do_delayed_early_binding(CG(active_op_array) TSRMLS_CC); 739 #else 681 740 xc_undo_pass_two(CG(active_op_array) TSRMLS_CC); 682 741 xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC); 683 742 xc_redo_pass_two(CG(active_op_array) TSRMLS_CC); 743 #endif 684 744 } 685 745 … … 735 795 #endif 736 796 797 #ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES 798 CG(compiler_options) = sandbox->orig_compiler_options; 799 #endif 800 737 801 if (sandbox->alloc) { 738 802 efree(sandbox); -
branches/1.3/utils.h
r623 r625 2 2 #include "xcache.h" 3 3 4 #ifdef DEBUG4 #ifdef XCACHE_DEBUG 5 5 # define IFDEBUG(x) (x) 6 6 int xc_vtrace(const char *fmt, va_list args); … … 25 25 # undef inline 26 26 # define inline 27 #else /* DEBUG */27 #else /* XCACHE_DEBUG */ 28 28 29 29 # ifdef ZEND_WIN32 … … 41 41 # define NDEBUG 42 42 # endif 43 #endif /* DEBUG */43 #endif /* XCACHE_DEBUG */ 44 44 #include <assert.h> 45 45 … … 101 101 int orig_user_error_handler_error_reporting; 102 102 #endif 103 104 #ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES 105 zend_uint orig_compiler_options; 106 #endif 103 107 } xc_sandbox_t; 104 108 -
branches/1.3/xcache.c
r623 r625 1 1 2 2 #if 0 3 #define DEBUG3 #define XCACHE_DEBUG 4 4 #endif 5 5 … … 23 23 24 24 #include "xcache.h" 25 #ifdef ZEND_ENGINE_2_1 26 #include "ext/date/php_date.h" 27 #endif 25 28 #include "optimizer.h" 26 29 #include "coverager.h" … … 652 655 new_cest_ptrs[i] = 653 656 #endif 657 #ifdef ZEND_COMPILE_DELAYED_BINDING 658 xc_install_class(xce->name.str.val, &ci->cest, -1, 659 UNISW(0, ci->type), ci->key, ci->key_size, ci->h TSRMLS_CC); 660 #else 654 661 xc_install_class(xce->name.str.val, &ci->cest, ci->oplineno, 655 662 UNISW(0, ci->type), ci->key, ci->key_size, ci->h TSRMLS_CC); 663 #endif 656 664 } 657 665 … … 750 758 751 759 #define HASH(i) (i) 752 #define HASH_ USTR_L(t, s, l) HASH(zend_u_inline_hash_func(t, s, (l + 1) * sizeof(UChar)))760 #define HASH_ZSTR_L(t, s, l) HASH(zend_u_inline_hash_func(t, s, (l + 1) * sizeof(UChar))) 753 761 #define HASH_STR_L(s, l) HASH(zend_inline_hash_func(s, l + 1)) 754 762 #define HASH_STR(s) HASH_STR_L(s, strlen(s) + 1) … … 766 774 static inline xc_hash_value_t xc_entry_hash_name(xc_entry_t *xce TSRMLS_DC) /* {{{ */ 767 775 { 768 return UNISW(NOTHING, UG(unicode) ? HASH_ USTR_L(xce->name_type, xce->name.uni.val, xce->name.uni.len) :)776 return UNISW(NOTHING, UG(unicode) ? HASH_ZSTR_L(xce->name_type, xce->name.uni.val, xce->name.uni.len) :) 769 777 HASH_STR_L(xce->name.str.val, xce->name.str.len); 770 778 } … … 893 901 } 894 902 /* }}} */ 903 #ifndef ZEND_COMPILE_DELAYED_BINDING 895 904 static void xc_cache_early_binding_class_cb(zend_op *opline, int oplineno, void *data TSRMLS_DC) /* {{{ */ 896 905 { … … 920 929 } 921 930 /* }}} */ 931 #endif 922 932 static zend_op_array *xc_check_initial_compile_file(zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 923 933 { … … 938 948 char opened_path_buffer[MAXPATHLEN]; 939 949 int old_constinfo_cnt, old_funcinfo_cnt, old_classinfo_cnt; 940 int i;941 950 942 951 if (!xc_initized) { … … 1180 1189 } 1181 1190 /* }}} */ 1191 #ifndef ZEND_COMPILE_DELAYED_BINDING 1182 1192 /* {{{ find inherited classes that should be early-binding */ 1183 1193 php.have_early_binding = 0; 1184 for (i = 0; i < php.classinfo_cnt; i ++) { 1185 php.classinfos[i].oplineno = -1; 1194 { 1195 int i; 1196 for (i = 0; i < php.classinfo_cnt; i ++) { 1197 php.classinfos[i].oplineno = -1; 1198 } 1186 1199 } 1187 1200 … … 1190 1203 xc_redo_pass_two(php.op_array TSRMLS_CC); 1191 1204 /* }}} */ 1205 #endif 1206 1192 1207 #ifdef SHOW_DPRINT 1193 1208 xc_dprint(&xce, 0 TSRMLS_CC); … … 1711 1726 1712 1727 if (admin_user == NULL || admin_pass == NULL) { 1713 php_error_docref(NULL TSRMLS_CC, E_ERROR, "xcache.admin.user and xcache.admin.pass is required"); 1728 php_error_docref(XCACHE_WIKI_URL "/InstallAdministration" TSRMLS_CC, E_ERROR, 1729 "xcache.admin.user and/or xcache.admin.pass settings is not configured." 1730 " Make sure you've modified the correct php ini file for your php used in webserver."); 1714 1731 zend_bailout(); 1715 1732 } 1716 1733 if (strlen(admin_pass) != 32) { 1717 php_error_docref(NULL TSRMLS_CC, E_ERROR, " unexpect %lu bytes of xcache.admin.pass, expected 32 bytes, the password after md5()", (unsigned long) strlen(admin_pass));1734 php_error_docref(NULL TSRMLS_CC, E_ERROR, "xcache.admin.pass is %lu chars unexpectedly, it is supposed to be the password after md5() which should be 32 chars", (unsigned long) strlen(admin_pass)); 1718 1735 zend_bailout(); 1719 1736 } … … 1764 1781 sapi_add_header_ex(STR, sizeof(STR) - 1, 1, 1 TSRMLS_CC); 1765 1782 #undef STR 1766 ZEND_PUTS("XCache Auth Failed. User and Password is case sense\n"); 1783 #define STR "Content-type: text/html; charset=UTF-8" 1784 sapi_add_header_ex(STR, sizeof(STR) - 1, 1, 1 TSRMLS_CC); 1785 #undef STR 1786 ZEND_PUTS("<html>\n"); 1787 ZEND_PUTS("<head><title>XCache Authentication Failed</title></head>\n"); 1788 ZEND_PUTS("<body>\n"); 1789 ZEND_PUTS("<h1>XCache Authentication Failed</h1>\n"); 1790 ZEND_PUTS("<p>You're not authorized to access this page due to wrong username and/or password you typed.<br />The following check points is suggested:</p>\n"); 1791 ZEND_PUTS("<ul>\n"); 1792 ZEND_PUTS("<li>Be aware that `Username' and `Password' is case sense. Check capslock status led on your keyboard, and punch left/right Shift keys once for each</li>\n"); 1793 ZEND_PUTS("<li>Make sure the md5 password is generated correctly. You may use <a href=\"mkpassword.php\">mkpassword.php</a></li>\n"); 1794 ZEND_PUTS("<li>Reload browser cache by pressing F5 and/or Ctrl+F5, or simply clear browser cache after you've updated username/password in php ini.</li>\n"); 1795 ZEND_PUTS("</ul>\n"); 1796 ZEND_PUTS("Check <a href=\"" XCACHE_WIKI_URL "/InstallAdministration\">XCache wiki page</a> for more information.\n"); 1797 ZEND_PUTS("</body>\n"); 1798 ZEND_PUTS("</html>\n"); 1767 1799 1768 1800 zend_bailout(); … … 2560 2592 php_info_print_table_row(2, "Modules Built", XCACHE_MODULES); 2561 2593 php_info_print_table_row(2, "Readonly Protection", xc_readonly_protection ? "enabled" : "N/A"); 2594 #ifdef ZEND_ENGINE_2_1 2562 2595 ptr = php_format_date("Y-m-d H:i:s", sizeof("Y-m-d H:i:s") - 1, xc_init_time, 1 TSRMLS_CC); 2563 2596 php_info_print_table_row(2, "Cache Init Time", ptr); 2564 2597 efree(ptr); 2598 #else 2599 snprintf(buf, sizeof(buf), "%lu", (long unsigned) xc_init_time); 2600 php_info_print_table_row(2, "Cache Init Time", buf); 2601 #endif 2565 2602 2566 2603 #ifdef ZTS … … 2805 2842 xc_initized = 1; 2806 2843 xc_init_time = time(NULL); 2844 #ifdef PHP_WIN32 2845 xc_init_instance_id = GetCurrentProcessId(); 2846 #else 2807 2847 xc_init_instance_id = getpid(); 2848 #endif 2808 2849 #ifdef ZTS 2809 2850 xc_init_instance_subid = tsrm_thread_id(); … … 2979 3020 2980 3021 ext = (zend_extension *) zend_llist_get_last_ex(&zend_extensions, &lpos); 2981 assert(ext && ext != xc_llist_zend_extension);3022 assert(ext && ext != (zend_extension *) xc_llist_zend_extension->data); 2982 3023 xc_last_ext_startup = ext->startup; 2983 3024 ext->startup = xc_zend_startup_last; -
branches/1.3/xcache.h
r623 r625 6 6 #define XCACHE_COPYRIGHT "Copyright (c) 2005-2009" 7 7 #define XCACHE_URL "http://xcache.lighttpd.net" 8 #define XCACHE_WIKI_URL XCACHE_URL "/wiki" 8 9 9 10 #include <php.h> … … 39 40 #endif 40 41 41 #ifdef ALLOCA_FLAG 42 #ifdef do_alloca_with_limit 43 # define my_do_alloca(size, use_heap) do_alloca_with_limit(size, use_heap) 44 # define my_free_alloca(size, use_heap) free_alloca_with_limit(size, use_heap) 45 #elif defined(ALLOCA_FLAG) 42 46 # define my_do_alloca(size, use_heap) do_alloca(size, use_heap) 43 47 # define my_free_alloca(size, use_heap) free_alloca(size, use_heap) … … 238 242 ulong h; 239 243 xc_cest_t cest; 244 #ifndef ZEND_COMPILE_DELAYED_BINDING 240 245 int oplineno; 246 #endif 241 247 } xc_classinfo_t; 242 248 /* }}} */ … … 299 305 zend_uint classinfo_cnt; 300 306 xc_classinfo_t *classinfos; 307 #ifndef ZEND_COMPILE_DELAYED_BINDING 301 308 zend_bool have_early_binding; 309 #endif 302 310 303 311 #ifdef ZEND_ENGINE_2_1
Note: See TracChangeset
for help on using the changeset viewer.

