Changeset 625 for branches/1.3/xcache.c
- Timestamp:
- 2009-07-05T11:01:49+02:00 (4 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
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;
Note: See TracChangeset
for help on using the changeset viewer.

