Re: [PHP-CVS] svn: /php/php-src/branches/ LEMON/Zend/zend_language_scanner_defs.h LEMON/main/main.c LEMON/main/php_main.h
Hi, wasn't supposed to commit the change below *yet*, but will do that in trunk soon too. cheers, Derick On Tue, 6 Jul 2010, Derick Rethans wrote: > Modified: php/php-src/branches/LEMON/main/main.c > === > --- php/php-src/trunk/main/main.c 2010-07-06 17:01:30 UTC (rev 301028) > +++ php/php-src/branches/LEMON/main/main.c2010-07-06 19:10:27 UTC (rev > 301029) > @@ -507,6 +507,11 @@ > static int module_startup = 1; > static int module_shutdown = 0; > > +PHPAPI int php_module_initialized(void) > +{ > + return module_initialized; > +} > + > /* {{{ php_during_module_startup */ > static int php_during_module_startup(void) > { > > Modified: php/php-src/branches/LEMON/main/php_main.h > === > --- php/php-src/trunk/main/php_main.h 2010-07-06 17:01:30 UTC (rev 301028) > +++ php/php-src/branches/LEMON/main/php_main.h2010-07-06 19:10:27 UTC > (rev 301029) > @@ -27,6 +27,7 @@ > #include "SAPI.h" > > BEGIN_EXTERN_C() > +PHPAPI int php_module_initialized(void); > PHPAPI int php_request_startup(TSRMLS_D); > PHPAPI void php_request_shutdown(void *dummy); > PHPAPI void php_request_shutdown_for_exec(void *dummy); > > -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/ LEMON/Zend/zend_language_scanner_defs.h LEMON/main/main.c LEMON/main/php_main.h
derick Tue, 06 Jul 2010 19:10:27 + Revision: http://svn.php.net/viewvc?view=revision&revision=301029 Log: - The Lemon branch. Changed paths: A + php/php-src/branches/LEMON/ (from php/php-src/trunk/:r301028) U php/php-src/branches/LEMON/Zend/zend_language_scanner_defs.h U php/php-src/branches/LEMON/main/main.c U php/php-src/branches/LEMON/main/php_main.h Modified: php/php-src/branches/LEMON/Zend/zend_language_scanner_defs.h === --- php/php-src/trunk/Zend/zend_language_scanner_defs.h 2010-07-06 17:01:30 UTC (rev 301028) +++ php/php-src/branches/LEMON/Zend/zend_language_scanner_defs.h 2010-07-06 19:10:27 UTC (rev 301029) @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Mon May 24 14:07:57 2010 */ +/* Generated by re2c 0.13.5 on Tue May 25 10:04:31 2010 */ #line 3 "Zend/zend_language_scanner_defs.h" enum YYCONDTYPE { Modified: php/php-src/branches/LEMON/main/main.c === --- php/php-src/trunk/main/main.c 2010-07-06 17:01:30 UTC (rev 301028) +++ php/php-src/branches/LEMON/main/main.c 2010-07-06 19:10:27 UTC (rev 301029) @@ -507,6 +507,11 @@ static int module_startup = 1; static int module_shutdown = 0; +PHPAPI int php_module_initialized(void) +{ + return module_initialized; +} + /* {{{ php_during_module_startup */ static int php_during_module_startup(void) { Modified: php/php-src/branches/LEMON/main/php_main.h === --- php/php-src/trunk/main/php_main.h 2010-07-06 17:01:30 UTC (rev 301028) +++ php/php-src/branches/LEMON/main/php_main.h 2010-07-06 19:10:27 UTC (rev 301029) @@ -27,6 +27,7 @@ #include "SAPI.h" BEGIN_EXTERN_C() +PHPAPI int php_module_initialized(void); PHPAPI int php_request_startup(TSRMLS_D); PHPAPI void php_request_shutdown(void *dummy); PHPAPI void php_request_shutdown_for_exec(void *dummy); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/json/json.c trunk/ext/json/json.c
scottmac Tue, 06 Jul 2010 17:01:30 + Revision: http://svn.php.net/viewvc?view=revision&revision=301028 Log: Fix bug #52262 - Invalid UTF-8 documents don't set an error code when they fail to decode. Bug: http://bugs.php.net/52262 (Assigned) json_decode reports no error while returning NULL Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/json/json.c U php/php-src/trunk/ext/json/json.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-07-06 16:09:43 UTC (rev 301027) +++ php/php-src/branches/PHP_5_3/NEWS 2010-07-06 17:01:30 UTC (rev 301028) @@ -1,6 +1,8 @@ PHPNEWS ||| ?? Jul 2010, PHP 5.3.3 RC3 +- Fixed bug #52262 (json_decode() shows no errors on invalid UTF-8). + (Scott) - Fixed bug #52240 (hash_copy() does not copy the HMAC key, causes wrong results and PHP crashes). (Felipe) - Fixed bug #52238 (Crash when an Exception occured in iterator_to_array). Modified: php/php-src/branches/PHP_5_3/ext/json/json.c === --- php/php-src/branches/PHP_5_3/ext/json/json.c2010-07-06 16:09:43 UTC (rev 301027) +++ php/php-src/branches/PHP_5_3/ext/json/json.c2010-07-06 17:01:30 UTC (rev 301028) @@ -500,6 +500,7 @@ if (utf16) { efree(utf16); } + JSON_G(error_code) = PHP_JSON_ERROR_UTF8; RETURN_NULL(); } Modified: php/php-src/trunk/ext/json/json.c === --- php/php-src/trunk/ext/json/json.c 2010-07-06 16:09:43 UTC (rev 301027) +++ php/php-src/trunk/ext/json/json.c 2010-07-06 17:01:30 UTC (rev 301028) @@ -560,6 +560,7 @@ if (utf16) { efree(utf16); } + JSON_G(error_code) = PHP_JSON_ERROR_UTF8; RETURN_NULL(); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/zend_stack.c
dmitry Tue, 06 Jul 2010 16:09:43 + Revision: http://svn.php.net/viewvc?view=revision&revision=301027 Log: zend_stack initialization is delayed before the actual usage Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/Zend/zend_stack.c Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2010-07-06 15:52:39 UTC (rev 301026) +++ php/php-src/trunk/NEWS 2010-07-06 16:09:43 UTC (rev 301027) @@ -18,6 +18,7 @@ A constant class name may be used as a direct operand of ZEND_FETCH_* instruction without previous ZEND_FETCH_CLASS. . eliminated unnecessary iterations during request startup/shutdown + . zend_stack initialization is delayed before the actual usage - Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed. (Dmitry) - Added an optimization which saves memory and emalloc/efree calls for empty Modified: php/php-src/trunk/Zend/zend_stack.c === --- php/php-src/trunk/Zend/zend_stack.c 2010-07-06 15:52:39 UTC (rev 301026) +++ php/php-src/trunk/Zend/zend_stack.c 2010-07-06 16:09:43 UTC (rev 301027) @@ -25,13 +25,9 @@ ZEND_API int zend_stack_init(zend_stack *stack) { stack->top = 0; - stack->elements = (void **) emalloc(sizeof(void **) * STACK_BLOCK_SIZE); - if (!stack->elements) { - return FAILURE; - } else { - stack->max = STACK_BLOCK_SIZE; - return SUCCESS; - } + stack->max = 0; + stack->elements = NULL; + return SUCCESS; } ZEND_API int zend_stack_push(zend_stack *stack, const void *element, int size) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_API.c zend_compile.h zend_opcode.c
felipe Tue, 06 Jul 2010 15:52:39 + Revision: http://svn.php.net/viewvc?view=revision&revision=301026 Log: - Fix ZTS build Changed paths: U php/php-src/trunk/Zend/zend_API.c U php/php-src/trunk/Zend/zend_compile.h U php/php-src/trunk/Zend/zend_opcode.c Modified: php/php-src/trunk/Zend/zend_API.c === --- php/php-src/trunk/Zend/zend_API.c 2010-07-06 13:37:55 UTC (rev 301025) +++ php/php-src/trunk/Zend/zend_API.c 2010-07-06 15:52:39 UTC (rev 301026) @@ -1685,7 +1685,7 @@ } /* }}} */ -static void zend_collect_module_handlers(void) /* {{{ */ +static void zend_collect_module_handlers(TSRMLS_D) /* {{{ */ { HashPosition pos; zend_module_entry *module; @@ -1767,7 +1767,7 @@ { zend_hash_sort(&module_registry, zend_sort_modules, NULL, 0 TSRMLS_CC); zend_hash_apply(&module_registry, (apply_func_t)zend_startup_module_ex TSRMLS_CC); - zend_collect_module_handlers(); + zend_collect_module_handlers(TSRMLS_C); return SUCCESS; } /* }}} */ Modified: php/php-src/trunk/Zend/zend_compile.h === --- php/php-src/trunk/Zend/zend_compile.h 2010-07-06 13:37:55 UTC (rev 301025) +++ php/php-src/trunk/Zend/zend_compile.h 2010-07-06 15:52:39 UTC (rev 301026) @@ -616,7 +616,7 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC); ZEND_API int zend_cleanup_user_class_data(zend_class_entry **pce TSRMLS_DC); ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce TSRMLS_DC); -ZEND_API void zend_cleanup_internal_classes(TSRMLS_C); +ZEND_API void zend_cleanup_internal_classes(TSRMLS_D); ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC); ZEND_API int zend_cleanup_function_data_full(zend_function *function TSRMLS_DC); Modified: php/php-src/trunk/Zend/zend_opcode.c === --- php/php-src/trunk/Zend/zend_opcode.c2010-07-06 13:37:55 UTC (rev 301025) +++ php/php-src/trunk/Zend/zend_opcode.c2010-07-06 15:52:39 UTC (rev 301026) @@ -190,7 +190,7 @@ } efree(CE_STATIC_MEMBERS(ce)); #ifdef ZTS - CG(static_members_table)[(zend_intptr_t)((ce->static_members_table)] = NULL; + CG(static_members_table)[(zend_intptr_t)(ce->static_members_table)] = NULL; #else ce->static_members_table = NULL; #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ NEWS Zend/zend.c Zend/zend_API.c Zend/zend_API.h Zend/zend_compile.c Zend/zend_compile.h Zend/zend_execute_API.c Zend/zend_opcode.c
dmitry Tue, 06 Jul 2010 11:40:17 + Revision: http://svn.php.net/viewvc?view=revision&revision=301021 Log: eliminated unnecessary iterations during request startup/shutdown Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/Zend/zend.c U php/php-src/trunk/Zend/zend_API.c U php/php-src/trunk/Zend/zend_API.h U php/php-src/trunk/Zend/zend_compile.c U php/php-src/trunk/Zend/zend_compile.h U php/php-src/trunk/Zend/zend_execute_API.c U php/php-src/trunk/Zend/zend_opcode.c Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2010-07-06 11:37:19 UTC (rev 301020) +++ php/php-src/trunk/NEWS 2010-07-06 11:40:17 UTC (rev 301021) @@ -17,6 +17,7 @@ . optimized access to static properties using executor specialization. A constant class name may be used as a direct operand of ZEND_FETCH_* instruction without previous ZEND_FETCH_CLASS. + . eliminated unnecessary iterations during request startup/shutdown - Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed. (Dmitry) - Added an optimization which saves memory and emalloc/efree calls for empty Modified: php/php-src/trunk/Zend/zend.c === --- php/php-src/trunk/Zend/zend.c 2010-07-06 11:37:19 UTC (rev 301020) +++ php/php-src/trunk/Zend/zend.c 2010-07-06 11:40:17 UTC (rev 301021) @@ -761,7 +761,7 @@ zend_shutdown_timeout_thread(); #endif zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); - zend_hash_graceful_reverse_destroy(&module_registry); + zend_destroy_modules(); zend_hash_destroy(GLOBAL_FUNCTION_TABLE); zend_hash_destroy(GLOBAL_CLASS_TABLE); @@ -859,22 +859,6 @@ } /* }}} */ -void zend_activate_modules(TSRMLS_D) /* {{{ */ -{ - zend_hash_apply(&module_registry, (apply_func_t) module_registry_request_startup TSRMLS_CC); -} -/* }}} */ - -void zend_deactivate_modules(TSRMLS_D) /* {{{ */ -{ - EG(opline_ptr) = NULL; /* we're no longer executing anything */ - - zend_try { - zend_hash_reverse_apply(&module_registry, (apply_func_t) module_registry_cleanup TSRMLS_CC); - } zend_end_try(); -} -/* }}} */ - void zend_call_destructors(TSRMLS_D) /* {{{ */ { zend_try { @@ -928,22 +912,6 @@ } /* }}} */ -static int exec_done_cb(zend_module_entry *module TSRMLS_DC) /* {{{ */ -{ - if (module->post_deactivate_func) { - module->post_deactivate_func(); - } - return 0; -} -/* }}} */ - -void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */ -{ - zend_hash_apply(&module_registry, (apply_func_t) exec_done_cb TSRMLS_CC); - zend_hash_reverse_apply(&module_registry, (apply_func_t) module_registry_unload_temp TSRMLS_CC); -} -/* }}} */ - BEGIN_EXTERN_C() ZEND_API void zend_message_dispatcher(long message, void *data TSRMLS_DC) /* {{{ */ { Modified: php/php-src/trunk/Zend/zend_API.c === --- php/php-src/trunk/Zend/zend_API.c 2010-07-06 11:37:19 UTC (rev 301020) +++ php/php-src/trunk/Zend/zend_API.c 2010-07-06 11:40:17 UTC (rev 301021) @@ -36,6 +36,12 @@ static int module_count=0; ZEND_API HashTable module_registry; +static zend_module_entry **module_request_startup_handlers; +static zend_module_entry **module_request_shutdown_handlers; +static zend_module_entry **module_post_deactivate_handlers; + +static zend_class_entry **class_cleanup_handlers; + /* this function doesn't check for too many parameters */ ZEND_API int zend_get_parameters(int ht, int param_count, ...) /* {{{ */ { @@ -1679,14 +1685,101 @@ } /* }}} */ +static void zend_collect_module_handlers(void) /* {{{ */ +{ + HashPosition pos; + zend_module_entry *module; + int startup_count = 0; + int shutdown_count = 0; + int post_deactivate_count = 0; + zend_class_entry **pce; + int class_count = 0; + + /* Collect extensions with request startup/shutdown handlers */ + for (zend_hash_internal_pointer_reset_ex(&module_registry, &pos); + zend_hash_get_current_data_ex(&module_registry, (void *) &module, &pos) == SUCCESS; + zend_hash_move_forward_ex(&module_registry, &pos)) { + if (module->request_startup_func) { + startup_count++; + } + if (module->request_shutdown_func) { + shutdown_count++; + } + if (module->post_deactivate_func) { + post_deactivate_count++; + } + } + module_request_startup_handlers = (zend_module_entry**)malloc( + sizeof(zend_module_entry*) * + (startup_count + 1 + + shutdown_count + 1 + + post_deactivate_count + 1)); + module_request_startup_handlers[startup_count] = NULL; + module_request_shutdown_handlers = module_request_startup_handlers + startup_count + 1; + module_request_shutdown_handlers[shutdown_count] = NULL; + module_post_deactivate_handlers = module_request_shutdown_handlers + shutdown_count + 1; + module_post_deactivate_handlers[post_deactivate_count] = NULL; + st
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c trunk/sapi/fpm/fpm/fpm_conf.c
tony2001 Tue, 06 Jul 2010 11:37:19 + Revision: http://svn.php.net/viewvc?view=revision&revision=301020 Log: fix typos and use correct directive names in error messages Changed paths: U php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c U php/php-src/trunk/sapi/fpm/fpm/fpm_conf.c Modified: php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c === --- php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c 2010-07-06 09:43:49 UTC (rev 301019) +++ php/php-src/branches/PHP_5_3/sapi/fpm/fpm/fpm_conf.c 2010-07-06 11:37:19 UTC (rev 301020) @@ -436,7 +436,7 @@ } if (wp->config->pm_max_children < 1) { - zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] pm_max_children must be a positiive value", wp->config->name); + zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] pm.max_children must be a positive value", wp->config->name); return -1; } @@ -444,32 +444,32 @@ struct fpm_worker_pool_config_s *config = wp->config; if (config->pm_min_spare_servers <= 0) { -zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] min_spare_servers(%d) must be a positive value", wp->config->name, config->pm_min_spare_servers); +zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] pm.min_spare_servers(%d) must be a positive value", wp->config->name, config->pm_min_spare_servers); return -1; } if (config->pm_max_spare_servers <= 0) { -zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] max_spare_servers(%d) must be a positive value", wp->config->name, config->pm_max_spare_servers); +zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] pm.max_spare_servers(%d) must be a positive value", wp->config->name, config->pm_max_spare_servers); return -1; } if (config->pm_min_spare_servers > config->pm_max_children || config->pm_max_spare_servers > config->pm_max_children) { -zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] min_spare_servers(%d) and max_spare_servers(%d) cannot be greater than max_children(%d)", +zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] pm.min_spare_servers(%d) and pm.max_spare_servers(%d) cannot be greater than pm.max_children(%d)", wp->config->name, config->pm_min_spare_servers, config->pm_max_spare_servers, config->pm_max_children); return -1; } if (config->pm_max_spare_servers < config->pm_min_spare_servers) { -zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] max_spare_servers(%d) must not be less than min_spare_servers(%d)", wp->config->name, config->pm_max_spare_servers, config->pm_min_spare_servers); +zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] pm.max_spare_servers(%d) must not be less than pm.min_spare_servers(%d)", wp->config->name, config->pm_max_spare_servers, config->pm_min_spare_servers); return -1; } if (config->pm_start_servers <= 0) { config->pm_start_servers = config->pm_min_spare_servers + ((config->pm_max_spare_servers - config->pm_min_spare_servers) / 2); -zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] start_servers is not set. It's been set to %d.", wp->config->name, config->pm_start_servers); +zlog(ZLOG_STUFF, ZLOG_WARNING, "[pool %s] pm.start_servers is not set. It's been set to %d.", wp->config->name, config->pm_start_servers); } else if (config->pm_start_servers < config->pm_min_spare_servers || config->pm_start_servers > config->pm_max_spare_servers) { -zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] start_servers(%d) must not be less than min_spare_servers(%d) and not greater than max_spare_servers(%d)", wp->config->name, config->pm_start_servers, config->pm_min_spare_servers, config->pm_max_spare_servers); +zlog(ZLOG_STUFF, ZLOG_ALERT, "[pool %s] pm.start_servers(%d) must not be less than pm.min_spare_servers(%d) and not greater than pm.max_spare_servers(%d)", wp->config->name, config->pm_start_servers, config->pm_min_spare_servers, config->pm_max_spare_servers); return -1; } @@ -563,7 +563,7 @@ for (i=0; iconfig->name, status); + zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] the status path '%s' must contain only the following characters '[alphanum]/_-.'", wp->config->name, status); return -1; } } @@ -607,7 +607,7 @@ } snprintf(buf, len, "%s%s", wp->config->chroot, wp->config->chdir); if (!fpm_conf_is_dir(buf)) { - zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] the chdir path '%s' wihtin the chroot path '%s' ('%s') does not exist or is not a directory", wp->config->name, wp->config->chdir, wp->config->chroot, buf); + zlog(ZLOG_STUFF, ZLOG_ERROR, "[pool %s] the chdir path '%s' within the chroot path '%s' ('%s') does not exist or is not a directory", wp->config->name, wp->config->chdir, wp->config->chroot, buf); free(buf); return -1; } @@ -714,7 +714,7 @@ if ((i = glob(inc, GLOB_ERR | GLOB_MARK | GLOB_NOSORT, NULL, &g)) != 0) { #ifdef GLOB_NOMATCH if (i == GLOB_NOMATCH) { -zlog(ZLOG_STUFF, ZLOG_WARNING, "Nothing match the include pattern '%s' from %s at line %d.", inc, filename,