[PHP-CVS] cvs: php-src /main main.c
stasThu Jul 9 00:24:26 2009 UTC Modified files: /php-src/main main.c Log: fix mail.log openbasedir interaction with .htaccess http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.803r2=1.804diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.803 php-src/main/main.c:1.804 --- php-src/main/main.c:1.803 Tue Jul 7 16:40:21 2009 +++ php-src/main/main.c Thu Jul 9 00:24:26 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.803 2009/07/07 16:40:21 jani Exp $ */ +/* $Id: main.c,v 1.804 2009/07/09 00:24:26 stas Exp $ */ /* {{{ includes */ @@ -482,6 +482,23 @@ /* {{{ PHP_INI_MH */ +static PHP_INI_MH(OnUpdateMailLog) +{ + /* Only do the safemode/open_basedir check at runtime */ + if (stage == PHP_INI_STAGE_RUNTIME || stage == PHP_INI_STAGE_HTACCESS) { + if (PG(open_basedir) php_check_open_basedir(new_value TSRMLS_CC)) { + return FAILURE; + } + + } + OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + return SUCCESS; +} +/* }}} */ + + +/* {{{ PHP_INI_MH + */ static PHP_INI_MH(OnChangeMailForceExtra) { /* Don't allow changing it in htaccess */ @@ -579,7 +596,7 @@ PHP_INI_ENTRY(SMTP, localhost,PHP_INI_ALL,NULL) PHP_INI_ENTRY(smtp_port, 25, PHP_INI_ALL,NULL) STD_PHP_INI_BOOLEAN(mail.add_x_header,0, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, mail_x_header, php_core_globals, core_globals) - STD_PHP_INI_ENTRY(mail.log, NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, mail_log, php_core_globals, core_globals) + STD_PHP_INI_ENTRY(mail.log, NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateMailLog, mail_log, php_core_globals, core_globals) PHP_INI_ENTRY(browscap, NULL, PHP_INI_SYSTEM, NULL) PHP_INI_ENTRY(memory_limit, 128M, PHP_INI_ALL,OnChangeMemoryLimit) PHP_INI_ENTRY(precision, 14, PHP_INI_ALL,OnSetPrecision) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
janiTue Jul 7 16:40:21 2009 UTC Modified files: /php-src/main main.c Log: - Fixed bug #48247 (Infinite loop and possible crash during startup with errors) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.802r2=1.803diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.802 php-src/main/main.c:1.803 --- php-src/main/main.c:1.802 Thu Jun 4 07:41:42 2009 +++ php-src/main/main.c Tue Jul 7 16:40:21 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.802 2009/06/04 07:41:42 pajoye Exp $ */ +/* $Id: main.c,v 1.803 2009/07/07 16:40:21 jani Exp $ */ /* {{{ includes */ @@ -608,6 +608,20 @@ static int module_startup = 1; static int module_shutdown = 0; +/* {{{ php_during_module_startup */ +static int php_during_module_startup(void) +{ + return module_startup; +} +/* }}} */ + +/* {{{ php_during_module_shutdown */ +static int php_during_module_shutdown(void) +{ + return module_shutdown; +} +/* }}} */ + /* {{{ php_log_err */ PHPAPI void php_log_err(char *log_message TSRMLS_DC) @@ -630,7 +644,7 @@ char *error_time_str; time(error_time); - error_time_str = php_format_date(d-M-Y H:i:s, 11, error_time, 1 TSRMLS_CC); + error_time_str = php_format_date(d-M-Y H:i:s, 11, error_time, php_during_module_startup() TSRMLS_CC); len = spprintf(tmp, 0, [%s] %s%s, error_time_str, log_message, PHP_EOL); #ifdef PHP_WIN32 php_flock(fd, 2); @@ -679,24 +693,6 @@ } /* }}} */ -/* {{{ php_verror helpers */ - -/* {{{ php_during_module_startup */ -static int php_during_module_startup(void) -{ - return module_startup; -} -/* }}} */ - -/* {{{ php_during_module_shutdown */ -static int php_during_module_shutdown(void) -{ - return module_shutdown; -} -/* }}} */ - -/* }}} */ - /* {{{ php_verror */ /* php_verror is called from php_error_docrefn functions. * Its purpose is to unify error messages and automatically generate clickable -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
pajoye Thu Jun 4 07:00:37 2009 UTC Modified files: /php-src/main main.c Log: - [DOC] MF53: add PHP_WINDOWS_NT_* and PHP_WINDOWS_VERSION_* constants (usefull for testing and features detections) see http://msdn.microsoft.com/en-us/library/ms724451(VS.85).aspx for the explanation http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.800r2=1.801diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.800 php-src/main/main.c:1.801 --- php-src/main/main.c:1.800 Sat May 30 09:47:39 2009 +++ php-src/main/main.c Thu Jun 4 07:00:37 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.800 2009/05/30 09:47:39 scottmac Exp $ */ +/* $Id: main.c,v 1.801 2009/06/04 07:00:37 pajoye Exp $ */ /* {{{ includes */ @@ -1998,6 +1998,20 @@ REGISTER_MAIN_LONG_CONSTANT(PHP_INT_MAX, LONG_MAX, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT(PHP_INT_SIZE, sizeof(long), CONST_PERSISTENT | CONST_CS); +#ifdef PHP_WIN32 + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_MAJOR, EG(windows_version_info).dwMajorVersion, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_MINOR, EG(windows_version_info).dwMinorVersion, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_BUILD, EG(windows_version_info).dwBuildNumber, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_PLATFORM, EG(windows_version_info).dwPlatformId, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_SP_MAJOR, EG(windows_version_info).wServicePackMajor, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_SP_MINOR, EG(windows_version_info).wServicePackMinor, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_SUITEMASK, EG(windows_version_info).wSuiteMask, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_PRODUCTYPE, EG(windows_version_info).wProductType, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_NT_DOMAIN_CONTROLLER, VER_NT_DOMAIN_CONTROLLER, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_NT_SERVER, VER_NT_SERVER, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_NT_WORKSTATION, VER_NT_WORKSTATION, CONST_PERSISTENT | CONST_CS); +#endif + php_output_register_constants(TSRMLS_C); php_rfc1867_register_constants(TSRMLS_C); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
pajoye Thu Jun 4 07:41:42 2009 UTC Modified files: /php-src/main main.c Log: - typo http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.801r2=1.802diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.801 php-src/main/main.c:1.802 --- php-src/main/main.c:1.801 Thu Jun 4 07:00:37 2009 +++ php-src/main/main.c Thu Jun 4 07:41:42 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.801 2009/06/04 07:00:37 pajoye Exp $ */ +/* $Id: main.c,v 1.802 2009/06/04 07:41:42 pajoye Exp $ */ /* {{{ includes */ @@ -2006,7 +2006,7 @@ REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_SP_MAJOR, EG(windows_version_info).wServicePackMajor, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_SP_MINOR, EG(windows_version_info).wServicePackMinor, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_SUITEMASK, EG(windows_version_info).wSuiteMask, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_PRODUCTYPE, EG(windows_version_info).wProductType, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_VERSION_PRODUCTTYPE, EG(windows_version_info).wProductType, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_NT_DOMAIN_CONTROLLER, VER_NT_DOMAIN_CONTROLLER, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_NT_SERVER, VER_NT_SERVER, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT(PHP_WINDOWS_NT_WORKSTATION, VER_NT_WORKSTATION, CONST_PERSISTENT | CONST_CS); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
scottmacSat May 30 09:47:39 2009 UTC Modified files: /php-src/main main.c Log: Make sure the timeout is checked in the shutdown function, patch from Etienne http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.799r2=1.800diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.799 php-src/main/main.c:1.800 --- php-src/main/main.c:1.799 Mon May 4 19:55:33 2009 +++ php-src/main/main.c Sat May 30 09:47:39 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.799 2009/05/04 19:55:33 derick Exp $ */ +/* $Id: main.c,v 1.800 2009/05/30 09:47:39 scottmac Exp $ */ /* {{{ includes */ @@ -1378,7 +1378,7 @@ void php_on_timeout(int seconds TSRMLS_DC) /* {{{ */ { PG(connection_status) |= PHP_CONNECTION_TIMEOUT; - zend_set_timeout(EG(timeout_seconds), 0); + zend_set_timeout(EG(timeout_seconds), 1); if(PG(exit_on_timeout)) sapi_terminate_process(TSRMLS_C); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
derick Mon May 4 19:55:33 2009 UTC Modified files: /php-src/main main.c Log: - Fixed warnings http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.798r2=1.799diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.798 php-src/main/main.c:1.799 --- php-src/main/main.c:1.798 Sun May 3 19:08:28 2009 +++ php-src/main/main.c Mon May 4 19:55:33 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.798 2009/05/03 19:08:28 derick Exp $ */ +/* $Id: main.c,v 1.799 2009/05/04 19:55:33 derick Exp $ */ /* {{{ includes */ @@ -59,6 +59,7 @@ #include fopen_wrappers.h #include ext/standard/php_standard.h #include ext/standard/php_string.h +#include ext/date/php_date.h #include php_variables.h #include ext/standard/credits.h #ifdef PHP_WIN32 @@ -612,7 +613,6 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC) { int fd = -1; - struct tm tmbuf; time_t error_time; /* Try to use the specified logging location. */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
derick Sun May 3 19:08:29 2009 UTC Modified files: /php-src/main main.c Log: - Fixed bug #45191 (error_log ignores date.timezone php.ini val when setting logging timestamps). http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.797r2=1.798diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.797 php-src/main/main.c:1.798 --- php-src/main/main.c:1.797 Thu Apr 30 09:12:26 2009 +++ php-src/main/main.c Sun May 3 19:08:28 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.797 2009/04/30 09:12:26 pajoye Exp $ */ +/* $Id: main.c,v 1.798 2009/05/03 19:08:28 derick Exp $ */ /* {{{ includes */ @@ -612,7 +612,6 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC) { int fd = -1; - char error_time_str[128]; struct tm tmbuf; time_t error_time; @@ -628,14 +627,17 @@ if (fd != -1) { char *tmp; int len; + char *error_time_str; + time(error_time); - strftime(error_time_str, sizeof(error_time_str), %d-%b-%Y %H:%M:%S, php_localtime_r(error_time, tmbuf)); + error_time_str = php_format_date(d-M-Y H:i:s, 11, error_time, 1 TSRMLS_CC); len = spprintf(tmp, 0, [%s] %s%s, error_time_str, log_message, PHP_EOL); #ifdef PHP_WIN32 php_flock(fd, 2); #endif write(fd, tmp, len); efree(tmp); + efree(error_time_str); close(fd); return; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
pajoye Thu Apr 30 09:12:26 2009 UTC Modified files: /php-src/main main.c Log: - fix build (Marcus, fix re2c please) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.796r2=1.797diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.796 php-src/main/main.c:1.797 --- php-src/main/main.c:1.796 Tue Apr 28 07:13:43 2009 +++ php-src/main/main.c Thu Apr 30 09:12:26 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.796 2009/04/28 07:13:43 dmitry Exp $ */ +/* $Id: main.c,v 1.797 2009/04/30 09:12:26 pajoye Exp $ */ /* {{{ includes */ @@ -96,6 +96,9 @@ # define PAGE_SIZE 4096 # endif #endif +#ifdef PHP_WIN32 +# define PAGE_SIZE 4096 +#endif /* }}} */ PHPAPI int (*php_register_internal_extensions_func)(TSRMLS_D) = php_register_internal_extensions; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Tue Apr 28 07:13:44 2009 UTC Modified files: /php-src/main main.c Log: Fixed bug #48034 (PHP crashes when script is 8192 (8KB) bytes long) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.795r2=1.796diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.795 php-src/main/main.c:1.796 --- php-src/main/main.c:1.795 Fri Mar 27 02:33:44 2009 +++ php-src/main/main.c Tue Apr 28 07:13:43 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.795 2009/03/27 02:33:44 lbarnaud Exp $ */ +/* $Id: main.c,v 1.796 2009/04/28 07:13:43 dmitry Exp $ */ /* {{{ includes */ @@ -89,6 +89,13 @@ #include SAPI.h #include rfc1867.h + +#if HAVE_SYS_MMAN_H +# include sys/mman.h +# ifndef PAGE_SIZE +# define PAGE_SIZE 4096 +# endif +#endif /* }}} */ PHPAPI int (*php_register_internal_extensions_func)(TSRMLS_D) = php_register_internal_extensions; @@ -1237,8 +1244,10 @@ handle-handle.stream.isatty = 0; /* can we mmap immeadiately? */ memset(handle-handle.stream.mmap, 0, sizeof(handle-handle.stream.mmap)); - len = php_zend_stream_fsizer(stream TSRMLS_CC) + ZEND_MMAP_AHEAD; - if (php_stream_mmap_possible(stream) + len = php_zend_stream_fsizer(stream TSRMLS_CC); + if (len != 0 +((len - 1) % PAGE_SIZE) = PAGE_SIZE - ZEND_MMAP_AHEAD +php_stream_mmap_possible(stream) (p = php_stream_mmap_range(stream, 0, len, PHP_STREAM_MAP_MODE_SHARED_READONLY, mapped_len)) != NULL) { handle-handle.stream.closer = php_zend_stream_mmap_closer; handle-handle.stream.mmap.buf = p; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
lbarnaudFri Mar 27 02:33:44 2009 UTC Modified files: /php-src/main main.c Log: Fixed initialization of tick functions list in ZTS http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.794r2=1.795diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.794 php-src/main/main.c:1.795 --- php-src/main/main.c:1.794 Tue Mar 10 23:39:53 2009 +++ php-src/main/main.c Fri Mar 27 02:33:44 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.794 2009/03/10 23:39:53 helly Exp $ */ +/* $Id: main.c,v 1.795 2009/03/27 02:33:44 lbarnaud Exp $ */ /* {{{ includes */ @@ -1728,6 +1728,8 @@ static void core_globals_ctor(php_core_globals *core_globals TSRMLS_DC) { memset(core_globals, 0, sizeof(*core_globals)); + + php_startup_ticks(TSRMLS_C); } /* }}} */ #endif @@ -1754,6 +1756,8 @@ if (core_globals-allow_url_include_list) { free(core_globals-allow_url_include_list); } + + php_shutdown_ticks(TSRMLS_C); } /* }}} */ @@ -1893,6 +1897,8 @@ #ifdef PHP_WIN32 ts_allocate_id(php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor) php_win32_core_globals_ctor, (ts_allocate_dtor) php_win32_core_globals_dtor); #endif +#else + php_startup_ticks(TSRMLS_C); #endif gc_globals_ctor(TSRMLS_C); @@ -2050,11 +2056,6 @@ zend_set_utility_values(zuv); php_startup_sapi_content_types(TSRMLS_C); - if (php_startup_ticks(TSRMLS_C) == FAILURE) { - php_printf(Unable to start PHP ticks\n); - return FAILURE; - } - /* startup extensions staticly compiled in */ if (php_register_internal_extensions_func(TSRMLS_C) == FAILURE) { php_printf(Unable to start builtin modules\n); @@ -2155,7 +2156,6 @@ WSACleanup(); #endif - php_shutdown_ticks(TSRMLS_C); sapi_flush(TSRMLS_C); zend_shutdown(TSRMLS_C); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
pajoye Mon Jan 19 02:25:58 2009 UTC Modified files: /php-src/main main.c Log: - [MFB] fix nts build http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.791r2=1.792diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.791 php-src/main/main.c:1.792 --- php-src/main/main.c:1.791 Fri Jan 16 10:27:52 2009 +++ php-src/main/main.c Mon Jan 19 02:25:58 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.791 2009/01/16 10:27:52 pajoye Exp $ */ +/* $Id: main.c,v 1.792 2009/01/19 02:25:58 pajoye Exp $ */ /* {{{ includes */ @@ -1816,10 +1816,6 @@ #ifdef ZTS zend_executor_globals *executor_globals; void ***tsrm_ls; -#ifdef PHP_WIN32 - DWORD dwVersion = GetVersion(); -#endif - php_core_globals *core_globals; #endif #if defined(PHP_WIN32) || (defined(NETWARE) defined(USE_WINSOCK)) @@ -1827,12 +1823,13 @@ WSADATA wsaData; #endif #ifdef PHP_WIN32 - /* Get build numbers for Windows NT or Win95 */ - if (dwVersion 0x8000){ - php_os=WINNT; - } else { - php_os=WIN32; - } + DWORD dwVersion = GetVersion(); + /* Get build numbers for Windows NT or Win95 */ + if (dwVersion 0x8000){ + php_os=WINNT; + } else { + php_os=WIN32; + } #if defined(_MSC_VER) (_MSC_VER = 1400) old_invalid_parameter_handler = _set_invalid_parameter_handler(dummy_invalid_parameter_handler); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c win32_internal_function_disabled.h
pajoye Fri Jan 16 10:02:50 2009 UTC Modified files: /php-src/main win32_internal_function_disabled.h main.c Log: MFB: - add EG(windows_version_info), set at init time once per instance contains a OSVERSIONINFOEX struct. It lets us determine easily on which windows version is used (for example) - [DOC] add the ability to disable a function when the windows function does not support a feature (for example symlink) - [DOC] symlink, hardlink co support (1/3) http://cvs.php.net/viewvc.cgi/php-src/main/win32_internal_function_disabled.h?r1=1.1r2=1.2diff_format=u Index: php-src/main/win32_internal_function_disabled.h diff -u /dev/null php-src/main/win32_internal_function_disabled.h:1.2 --- /dev/null Fri Jan 16 10:02:50 2009 +++ php-src/main/win32_internal_function_disabled.h Fri Jan 16 10:02:50 2009 @@ -0,0 +1,25 @@ +/* + +--+ + | PHP Version 5| + +--+ + | Copyright (c) 1997-2009 The PHP Group| + +--+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is| + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | lice...@php.net so we can mail you a copy immediately. | + +--+ + | Author: Pierre A. Joye pie...@php.net | + +--+ + */ + +/* $Id: win32_internal_function_disabled.h,v 1.2 2009/01/16 10:02:50 pajoye Exp $ */ + +/* 5 means the min version is 5 (XP/2000), 6 (2k8/vista), etc. */ +static const char *function_name_5[] = {link, NULL}; +const int function_name_cnt_5 = 1; +static const char *function_name_6[] = {readlink, symlink, NULL}; +const int function_name_cnt_6 = 2; http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.788r2=1.789diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.788 php-src/main/main.c:1.789 --- php-src/main/main.c:1.788 Fri Jan 9 15:00:36 2009 +++ php-src/main/main.c Fri Jan 16 10:02:50 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.788 2009/01/09 15:00:36 iliaa Exp $ */ +/* $Id: main.c,v 1.789 2009/01/16 10:02:50 pajoye Exp $ */ /* {{{ includes */ @@ -99,6 +99,33 @@ PHPAPI int core_globals_id; #endif +#ifdef PHP_WIN32 +#include win32_internal_function_disabled.h + +static php_win32_disable_functions() { + int i; + TSRMLS_FETCH(); + + if (EG(windows_version_info).dwMajorVersion 5) { + for (i = 0; i function_name_cnt_5; i++) { + if (zend_hash_del(CG(function_table), function_name_5[i], strlen(function_name_5[i]) + 1)==FAILURE) { + php_printf(Unable to disable function '%s'\n, function_name_5[i]); + return FAILURE; + } + } + } + + if (EG(windows_version_info).dwMajorVersion 6) { + for (i = 0; i function_name_cnt_6; i++) { + if (zend_hash_del(CG(function_table), function_name_6[i], strlen(function_name_6[i]) + 1)==FAILURE) { + php_printf(Unable to disable function '%s'\n, function_name_6[i]); + return FAILURE; + } + } + } +} +#endif + #define SAFE_FILENAME(f) ((f)?(f):-) /* {{{ PHP_INI_MH @@ -1788,6 +1815,9 @@ #ifdef ZTS zend_executor_globals *executor_globals; void ***tsrm_ls; +#ifdef PHP_WIN32 + DWORD dwVersion = GetVersion(); +#endif php_core_globals *core_globals; #endif @@ -1796,16 +1826,12 @@ WSADATA wsaData; #endif #ifdef PHP_WIN32 - { - DWORD dwVersion = GetVersion(); - /* Get build numbers for Windows NT or Win95 */ if (dwVersion 0x8000){ php_os=WINNT; } else { php_os=WIN32; } - } #if defined(_MSC_VER) (_MSC_VER = 1400) old_invalid_parameter_handler = _set_invalid_parameter_handler(dummy_invalid_parameter_handler); @@ -1862,6 +1888,18 @@ #endif gc_globals_ctor(TSRMLS_C); +#ifdef PHP_WIN32 + { + OSVERSIONINFOEX *osvi =
[PHP-CVS] cvs: php-src /main main.c
pajoye Fri Jan 16 10:27:52 2009 UTC Modified files: /php-src/main main.c Log: - MFB: don't call it in non zts mode http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.790r2=1.791diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.790 php-src/main/main.c:1.791 --- php-src/main/main.c:1.790 Fri Jan 16 10:26:06 2009 +++ php-src/main/main.c Fri Jan 16 10:27:52 2009 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.790 2009/01/16 10:26:06 pajoye Exp $ */ +/* $Id: main.c,v 1.791 2009/01/16 10:27:52 pajoye Exp $ */ /* {{{ includes */ @@ -2096,7 +2096,10 @@ return FAILURE; } #endif + +#ifdef ZTS zend_post_startup(TSRMLS_C); +#endif module_initialized = 1; sapi_deactivate(TSRMLS_C); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /main main.c win32_internal_function_disabled.h
On Fri, Jan 16, 2009 at 11:02, Pierre-Alain Joye paj...@php.net wrote: pajoye Fri Jan 16 10:02:50 2009 UTC Modified files: /php-src/main win32_internal_function_disabled.h main.c Log: MFB: - add EG(windows_version_info), set at init time once per instance contains a OSVERSIONINFOEX struct. It lets us determine easily on which windows version is used (for example) - [DOC] add the ability to disable a function when the windows function does not support a feature (for example symlink) I don't understand how this is useful. Is the user now responsible to disable_function=symlink? That doesn't quite make sense to me. Could you please provide make more info so this can be documented? -Hannes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /main main.c win32_internal_function_disabled.h
On Fri, Jan 16, 2009 at 11:45, Hannes Magnusson hannes.magnus...@gmail.com wrote: On Fri, Jan 16, 2009 at 11:02, Pierre-Alain Joye paj...@php.net wrote: pajoye Fri Jan 16 10:02:50 2009 UTC Modified files: /php-src/main win32_internal_function_disabled.h main.c Log: MFB: - add EG(windows_version_info), set at init time once per instance contains a OSVERSIONINFOEX struct. It lets us determine easily on which windows version is used (for example) - [DOC] add the ability to disable a function when the windows function does not support a feature (for example symlink) I don't understand how this is useful. Is the user now responsible to disable_function=symlink? That doesn't quite make sense to me. Could you please provide make more info so this can be documented? Talked to Pierre on IRC. Apparently I read this wrong :) This has nothing to do with disable_functions INI entry. If PHP is build on Windows version that has symlink support then the binary contains symlink support. If you however run the binary on WindowsXP the actual function entry is removed at runtime. All this means is: As of PHP5.3 symlink() and readlink() are supported on Windows2003 and above And As of PHP5.3 link() is supported on Windows2000 and above -Hannes -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c ZendEngine2 zend_builtin_functions.c
helly Wed Dec 31 13:25:05 2008 UTC Modified files: /ZendEngine2zend_builtin_functions.c /php-src/main main.c Log: - Register engine classes when and where they should be - Show core module version as PHP version http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.395r2=1.396diff_format=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.395 ZendEngine2/zend_builtin_functions.c:1.396 --- ZendEngine2/zend_builtin_functions.c:1.395 Wed Dec 31 12:24:56 2008 +++ ZendEngine2/zend_builtin_functions.cWed Dec 31 13:25:05 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_builtin_functions.c,v 1.395 2008/12/31 12:24:56 helly Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.396 2008/12/31 13:25:05 helly Exp $ */ #include zend.h #include zend_API.h @@ -297,6 +297,8 @@ INIT_CLASS_ENTRY(class_entry, stdClass, NULL); zend_standard_class_def = zend_register_internal_class(class_entry TSRMLS_CC); + zend_register_default_classes(TSRMLS_C); + return SUCCESS; } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.786r2=1.787diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.786 php-src/main/main.c:1.787 --- php-src/main/main.c:1.786 Wed Dec 31 11:12:38 2008 +++ php-src/main/main.c Wed Dec 31 13:25:05 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.786 2008/12/31 11:12:38 sebastian Exp $ */ +/* $Id: main.c,v 1.787 2008/12/31 13:25:05 helly Exp $ */ /* {{{ includes */ @@ -1717,6 +1717,14 @@ } /* }}} */ +PHP_MINFO_FUNCTION(php_core) { /* {{{ */ + php_info_print_table_start(); + php_info_print_table_row(2, PHP Version, PHP_VERSION); + php_info_print_table_end(); + DISPLAY_INI_ENTRIES(); +} +/* }}} */ + /* {{{ php_register_extensions */ int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC) @@ -1774,6 +1782,7 @@ zend_utility_values zuv; int module_number=0;/* for REGISTER_INI_ENTRIES() */ char *php_os; + zend_module_entry *module; #ifdef ZTS zend_executor_globals *executor_globals; void ***tsrm_ls; @@ -1998,9 +2007,6 @@ return FAILURE; } - /* Register internal Zend classes */ - zend_register_default_classes(TSRMLS_C); - /* startup extensions staticly compiled in */ if (php_register_internal_extensions_func(TSRMLS_C) == FAILURE) { php_printf(Unable to start builtin modules\n); @@ -2029,14 +2035,18 @@ /* register additional functions */ if (sapi_module.additional_functions) { - zend_module_entry *module; - if (zend_hash_find(module_registry, standard, sizeof(standard), (void**)module)==SUCCESS) { EG(current_module) = module; zend_register_functions(NULL, sapi_module.additional_functions, NULL, MODULE_PERSISTENT TSRMLS_CC); EG(current_module) = NULL; } } + + /* make core report what it should */ + if (zend_hash_find(module_registry, core, sizeof(core), (void**)module)==SUCCESS) { + module-version = PHP_VERSION; + module-info_func = PHP_MINFO(php_core); + } zend_post_startup(TSRMLS_C); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c /tests/lang bug43958.phpt
dmitry Tue Sep 2 09:46:00 2008 UTC Modified files: /php-src/main main.c /php-src/tests/lang bug43958.phpt Log: Fixed Bug #43958 (class name added into the error message) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.783r2=1.784diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.783 php-src/main/main.c:1.784 --- php-src/main/main.c:1.783 Tue Aug 26 23:25:40 2008 +++ php-src/main/main.c Tue Sep 2 09:46:00 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.783 2008/08/26 23:25:40 jani Exp $ */ +/* $Id: main.c,v 1.784 2008/09/02 09:46:00 dmitry Exp $ */ /* {{{ includes */ @@ -668,8 +668,8 @@ char *docref_target = , *docref_root = ; char *p; int buffer_len = 0; - char *space; - zstr class_name = get_active_class_name(space TSRMLS_CC); + char *space = ; + zstr class_name = EMPTY_ZSTR; int origin_len; zstr function = NULL_ZSTR; char *origin; @@ -721,6 +721,8 @@ if (!function.v || !USTR_LEN(function)) { stage = Unknown; function.v = NULL; + } else { + class_name = get_active_class_name(space TSRMLS_CC); } } http://cvs.php.net/viewvc.cgi/php-src/tests/lang/bug43958.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/tests/lang/bug43958.phpt diff -u /dev/null php-src/tests/lang/bug43958.phpt:1.2 --- /dev/null Tue Sep 2 09:46:00 2008 +++ php-src/tests/lang/bug43958.phptTue Sep 2 09:46:00 2008 @@ -0,0 +1,17 @@ +--TEST-- +Bug #43958 (class name added into the error message) +--FILE-- +?php +class MyClass +{ + static public function loadCode($p) { + return include $p; + } +} + +MyClass::loadCode('file-which-does-not-exist-on-purpose.php'); +--EXPECTF-- +Warning: include(file-which-does-not-exist-on-purpose.php): failed to open stream: No such file or directory in %sbug43958.php on line 5 + +Warning: include(): Failed opening 'file-which-does-not-exist-on-purpose.php' for inclusion (include_path='%s') in %sbug43958.php on line 5 + -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
janiTue Aug 26 23:25:40 2008 UTC Modified files: /php-src/main main.c Log: - Fixed bug #44924 (sendmail path wrong) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.782r2=1.783diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.782 php-src/main/main.c:1.783 --- php-src/main/main.c:1.782 Tue Aug 26 23:22:31 2008 +++ php-src/main/main.c Tue Aug 26 23:25:40 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.782 2008/08/26 23:22:31 jani Exp $ */ +/* $Id: main.c,v 1.783 2008/08/26 23:25:40 jani Exp $ */ /* {{{ includes */ @@ -462,12 +462,13 @@ * PHP_INCLUDE_PATH */ -#if defined(PHP_PROG_SENDMAIL) !defined(NETWARE) -# define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL -t -i -#elif defined(PHP_WIN32) -# define DEFAULT_SENDMAIL_PATH NULL + /* Windows and Netware use the internal mail */ +#if defined(PHP_WIN32) || defined(NETWARE) +# define DEFAULT_SENDMAIL_PATH NULL +#elif defined(PHP_PROG_SENDMAIL) +# define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL -t -i #else -# define DEFAULT_SENDMAIL_PATH /usr/sbin/sendmail -t -i +# define DEFAULT_SENDMAIL_PATH /usr/sbin/sendmail -t -i #endif /* {{{ PHP_INI -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
janiTue Aug 26 23:22:32 2008 UTC Modified files: /php-src/main main.c Log: Sync with PHP_5_3 (what a nice mess..thanks guys for keeping the branches in sync..NOT) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.781r2=1.782diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.781 php-src/main/main.c:1.782 --- php-src/main/main.c:1.781 Sat Aug 23 17:53:19 2008 +++ php-src/main/main.c Tue Aug 26 23:22:31 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.781 2008/08/23 17:53:19 pajoye Exp $ */ +/* $Id: main.c,v 1.782 2008/08/26 23:22:31 jani Exp $ */ /* {{{ includes */ @@ -462,8 +462,9 @@ * PHP_INCLUDE_PATH */ -/* Windows and Netware use the internal mail */ -#if defined(PHP_WIN32) || defined(NETWARE) +#if defined(PHP_PROG_SENDMAIL) !defined(NETWARE) +# define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL -t -i +#elif defined(PHP_WIN32) # define DEFAULT_SENDMAIL_PATH NULL #else # define DEFAULT_SENDMAIL_PATH /usr/sbin/sendmail -t -i -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
pajoye Sat Aug 23 17:53:19 2008 UTC Modified files: /php-src/main main.c Log: - exposePHP_MAXPATHLEN http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.780r2=1.781diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.780 php-src/main/main.c:1.781 --- php-src/main/main.c:1.780 Fri Aug 22 12:59:38 2008 +++ php-src/main/main.c Sat Aug 23 17:53:19 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.780 2008/08/22 12:59:38 helly Exp $ */ +/* $Id: main.c,v 1.781 2008/08/23 17:53:19 pajoye Exp $ */ /* {{{ includes */ @@ -1914,6 +1914,7 @@ REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_SCAN_DIR, PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_SHLIB_SUFFIX, PHP_SHLIB_SUFFIX, sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_EOL, PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_MAXPATHLEN, MAXPATHLEN, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT(PHP_INT_MAX, LONG_MAX, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_LONG_CONSTANT(PHP_INT_SIZE, sizeof(long), CONST_PERSISTENT | CONST_CS); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c ZendEngine2 zend.c zend.h zend_alloc.c zend_alloc.h zend_execute.c zend_gc.c zend_gc.h zend_language_scanner.c zend_language_scanner.l zend_operators.c zend_stream
felipe Fri Aug 15 19:45:25 2008 UTC Modified files: /ZendEngine2zend.c zend.h zend_alloc.c zend_alloc.h zend_execute.c zend_gc.c zend_gc.h zend_language_scanner.c zend_language_scanner.l zend_operators.c zend_stream.c zend_vm_def.h zend_vm_execute.h /php-src/main main.c Log: - Removed some TSRMLS_FETCH()s http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c?r1=1.422r2=1.423diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.422 ZendEngine2/zend.c:1.423 --- ZendEngine2/zend.c:1.422Thu Aug 14 10:06:39 2008 +++ ZendEngine2/zend.c Fri Aug 15 19:45:24 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.c,v 1.422 2008/08/14 10:06:39 helly Exp $ */ +/* $Id: zend.c,v 1.423 2008/08/15 19:45:24 felipe Exp $ */ #include zend.h #include zend_extensions.h @@ -58,7 +58,7 @@ ZEND_API zend_write_func_t zend_write; ZEND_API int (*zend_path_encode)(char **encpath, int *encpath_len, const UChar *path, int path_len TSRMLS_DC); ZEND_API int (*zend_path_decode)(UChar **decpath, int *decpath_len, const char *path, int path_len TSRMLS_DC); -ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path); +ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC); ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); ZEND_API void (*zend_block_interruptions)(void); ZEND_API void (*zend_unblock_interruptions)(void); @@ -70,7 +70,7 @@ void (*zend_on_timeout)(int seconds TSRMLS_DC); -static void (*zend_message_dispatcher_p)(long message, void *data); +static void (*zend_message_dispatcher_p)(long message, void *data TSRMLS_DC); static int (*zend_get_configuration_directive_p)(const char *name, uint name_length, zval *contents); static ZEND_INI_MH(OnUpdateErrorReporting) /* {{{ */ @@ -665,7 +665,7 @@ } /* }}} */ -static FILE *zend_fopen_wrapper(const char *filename, char **opened_path) /* {{{ */ +static FILE *zend_fopen_wrapper(const char *filename, char **opened_path TSRMLS_DC) /* {{{ */ { if (opened_path) { *opened_path = estrdup(filename); @@ -1045,7 +1045,7 @@ void zend_init_opcodes_handlers(void); -int zend_startup(zend_utility_functions *utility_functions, char **extensions) /* {{{ */ +int zend_startup(zend_utility_functions *utility_functions, char **extensions TSRMLS_DC) /* {{{ */ { #ifdef ZTS zend_compiler_globals *compiler_globals; @@ -1058,7 +1058,6 @@ extern zend_php_scanner_globals language_scanner_globals; extern zend_unicode_globals unicode_globals; #endif - TSRMLS_FETCH(); #ifndef __GNUC__ null_zstr.v = NULL; @@ -1140,7 +1139,6 @@ ts_allocate_id(ini_scanner_globals_id, sizeof(zend_ini_scanner_globals), (ts_allocate_ctor) ini_scanner_globals_ctor, NULL); compiler_globals = ts_resource(compiler_globals_id); executor_globals = ts_resource(executor_globals_id); - tsrm_ls = ts_resource_ex(0, NULL); compiler_globals_dtor(compiler_globals TSRMLS_CC); compiler_globals-in_compilation = 0; @@ -1468,10 +1466,10 @@ /* }}} */ BEGIN_EXTERN_C() -ZEND_API void zend_message_dispatcher(long message, void *data) /* {{{ */ +ZEND_API void zend_message_dispatcher(long message, void *data TSRMLS_DC) /* {{{ */ { if (zend_message_dispatcher_p) { - zend_message_dispatcher_p(message, data); + zend_message_dispatcher_p(message, data TSRMLS_CC); } } /* }}} */ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.h?r1=1.360r2=1.361diff_format=u Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.360 ZendEngine2/zend.h:1.361 --- ZendEngine2/zend.h:1.360Tue Aug 12 17:15:59 2008 +++ ZendEngine2/zend.h Fri Aug 15 19:45:24 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.h,v 1.360 2008/08/12 17:15:59 felipe Exp $ */ +/* $Id: zend.h,v 1.361 2008/08/15 19:45:24 felipe Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -509,8 +509,8 @@ int (*write_function)(const char *str, uint str_length); int (*path_encode_function)(char **encpath, int *encpath_len, const UChar *path, int path_len TSRMLS_DC); int (*path_decode_function)(UChar **decpath, int *decpath_len, const char *path, int path_len TSRMLS_DC); - FILE *(*fopen_function)(const char *filename, char **opened_path); - void (*message_handler)(long message, void *data); + FILE *(*fopen_function)(const char *filename, char **opened_path TSRMLS_DC); + void (*message_handler)(long message, void *data TSRMLS_DC); void (*block_interruptions)(void); void (*unblock_interruptions)(void); int (*get_configuration_directive)(const char *name, uint name_length, zval *contents); @@
[PHP-CVS] cvs: php-src /main main.c ZendEngine2 zend.c zend.h zend_builtin_functions.c zend_builtin_functions.h
helly Sun Aug 10 21:52:06 2008 UTC Modified files: /ZendEngine2zend.c zend.h zend_builtin_functions.c zend_builtin_functions.h /php-src/main main.c Log: - Fix memleak, Zend's built-in functions get copied before we copy all functions, thus ending up in the name and param definitions copied twice because zend_register_funciton already copies them. - Also Be able to deallocate Zend's built-in functions and do so when appropriate. - After unregistering Zend's built-in functions only dl() is left and that seems to be fine. http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c?r1=1.419r2=1.420diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.419 ZendEngine2/zend.c:1.420 --- ZendEngine2/zend.c:1.419Mon Jul 21 09:36:21 2008 +++ ZendEngine2/zend.c Sun Aug 10 21:52:05 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.c,v 1.419 2008/07/21 09:36:21 bjori Exp $ */ +/* $Id: zend.c,v 1.420 2008/08/10 21:52:05 helly Exp $ */ #include zend.h #include zend_extensions.h @@ -1045,7 +1045,7 @@ void zend_init_opcodes_handlers(void); -int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions) /* {{{ */ +int zend_startup(zend_utility_functions *utility_functions, char **extensions) /* {{{ */ { #ifdef ZTS zend_compiler_globals *compiler_globals; @@ -1170,10 +1170,6 @@ zend_init_exception_op(TSRMLS_C); #endif - if (start_builtin_functions) { - zend_startup_builtin_functions(TSRMLS_C); - } - zend_ini_startup(TSRMLS_C); #ifdef ZTS @@ -1209,6 +1205,7 @@ ucnv_close(UG(runtime_encoding_conv)); UG(runtime_encoding_conv) = old_runtime_encoding_conv; } + zend_startup_builtin_functions(TSRMLS_C); } /* }}} */ @@ -1248,6 +1245,7 @@ #endif zend_destroy_rsrc_list(EG(persistent_list) TSRMLS_CC); zend_hash_graceful_reverse_destroy(module_registry); + zend_shutdown_builtin_functions(TSRMLS_C); zend_hash_destroy(GLOBAL_FUNCTION_TABLE); zend_hash_destroy(GLOBAL_CLASS_TABLE); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.h?r1=1.357r2=1.358diff_format=u Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.357 ZendEngine2/zend.h:1.358 --- ZendEngine2/zend.h:1.357Fri Aug 8 17:10:49 2008 +++ ZendEngine2/zend.h Sun Aug 10 21:52:05 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.h,v 1.357 2008/08/08 17:10:49 helly Exp $ */ +/* $Id: zend.h,v 1.358 2008/08/10 21:52:05 helly Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -572,7 +572,7 @@ /* default engine string type */ #define ZEND_STR_TYPE (UG(unicode) ? IS_UNICODE : IS_STRING) -int zend_startup(zend_utility_functions *utility_functions, char **extensions, int start_builtin_functions); +int zend_startup(zend_utility_functions *utility_functions, char **extensions); void zend_shutdown(TSRMLS_D); void zend_register_standard_ini_entries(TSRMLS_D); void zend_post_startup(TSRMLS_D); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.381r2=1.382diff_format=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.381 ZendEngine2/zend_builtin_functions.c:1.382 --- ZendEngine2/zend_builtin_functions.c:1.381 Sat Aug 2 04:40:43 2008 +++ ZendEngine2/zend_builtin_functions.cSun Aug 10 21:52:05 2008 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_builtin_functions.c,v 1.381 2008/08/02 04:40:43 felipe Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.382 2008/08/10 21:52:05 helly Exp $ */ #include zend.h #include zend_API.h @@ -416,6 +416,12 @@ } /* }}} */ +void zend_shutdown_builtin_functions(TSRMLS_D) /* {{{ */ +{ + zend_unregister_functions(builtin_functions, -1, NULL TSRMLS_CC); +} +/* }}} */ + /* {{{ proto string zend_version(void) U Get the version of the Zend Engine */ ZEND_FUNCTION(zend_version) http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.h?r1=1.21r2=1.22diff_format=u Index: ZendEngine2/zend_builtin_functions.h diff -u ZendEngine2/zend_builtin_functions.h:1.21 ZendEngine2/zend_builtin_functions.h:1.22 --- ZendEngine2/zend_builtin_functions.h:1.21 Mon Dec 31 07:12:06 2007 +++ ZendEngine2/zend_builtin_functions.hSun Aug 10 21:52:05 2008 @@ -17,12 +17,13 @@ +--+ */ -/* $Id: zend_builtin_functions.h,v 1.21 2007/12/31 07:12:06 sebastian Exp $ */ +/* $Id: zend_builtin_functions.h,v 1.22 2008/08/10 21:52:05 helly Exp $ */ #ifndef ZEND_BUILTIN_FUNCTIONS_H #define ZEND_BUILTIN_FUNCTIONS_H int zend_startup_builtin_functions(TSRMLS_D); +int
[PHP-CVS] cvs: php-src /main main.c
felipe Fri Jul 25 12:14:36 2008 UTC Modified files: /php-src/main main.c Log: - MFB: New parameter parsing API (set_time_limit) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.773r2=1.774diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.773 php-src/main/main.c:1.774 --- php-src/main/main.c:1.773 Mon Jul 21 09:36:21 2008 +++ php-src/main/main.c Fri Jul 25 12:14:36 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.773 2008/07/21 09:36:21 bjori Exp $ */ +/* $Id: main.c,v 1.774 2008/07/25 12:14:36 felipe Exp $ */ /* {{{ includes */ @@ -1122,8 +1122,8 @@ { zval **new_timeout; - if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, new_timeout) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Z, new_timeout) == FAILURE) { + return; } convert_to_string_ex(new_timeout); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c php_ticks.c php_ticks.h
dmitry Wed Jun 25 12:18:51 2008 UTC Modified files: /php-src/main main.c php_ticks.c php_ticks.h Log: Fixed bug #45352 (Segmentation fault because of tick function on second request) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.770r2=1.771diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.770 php-src/main/main.c:1.771 --- php-src/main/main.c:1.770 Wed Mar 26 14:46:17 2008 +++ php-src/main/main.c Wed Jun 25 12:18:51 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.770 2008/03/26 14:46:17 scottmac Exp $ */ +/* $Id: main.c,v 1.771 2008/06/25 12:18:51 dmitry Exp $ */ /* {{{ includes */ @@ -1577,6 +1577,8 @@ EG(opline_ptr) = NULL; EG(active_op_array) = NULL; + php_deactivate_ticks(TSRMLS_C); + /* 1. Call all possible __destruct() functions */ zend_try { zend_call_destructors(TSRMLS_C); http://cvs.php.net/viewvc.cgi/php-src/main/php_ticks.c?r1=1.23r2=1.24diff_format=u Index: php-src/main/php_ticks.c diff -u php-src/main/php_ticks.c:1.23 php-src/main/php_ticks.c:1.24 --- php-src/main/php_ticks.c:1.23 Mon Dec 31 07:12:18 2007 +++ php-src/main/php_ticks.cWed Jun 25 12:18:51 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_ticks.c,v 1.23 2007/12/31 07:12:18 sebastian Exp $ */ +/* $Id: php_ticks.c,v 1.24 2008/06/25 12:18:51 dmitry Exp $ */ #include php.h #include php_ticks.h @@ -27,6 +27,11 @@ return SUCCESS; } +void php_deactivate_ticks(TSRMLS_D) +{ + zend_llist_clean(PG(tick_functions)); +} + void php_shutdown_ticks(TSRMLS_D) { zend_llist_destroy(PG(tick_functions)); http://cvs.php.net/viewvc.cgi/php-src/main/php_ticks.h?r1=1.17r2=1.18diff_format=u Index: php-src/main/php_ticks.h diff -u php-src/main/php_ticks.h:1.17 php-src/main/php_ticks.h:1.18 --- php-src/main/php_ticks.h:1.17 Mon Dec 31 07:12:18 2007 +++ php-src/main/php_ticks.hWed Jun 25 12:18:51 2008 @@ -16,12 +16,13 @@ +--+ */ -/* $Id: php_ticks.h,v 1.17 2007/12/31 07:12:18 sebastian Exp $ */ +/* $Id: php_ticks.h,v 1.18 2008/06/25 12:18:51 dmitry Exp $ */ #ifndef PHP_TICKS_H #define PHP_TICKS_H int php_startup_ticks(TSRMLS_D); +void php_deactivate_ticks(TSRMLS_D); void php_shutdown_ticks(TSRMLS_D); void php_run_ticks(int count); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
tony2001Sat Mar 22 12:56:08 2008 UTC Modified files: /php-src/main main.c Log: use correct flags http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.768r2=1.769diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.768 php-src/main/main.c:1.769 --- php-src/main/main.c:1.768 Fri Mar 21 16:38:50 2008 +++ php-src/main/main.c Sat Mar 22 12:56:07 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.768 2008/03/21 16:38:50 tony2001 Exp $ */ +/* $Id: main.c,v 1.769 2008/03/22 12:56:07 tony2001 Exp $ */ /* {{{ includes */ @@ -499,7 +499,7 @@ STD_PHP_INI_ENTRY(output_handler, NULL, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, output_handler, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(register_argc_argv, 1, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(auto_globals_jit, 1, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, auto_globals_jit, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN(short_open_tag, DEFAULT_SHORT_OPEN_TAG, PHP_INI_ALL|PHP_INI_PERDIR, OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals) + STD_PHP_INI_BOOLEAN(short_open_tag, DEFAULT_SHORT_OPEN_TAG, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals) STD_PHP_INI_BOOLEAN(sql.safe_mode,0, PHP_INI_SYSTEM, OnUpdateBool, sql_safe_mode, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(track_errors, 0, PHP_INI_ALL,OnUpdateBool, track_errors, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(y2k_compliance, 1, PHP_INI_ALL,OnUpdateBool, y2k_compliance, php_core_globals, core_globals) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
tony2001Fri Mar 21 16:38:50 2008 UTC Modified files: /php-src/main main.c Log: [DOC] revert short tags to their previous state http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.767r2=1.768diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.767 php-src/main/main.c:1.768 --- php-src/main/main.c:1.767 Thu Mar 20 17:31:17 2008 +++ php-src/main/main.c Fri Mar 21 16:38:50 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.767 2008/03/20 17:31:17 stas Exp $ */ +/* $Id: main.c,v 1.768 2008/03/21 16:38:50 tony2001 Exp $ */ /* {{{ includes */ @@ -499,7 +499,7 @@ STD_PHP_INI_ENTRY(output_handler, NULL, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, output_handler, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(register_argc_argv, 1, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(auto_globals_jit, 1, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, auto_globals_jit, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN(short_open_tag, DEFAULT_SHORT_OPEN_TAG, PHP_INI_ALL,OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals) + STD_PHP_INI_BOOLEAN(short_open_tag, DEFAULT_SHORT_OPEN_TAG, PHP_INI_ALL|PHP_INI_PERDIR, OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals) STD_PHP_INI_BOOLEAN(sql.safe_mode,0, PHP_INI_SYSTEM, OnUpdateBool, sql_safe_mode, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(track_errors, 0, PHP_INI_ALL,OnUpdateBool, track_errors, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(y2k_compliance, 1, PHP_INI_ALL,OnUpdateBool, y2k_compliance, php_core_globals, core_globals) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
stasThu Mar 20 17:31:18 2008 UTC Modified files: /php-src/main main.c Log: MF5: make short_open_tag user-accessible http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.766r2=1.767diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.766 php-src/main/main.c:1.767 --- php-src/main/main.c:1.766 Wed Mar 19 16:37:48 2008 +++ php-src/main/main.c Thu Mar 20 17:31:17 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.766 2008/03/19 16:37:48 rasmus Exp $ */ +/* $Id: main.c,v 1.767 2008/03/20 17:31:17 stas Exp $ */ /* {{{ includes */ @@ -499,7 +499,7 @@ STD_PHP_INI_ENTRY(output_handler, NULL, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, output_handler, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(register_argc_argv, 1, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, register_argc_argv, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(auto_globals_jit, 1, PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, auto_globals_jit, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN(short_open_tag, DEFAULT_SHORT_OPEN_TAG, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals) + STD_PHP_INI_BOOLEAN(short_open_tag, DEFAULT_SHORT_OPEN_TAG, PHP_INI_ALL,OnUpdateBool, short_tags, zend_compiler_globals, compiler_globals) STD_PHP_INI_BOOLEAN(sql.safe_mode,0, PHP_INI_SYSTEM, OnUpdateBool, sql_safe_mode, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(track_errors, 0, PHP_INI_ALL,OnUpdateBool, track_errors, php_core_globals, core_globals) STD_PHP_INI_BOOLEAN(y2k_compliance, 1, PHP_INI_ALL,OnUpdateBool, y2k_compliance, php_core_globals, core_globals) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
pajoye Wed Mar 5 21:20:14 2008 UTC Modified files: /php-src/main main.c Log: - MFB: #42505, new sendmail default path breaks on Novell (Guenter Knauf) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.761r2=1.762diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.761 php-src/main/main.c:1.762 --- php-src/main/main.c:1.761 Wed Mar 5 13:35:02 2008 +++ php-src/main/main.c Wed Mar 5 21:20:14 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.761 2008/03/05 13:35:02 dmitry Exp $ */ +/* $Id: main.c,v 1.762 2008/03/05 21:20:14 pajoye Exp $ */ /* {{{ includes */ @@ -460,9 +460,8 @@ * PHP_INCLUDE_PATH */ -#if defined(PHP_PROG_SENDMAIL) !defined(NETWARE) -# define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL -t -i -#elif defined(PHP_WIN32) +/* Windows and Netware use the internal mail */ +#if defined(PHP_WIN32) || defined(NETWARE) # define DEFAULT_SENDMAIL_PATH NULL #else # define DEFAULT_SENDMAIL_PATH /usr/sbin/sendmail -t -i -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
pajoye Fri Feb 15 15:09:57 2008 UTC Modified files: /php-src/main main.c Log: - [DOC] MFB: add PHP_MAJOR_VERSION, PHP_MINOR_VERSION, PHP_RELEASE_VERSION, PHP_EXTRA_VERSION, PHP_VERSION_ID, PHP_ZTS and PHP_DEBUG constants http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.757r2=1.758diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.757 php-src/main/main.c:1.758 --- php-src/main/main.c:1.757 Mon Feb 4 20:38:42 2008 +++ php-src/main/main.c Fri Feb 15 15:09:56 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.757 2008/02/04 20:38:42 jani Exp $ */ +/* $Id: main.c,v 1.758 2008/02/15 15:09:56 pajoye Exp $ */ /* {{{ includes */ @@ -1743,6 +1743,17 @@ /* {{{ php_module_startup */ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint num_additional_modules) + REGISTER_MAIN_LONG_CONSTANT(PHP_MAJOR_VERSION, PHP_MAJOR_VERSION, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_MINOR_VERSION, PHP_MINOR_VERSION, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_RELEASE_VERSION, PHP_RELEASE_VERSION, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_EXTRA_VERSION, PHP_EXTRA_VERSION, sizeof(PHP_EXTRA_VERSION) - 1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_VERSION_ID, PHP_VERSION_ID, CONST_PERSISTENT | CONST_CS); +#ifdef ZTS + REGISTER_MAIN_LONG_CONSTANT(PHP_ZTS, 1, CONST_PERSISTENT | CONST_CS); +#else + REGISTER_MAIN_LONG_CONSTANT(PHP_ZTS, 0, CONST_PERSISTENT | CONST_CS); +#endif + REGISTER_MAIN_LONG_CONSTANT(PHP_DEBUG, PHP_DEBUG, CONST_PERSISTENT | CONST_CS); { zend_utility_functions zuf; zend_utility_values zuv; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
felipe Sat Feb 16 02:28:11 2008 UTC Modified files: /php-src/main main.c Log: Fix build http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.758r2=1.759diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.758 php-src/main/main.c:1.759 --- php-src/main/main.c:1.758 Fri Feb 15 15:09:56 2008 +++ php-src/main/main.c Sat Feb 16 02:28:11 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.758 2008/02/15 15:09:56 pajoye Exp $ */ +/* $Id: main.c,v 1.759 2008/02/16 02:28:11 felipe Exp $ */ /* {{{ includes */ @@ -1743,17 +1743,6 @@ /* {{{ php_module_startup */ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint num_additional_modules) - REGISTER_MAIN_LONG_CONSTANT(PHP_MAJOR_VERSION, PHP_MAJOR_VERSION, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT(PHP_MINOR_VERSION, PHP_MINOR_VERSION, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT(PHP_RELEASE_VERSION, PHP_RELEASE_VERSION, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_EXTRA_VERSION, PHP_EXTRA_VERSION, sizeof(PHP_EXTRA_VERSION) - 1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_LONG_CONSTANT(PHP_VERSION_ID, PHP_VERSION_ID, CONST_PERSISTENT | CONST_CS); -#ifdef ZTS - REGISTER_MAIN_LONG_CONSTANT(PHP_ZTS, 1, CONST_PERSISTENT | CONST_CS); -#else - REGISTER_MAIN_LONG_CONSTANT(PHP_ZTS, 0, CONST_PERSISTENT | CONST_CS); -#endif - REGISTER_MAIN_LONG_CONSTANT(PHP_DEBUG, PHP_DEBUG, CONST_PERSISTENT | CONST_CS); { zend_utility_functions zuf; zend_utility_values zuv; @@ -1874,6 +1863,17 @@ le_index_ptr = zend_register_list_destructors_ex(NULL, NULL, index pointer, 0); /* Register constants */ +#ifdef ZTS + REGISTER_MAIN_LONG_CONSTANT(PHP_ZTS, 1, CONST_PERSISTENT | CONST_CS); +#else + REGISTER_MAIN_LONG_CONSTANT(PHP_ZTS, 0, CONST_PERSISTENT | CONST_CS); +#endif + REGISTER_MAIN_LONG_CONSTANT(PHP_MAJOR_VERSION, PHP_MAJOR_VERSION, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_MINOR_VERSION, PHP_MINOR_VERSION, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_RELEASE_VERSION, PHP_RELEASE_VERSION, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_EXTRA_VERSION, PHP_EXTRA_VERSION, sizeof(PHP_EXTRA_VERSION) - 1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_VERSION_ID, PHP_VERSION_ID, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_DEBUG, PHP_DEBUG, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_VERSION, PHP_VERSION, sizeof(PHP_VERSION)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_OS, php_os, strlen(php_os), CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_SAPI, sapi_module.name, strlen(sapi_module.name), CONST_PERSISTENT | CONST_CS); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
janiMon Feb 4 20:38:42 2008 UTC Modified files: /php-src/main main.c Log: - Allow using any constants registered by PHP in php.ini too http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.756r2=1.757diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.756 php-src/main/main.c:1.757 --- php-src/main/main.c:1.756 Tue Jan 22 09:29:29 2008 +++ php-src/main/main.c Mon Feb 4 20:38:42 2008 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.756 2008/01/22 09:29:29 dmitry Exp $ */ +/* $Id: main.c,v 1.757 2008/02/04 20:38:42 jani Exp $ */ /* {{{ includes */ @@ -1862,6 +1862,28 @@ le_index_ptr = zend_register_list_destructors_ex(NULL, NULL, index pointer, 0); + /* Register constants */ + REGISTER_MAIN_STRINGL_CONSTANT(PHP_VERSION, PHP_VERSION, sizeof(PHP_VERSION)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_OS, php_os, strlen(php_os), CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_SAPI, sapi_module.name, strlen(sapi_module.name), CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(DEFAULT_INCLUDE_PATH, PHP_INCLUDE_PATH, sizeof(PHP_INCLUDE_PATH)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_EXTENSION_DIR, PHP_EXTENSION_DIR, sizeof(PHP_EXTENSION_DIR)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_PREFIX, PHP_PREFIX, sizeof(PHP_PREFIX)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_BINDIR, PHP_BINDIR, sizeof(PHP_BINDIR)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_LIBDIR, PHP_LIBDIR, sizeof(PHP_LIBDIR)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_DATADIR, PHP_DATADIR, sizeof(PHP_DATADIR)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_SYSCONFDIR, PHP_SYSCONFDIR, sizeof(PHP_SYSCONFDIR)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_LOCALSTATEDIR, PHP_LOCALSTATEDIR, sizeof(PHP_LOCALSTATEDIR)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_PATH, PHP_CONFIG_FILE_PATH, strlen(PHP_CONFIG_FILE_PATH), CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_SCAN_DIR, PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_SHLIB_SUFFIX, PHP_SHLIB_SUFFIX, sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_EOL, PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_INT_MAX, LONG_MAX, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_LONG_CONSTANT(PHP_INT_SIZE, sizeof(long), CONST_PERSISTENT | CONST_CS); + + php_output_register_constants(TSRMLS_C); + php_rfc1867_register_constants(TSRMLS_C); + /* this will read in php.ini, set up the configuration parameters, load zend extensions and register php function extensions to be loaded later */ @@ -1930,26 +1952,6 @@ zend_set_utility_values(zuv); php_startup_sapi_content_types(TSRMLS_C); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_VERSION, PHP_VERSION, sizeof(PHP_VERSION)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_OS, php_os, strlen(php_os), CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_SAPI, sapi_module.name, strlen(sapi_module.name), CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(DEFAULT_INCLUDE_PATH, PHP_INCLUDE_PATH, sizeof(PHP_INCLUDE_PATH)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_EXTENSION_DIR, PHP_EXTENSION_DIR, sizeof(PHP_EXTENSION_DIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_PREFIX, PHP_PREFIX, sizeof(PHP_PREFIX)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_BINDIR, PHP_BINDIR, sizeof(PHP_BINDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_LIBDIR, PHP_LIBDIR, sizeof(PHP_LIBDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_DATADIR, PHP_DATADIR, sizeof(PHP_DATADIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_SYSCONFDIR, PHP_SYSCONFDIR, sizeof(PHP_SYSCONFDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_LOCALSTATEDIR, PHP_LOCALSTATEDIR, sizeof(PHP_LOCALSTATEDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_PATH, PHP_CONFIG_FILE_PATH, strlen(PHP_CONFIG_FILE_PATH), CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_SCAN_DIR, PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT | CONST_CS); -
[PHP-CVS] cvs: php-src /main main.c
bjori Sat Dec 29 02:21:25 2007 UTC Modified files: /php-src/main main.c Log: Update the class method documentation links http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.753r2=1.754diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.753 php-src/main/main.c:1.754 --- php-src/main/main.c:1.753 Thu Nov 22 13:33:53 2007 +++ php-src/main/main.c Sat Dec 29 02:21:25 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.753 2007/11/22 13:33:53 dmitry Exp $ */ +/* $Id: main.c,v 1.754 2007/12/29 02:21:25 bjori Exp $ */ /* {{{ includes */ @@ -58,6 +58,7 @@ #include php_main.h #include fopen_wrappers.h #include ext/standard/php_standard.h +#include ext/standard/php_string.h #include php_variables.h #include ext/standard/credits.h #ifdef PHP_WIN32 @@ -744,23 +745,24 @@ /* no docref given but function is known (the default) */ if (!docref function.v) { + int doclen; if (space[0] == '\0') { if (function_name_is_string) { - spprintf(docref_buf, 0, function.%s, function.s); + doclen = spprintf(docref_buf, 0, function.%s, function.s); } else { - spprintf(docref_buf, 0, function.%v, function); + doclen = spprintf(docref_buf, 0, function.%v, function); } } else { if (function_name_is_string) { - spprintf(docref_buf, 0, function.%v-%s, class_name, function.s); + doclen = spprintf(docref_buf, 0, %v.%s, class_name, function.s); } else { - spprintf(docref_buf, 0, function.%v-%v, class_name, function); + doclen = spprintf(docref_buf, 0, %v.%v, class_name, function); } } while((p = strchr(docref_buf, '_')) != NULL) { *p = '-'; } - docref = docref_buf; + docref = php_strtolower(docref_buf, doclen); } /* we have a docref for a function AND -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Thu Oct 18 13:12:01 2007 UTC Modified files: /php-src/main main.c Log: Fixed bug #42722 (display_errors setting ignored for E_PARSE and HTTP 500 page) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.751r2=1.752diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.751 php-src/main/main.c:1.752 --- php-src/main/main.c:1.751 Mon Oct 1 14:56:34 2007 +++ php-src/main/main.c Thu Oct 18 13:12:01 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.751 2007/10/01 14:56:34 iliaa Exp $ */ +/* $Id: main.c,v 1.752 2007/10/18 13:12:01 dmitry Exp $ */ /* {{{ includes */ @@ -1070,7 +1070,8 @@ case E_USER_ERROR: EG(exit_status) = 255; if (module_initialized) { - if (!SG(headers_sent) + if (!PG(display_errors) + !SG(headers_sent) SG(sapi_headers).http_response_code == 200 ) { sapi_header_line ctr = {0}; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Mon Sep 24 11:53:57 2007 UTC Modified files: /php-src/main main.c Log: Fixed crash on POST request after dl(mbstring.so) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.748r2=1.749diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.748 php-src/main/main.c:1.749 --- php-src/main/main.c:1.748 Fri Sep 21 14:11:45 2007 +++ php-src/main/main.c Mon Sep 24 11:53:57 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.748 2007/09/21 14:11:45 tony2001 Exp $ */ +/* $Id: main.c,v 1.749 2007/09/24 11:53:57 dmitry Exp $ */ /* {{{ includes */ @@ -1407,6 +1407,8 @@ retval = FAILURE; } zend_end_try(); + SG(sapi_started) = 1; + return retval; } # else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
tony2001Fri Sep 21 14:11:45 2007 UTC Modified files: /php-src/main main.c Log: check for NULL (coverity issue #386) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.747r2=1.748diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.747 php-src/main/main.c:1.748 --- php-src/main/main.c:1.747 Thu Sep 13 20:06:15 2007 +++ php-src/main/main.c Fri Sep 21 14:11:45 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.747 2007/09/13 20:06:15 stas Exp $ */ +/* $Id: main.c,v 1.748 2007/09/21 14:11:45 tony2001 Exp $ */ /* {{{ includes */ @@ -348,11 +348,13 @@ mode = PHP_DISPLAY_ERRORS_STDERR; } else if (value_length == 6 !strcasecmp(value, stdout)) { mode = PHP_DISPLAY_ERRORS_STDOUT; - } else { + } else if (value ){ mode = atoi(value); if (mode mode != PHP_DISPLAY_ERRORS_STDOUT mode != PHP_DISPLAY_ERRORS_STDERR) { mode = PHP_DISPLAY_ERRORS_STDOUT; } + } else { + mode = PHP_DISPLAY_ERRORS_STDOUT; } return mode; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
stasThu Sep 13 20:06:15 2007 UTC Modified files: /php-src/main main.c Log: MFB: disallow setting mail.force_extra_parameters from .htaccess http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.746r2=1.747diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.746 php-src/main/main.c:1.747 --- php-src/main/main.c:1.746 Fri Aug 31 08:35:07 2007 +++ php-src/main/main.c Thu Sep 13 20:06:15 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.746 2007/08/31 08:35:07 jani Exp $ */ +/* $Id: main.c,v 1.747 2007/09/13 20:06:15 stas Exp $ */ /* {{{ includes */ @@ -434,6 +434,18 @@ } /* }}} */ +/* {{{ PHP_INI_MH + */ +static PHP_INI_MH(OnChangeMailForceExtra) +{ + /* Don't allow changing it in htaccess */ + if (stage == PHP_INI_STAGE_HTACCESS) { + return FAILURE; + } + return SUCCESS; +} +/* }}} */ + /* * Need to be read from the environment (?): * PHP_AUTO_PREPEND_FILE @@ -524,7 +536,7 @@ PHP_INI_ENTRY(precision, 14, PHP_INI_ALL,OnSetPrecision) PHP_INI_ENTRY(sendmail_from, NULL, PHP_INI_ALL,NULL) PHP_INI_ENTRY(sendmail_path, DEFAULT_SENDMAIL_PATH, PHP_INI_SYSTEM, NULL) - PHP_INI_ENTRY(mail.force_extra_parameters,NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, NULL) + PHP_INI_ENTRY(mail.force_extra_parameters,NULL, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnChangeMailForceExtra) PHP_INI_ENTRY(disable_functions, , PHP_INI_SYSTEM, NULL) PHP_INI_ENTRY(disable_classes,, PHP_INI_SYSTEM, NULL) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
janiFri Aug 31 08:35:07 2007 UTC Modified files: /php-src/main main.c Log: ws http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.745r2=1.746diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.745 php-src/main/main.c:1.746 --- php-src/main/main.c:1.745 Tue Aug 28 12:12:02 2007 +++ php-src/main/main.c Fri Aug 31 08:35:07 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.745 2007/08/28 12:12:02 derick Exp $ */ +/* $Id: main.c,v 1.746 2007/08/31 08:35:07 jani Exp $ */ /* {{{ includes */ @@ -528,12 +528,12 @@ PHP_INI_ENTRY(disable_functions, , PHP_INI_SYSTEM, NULL) PHP_INI_ENTRY(disable_classes,, PHP_INI_SYSTEM, NULL) - STD_PHP_INI_BOOLEAN(allow_url_fopen, 1, PHP_INI_ALL,OnUpdateAllowUrl, allow_url_fopen_list, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN(allow_url_include,0, PHP_INI_ALL,OnUpdateAllowUrl, allow_url_include_list, php_core_globals, core_globals) - STD_PHP_INI_BOOLEAN(always_populate_raw_post_data,0, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, always_populate_raw_post_data, php_core_globals, core_globals) - STD_PHP_INI_ENTRY(realpath_cache_size, 16K, PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_size_limit, virtual_cwd_globals, cwd_globals) - STD_PHP_INI_ENTRY(realpath_cache_ttl, 120, PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_ttl, virtual_cwd_globals, cwd_globals) + STD_PHP_INI_BOOLEAN(allow_url_fopen, 1, PHP_INI_ALL,OnUpdateAllowUrl, allow_url_fopen_list, php_core_globals, core_globals) + STD_PHP_INI_BOOLEAN(allow_url_include,0, PHP_INI_ALL,OnUpdateAllowUrl, allow_url_include_list, php_core_globals, core_globals) + STD_PHP_INI_BOOLEAN(always_populate_raw_post_data,0, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, always_populate_raw_post_data, php_core_globals, core_globals) + STD_PHP_INI_ENTRY(realpath_cache_size,16K, PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_size_limit, virtual_cwd_globals,cwd_globals) + STD_PHP_INI_ENTRY(realpath_cache_ttl, 120, PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_ttl, virtual_cwd_globals,cwd_globals) PHP_INI_END() /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
derick Tue Aug 28 12:12:02 2007 UTC Modified files: /php-src/main main.c Log: - Fixed allow_url_fopen_list/allow_url_include_list handling by making sure the pointers are initialized. Thanks to Sara. http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.744r2=1.745diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.744 php-src/main/main.c:1.745 --- php-src/main/main.c:1.744 Fri Aug 3 01:40:05 2007 +++ php-src/main/main.c Tue Aug 28 12:12:02 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.744 2007/08/03 01:40:05 stas Exp $ */ +/* $Id: main.c,v 1.745 2007/08/28 12:12:02 derick Exp $ */ /* {{{ includes */ @@ -1814,6 +1814,8 @@ PG(error_handling) = EH_NORMAL; PG(disable_functions) = NULL; PG(disable_classes) = NULL; + PG(allow_url_fopen_list) = NULL; + PG(allow_url_include_list) = NULL; #if HAVE_SETLOCALE setlocale(LC_CTYPE, ); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
johannesWed Aug 1 12:49:23 2007 UTC Modified files: /php-src/main main.c Log: - Fix #42164 Internal Sendmail Support is ALWAYS disabled http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.741r2=1.742diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.741 php-src/main/main.c:1.742 --- php-src/main/main.c:1.741 Tue Jul 24 20:14:03 2007 +++ php-src/main/main.c Wed Aug 1 12:49:23 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.741 2007/07/24 20:14:03 tony2001 Exp $ */ +/* $Id: main.c,v 1.742 2007/08/01 12:49:23 johannes Exp $ */ /* {{{ includes */ @@ -427,6 +427,8 @@ #if defined(PHP_PROG_SENDMAIL) !defined(NETWARE) # define DEFAULT_SENDMAIL_PATH PHP_PROG_SENDMAIL -t -i +#elif defined(PHP_WIN32) +# define DEFAULT_SENDMAIL_PATH NULL #else # define DEFAULT_SENDMAIL_PATH /usr/sbin/sendmail -t -i #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
stasWed Aug 1 23:54:06 2007 UTC Modified files: /php-src/main main.c Log: revert wrong fix http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.742r2=1.743diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.742 php-src/main/main.c:1.743 --- php-src/main/main.c:1.742 Wed Aug 1 12:49:23 2007 +++ php-src/main/main.c Wed Aug 1 23:54:06 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.742 2007/08/01 12:49:23 johannes Exp $ */ +/* $Id: main.c,v 1.743 2007/08/01 23:54:06 stas Exp $ */ /* {{{ includes */ @@ -542,9 +542,6 @@ return; } #endif - if (PG(open_basedir) php_check_open_basedir_ex(PG(error_log), 0 TSRMLS_CC)) { - return; - } fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644); if (fd != -1) { char *tmp; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
janiTue Jul 24 13:29:40 2007 UTC Modified files: /php-src/main main.c Log: fix folding http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.738r2=1.739diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.738 php-src/main/main.c:1.739 --- php-src/main/main.c:1.738 Sat Jul 21 01:41:55 2007 +++ php-src/main/main.c Tue Jul 24 13:29:39 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.738 2007/07/21 01:41:55 jani Exp $ */ +/* $Id: main.c,v 1.739 2007/07/24 13:29:39 jani Exp $ */ /* {{{ includes */ @@ -210,7 +210,10 @@ zend_set_timeout(EG(timeout_seconds)); return SUCCESS; } +/* }}} */ +/* {{{ PHP_INI_MH + */ static ZEND_INI_MH(OnUpdateOutputEncoding) { if (new_value) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
tony2001Tue Jul 24 20:14:03 2007 UTC Modified files: /php-src/main main.c Log: fix ZTS build http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.740r2=1.741diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.740 php-src/main/main.c:1.741 --- php-src/main/main.c:1.740 Tue Jul 24 14:18:47 2007 +++ php-src/main/main.c Tue Jul 24 20:14:03 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.740 2007/07/24 14:18:47 jani Exp $ */ +/* $Id: main.c,v 1.741 2007/07/24 20:14:03 tony2001 Exp $ */ /* {{{ includes */ @@ -374,6 +374,7 @@ { int mode, tmp_value_length, cgi_or_cli; char *tmp_value; + TSRMLS_FETCH(); if (type == ZEND_INI_DISPLAY_ORIG ini_entry-modified) { tmp_value = (ini_entry-orig_value ? ini_entry-orig_value : NULL ); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c php_open_temporary_file.c php_open_temporary_file.h php_streams.h /main/streams filter.c
janiSat Jul 21 01:41:55 2007 UTC Modified files: /php-src/main main.c php_open_temporary_file.c php_open_temporary_file.h php_streams.h /php-src/main/streams filter.c Log: - Fix compile warnings http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.737r2=1.738diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.737 php-src/main/main.c:1.738 --- php-src/main/main.c:1.737 Sun Jul 15 15:20:29 2007 +++ php-src/main/main.c Sat Jul 21 01:41:55 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.737 2007/07/15 15:20:29 jani Exp $ */ +/* $Id: main.c,v 1.738 2007/07/21 01:41:55 jani Exp $ */ /* {{{ includes */ @@ -512,14 +512,14 @@ /* {{{ php_verror helpers */ /* {{{ php_during_module_startup */ -static int php_during_module_startup() +static int php_during_module_startup(void) { return module_startup; } /* }}} */ /* {{{ php_during_module_shutdown */ -static int php_during_module_shutdown() +static int php_during_module_shutdown(void) { return module_shutdown; } @@ -1869,7 +1869,7 @@ } /* }}} */ -void php_module_shutdown_for_exec() +void php_module_shutdown_for_exec(void) { /* used to close fd's in the range 3.255 here, but it's problematic */ } @@ -2165,7 +2165,7 @@ #ifdef PHP_WIN32 /* {{{ dummy_indent just so that this symbol gets exported... */ -PHPAPI void dummy_indent() +PHPAPI void dummy_indent(void) { zend_indent(); } http://cvs.php.net/viewvc.cgi/php-src/main/php_open_temporary_file.c?r1=1.42r2=1.43diff_format=u Index: php-src/main/php_open_temporary_file.c diff -u php-src/main/php_open_temporary_file.c:1.42 php-src/main/php_open_temporary_file.c:1.43 --- php-src/main/php_open_temporary_file.c:1.42 Tue Feb 6 17:35:42 2007 +++ php-src/main/php_open_temporary_file.c Sat Jul 21 01:41:55 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_open_temporary_file.c,v 1.42 2007/02/06 17:35:42 tony2001 Exp $ */ +/* $Id: php_open_temporary_file.c,v 1.43 2007/07/21 01:41:55 jani Exp $ */ #include php.h @@ -151,7 +151,7 @@ /* Cache the chosen temporary directory. */ static char* temporary_directory; -PHPAPI void php_shutdown_temporary_directory() +PHPAPI void php_shutdown_temporary_directory(void) { if (temporary_directory) { free(temporary_directory); http://cvs.php.net/viewvc.cgi/php-src/main/php_open_temporary_file.h?r1=1.16r2=1.17diff_format=u Index: php-src/main/php_open_temporary_file.h diff -u php-src/main/php_open_temporary_file.h:1.16 php-src/main/php_open_temporary_file.h:1.17 --- php-src/main/php_open_temporary_file.h:1.16 Sat Feb 3 14:57:24 2007 +++ php-src/main/php_open_temporary_file.h Sat Jul 21 01:41:55 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_open_temporary_file.h,v 1.16 2007/02/03 14:57:24 helly Exp $ */ +/* $Id: php_open_temporary_file.h,v 1.17 2007/07/21 01:41:55 jani Exp $ */ #ifndef PHP_OPEN_TEMPORARY_FILE_H #define PHP_OPEN_TEMPORARY_FILE_H @@ -25,7 +25,7 @@ PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); PHPAPI const char *php_get_temporary_directory(void); -PHPAPI void php_shutdown_temporary_directory(); +PHPAPI void php_shutdown_temporary_directory(void); END_EXTERN_C() #endif /* PHP_OPEN_TEMPORARY_FILE_H */ http://cvs.php.net/viewvc.cgi/php-src/main/php_streams.h?r1=1.130r2=1.131diff_format=u Index: php-src/main/php_streams.h diff -u php-src/main/php_streams.h:1.130 php-src/main/php_streams.h:1.131 --- php-src/main/php_streams.h:1.130Mon Jul 9 16:42:45 2007 +++ php-src/main/php_streams.h Sat Jul 21 01:41:55 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_streams.h,v 1.130 2007/07/09 16:42:45 dmitry Exp $ */ +/* $Id: php_streams.h,v 1.131 2007/07/21 01:41:55 jani Exp $ */ #ifndef PHP_STREAMS_H #define PHP_STREAMS_H @@ -681,7 +681,7 @@ PHPAPI HashTable *php_stream_get_url_stream_wrappers_hash_global(void); PHPAPI HashTable *_php_get_stream_filters_hash(TSRMLS_D); #define php_get_stream_filters_hash() _php_get_stream_filters_hash(TSRMLS_C) -PHPAPI HashTable *php_get_stream_filters_hash_global(); +PHPAPI HashTable *php_get_stream_filters_hash_global(void); extern php_stream_wrapper_ops *php_stream_user_wrapper_ops; END_EXTERN_C() #endif http://cvs.php.net/viewvc.cgi/php-src/main/streams/filter.c?r1=1.42r2=1.43diff_format=u Index: php-src/main/streams/filter.c diff -u php-src/main/streams/filter.c:1.42 php-src/main/streams/filter.c:1.43 --- php-src/main/streams/filter.c:1.42 Mon Jan 15 14:59:40 2007 +++
[PHP-CVS] cvs: php-src /main main.c
janiSun Jul 15 15:20:30 2007 UTC Modified files: /php-src/main main.c Log: MFB: free error messages + ws fix http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.736r2=1.737diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.736 php-src/main/main.c:1.737 --- php-src/main/main.c:1.736 Wed Jul 11 17:39:04 2007 +++ php-src/main/main.c Sun Jul 15 15:20:29 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.736 2007/07/11 17:39:04 johannes Exp $ */ +/* $Id: main.c,v 1.737 2007/07/15 15:20:29 jani Exp $ */ /* {{{ includes */ @@ -564,8 +564,9 @@ } else if (php_during_module_shutdown()) { stage = PHP Shutdown; } else if (EG(current_execute_data) - EG(current_execute_data)-opline - EG(current_execute_data)-opline-opcode == ZEND_INCLUDE_OR_EVAL) { + EG(current_execute_data)-opline + EG(current_execute_data)-opline-opcode == ZEND_INCLUDE_OR_EVAL + ) { switch (EG(current_execute_data)-opline-op2.u.constant.value.lval) { case ZEND_EVAL: function.s = eval; @@ -940,9 +941,10 @@ EG(exit_status) = 255; if (module_initialized) { if (!SG(headers_sent) - SG(sapi_headers).http_response_code == 200) { + SG(sapi_headers).http_response_code == 200 + ) { sapi_header_line ctr = {0}; - + ctr.line = HTTP/1.0 500 Internal Server Error; ctr.line_len = strlen(ctr.line); sapi_header_op(SAPI_HEADER_REPLACE, ctr TSRMLS_CC); @@ -1257,7 +1259,7 @@ if (PG(output_handler) PG(output_handler)[0]) { zval *oh; - + MAKE_STD_ZVAL(oh); ZVAL_ASCII_STRING(oh, PG(output_handler), ZSTR_DUPLICATE); php_output_start_user(oh, 0, PHP_OUTPUT_HANDLER_STDFLAGS TSRMLS_CC); @@ -1450,6 +1452,16 @@ } } zend_end_try(); + /* 6.5 free last error information */ + if (PG(last_error_message)) { + free(PG(last_error_message)); + PG(last_error_message) = NULL; + } + if (PG(last_error_file)) { + free(PG(last_error_file)); + PG(last_error_file) = NULL; + } + /* 7. Shutdown scanner/executor/compiler and restore ini entries */ zend_deactivate(TSRMLS_C); @@ -1922,7 +1934,7 @@ #ifndef ZTS core_globals_dtor(core_globals TSRMLS_CC); #else - ts_free_id(core_globals_id); + ts_free_id(core_globals_id); #endif #if defined(PHP_WIN32) defined(_MSC_VER) (_MSC_VER = 1400) @@ -1980,8 +1992,9 @@ * otherwise it will get opened and added to the included_files list in zend_execute_scripts */ if (primary_file-filename - primary_file-opened_path == NULL - primary_file-type != ZEND_HANDLE_FILENAME) { + primary_file-opened_path == NULL + primary_file-type != ZEND_HANDLE_FILENAME + ) { int realfile_len; int dummy = 1; if (VCWD_REALPATH(primary_file-filename, realfile)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
janiWed Jul 11 10:23:47 2007 UTC Modified files: /php-src/main main.c Log: - No return value for void function http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.734r2=1.735diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.734 php-src/main/main.c:1.735 --- php-src/main/main.c:1.734 Tue Jul 10 18:42:01 2007 +++ php-src/main/main.c Wed Jul 11 10:23:47 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.734 2007/07/10 18:42:01 stas Exp $ */ +/* $Id: main.c,v 1.735 2007/07/11 10:23:47 jani Exp $ */ /* {{{ includes */ @@ -454,7 +454,7 @@ } #endif if (PG(open_basedir) php_check_open_basedir_ex(PG(error_log), 0 TSRMLS_CC)) { - return FAILURE; + return; } fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644); if (fd != -1) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
stasTue Jul 10 18:42:01 2007 UTC Modified files: /php-src/main main.c Log: check if write is allowed before writing to error log http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.733r2=1.734diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.733 php-src/main/main.c:1.734 --- php-src/main/main.c:1.733 Tue Jul 3 10:22:55 2007 +++ php-src/main/main.c Tue Jul 10 18:42:01 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.733 2007/07/03 10:22:55 dmitry Exp $ */ +/* $Id: main.c,v 1.734 2007/07/10 18:42:01 stas Exp $ */ /* {{{ includes */ @@ -453,6 +453,9 @@ return; } #endif + if (PG(open_basedir) php_check_open_basedir_ex(PG(error_log), 0 TSRMLS_CC)) { + return FAILURE; + } fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644); if (fd != -1) { char *tmp; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Fri Jun 15 07:28:49 2007 UTC Modified files: /php-src/main main.c Log: Prevent crash in case of wrong arguments to CRT functions (dtrftime()) on PHP complead by MS VC8 http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.729r2=1.730diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.729 php-src/main/main.c:1.730 --- php-src/main/main.c:1.729 Thu Jun 7 08:46:32 2007 +++ php-src/main/main.c Fri Jun 15 07:28:49 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.729 2007/06/07 08:46:32 tony2001 Exp $ */ +/* $Id: main.c,v 1.730 2007/06/15 07:28:49 dmitry Exp $ */ /* {{{ includes */ @@ -1763,6 +1763,36 @@ /* start additional PHP extensions */ php_register_extensions(additional_modules, num_additional_modules TSRMLS_CC); +#if defined(PHP_WIN32) defined(_MSC_VER) (_MSC_VER = 1400) +static _invalid_parameter_handler old_invalid_parameter_handler; + +void dummy_invalid_parameter_handler( + const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, + unsigned int line, + uintptr_t pEwserved) +{ + static int called = 0; + char buf[1024]; + int len; + + if (!called) { + called = 1; + if (function) { + if (file) { + len = _snprintf(buf, sizeof(buf)-1, Invalid parameter detected in CRT function '%ws' (%ws:%d), function, file, line); + } else { + len = _snprintf(buf, sizeof(buf)-1, Invalid parameter detected in CRT function '%ws', function); + } + } else { + len = _snprintf(buf, sizeof(buf)-1, Invalid CRT parameters detected); + } + zend_error(E_WARNING, %s, buf); + called = 0; + } +} +#endif /* load and startup extensions compiled as shared objects (aka DLLs) as requested by php.ini entries @@ -1872,6 +1902,12 @@ #else ts_free_id(core_globals_id); #endif + +#if defined(PHP_WIN32) defined(_MSC_VER) (_MSC_VER = 1400) + if (old_invalid_parameter_handler == NULL) { + _set_invalid_parameter_handler(old_invalid_parameter_handler); + } +#endif } /* }}} */ @@ -1967,6 +2003,13 @@ fchdir(old_cwd_fd); close(old_cwd_fd); } +#if defined(_MSC_VER) (_MSC_VER = 1400) + old_invalid_parameter_handler = + _set_invalid_parameter_handler(dummy_invalid_parameter_handler); + if (old_invalid_parameter_handler != NULL) { + _set_invalid_parameter_handler(old_invalid_parameter_handler); + } +#endif #else if (old_cwd[0] != '\0') { VCWD_CHDIR(old_cwd); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Fri Jun 15 07:32:17 2007 UTC Modified files: /php-src/main main.c Log: (wrong previous patch) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.730r2=1.731diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.730 php-src/main/main.c:1.731 --- php-src/main/main.c:1.730 Fri Jun 15 07:28:49 2007 +++ php-src/main/main.c Fri Jun 15 07:32:17 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.730 2007/06/15 07:28:49 dmitry Exp $ */ +/* $Id: main.c,v 1.731 2007/06/15 07:32:17 dmitry Exp $ */ /* {{{ includes */ @@ -1547,6 +1547,37 @@ } /* }}} */ +#if defined(PHP_WIN32) defined(_MSC_VER) (_MSC_VER = 1400) +static _invalid_parameter_handler old_invalid_parameter_handler; + +void dummy_invalid_parameter_handler( + const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, + unsigned int line, + uintptr_t pEwserved) +{ + static int called = 0; + char buf[1024]; + int len; + + if (!called) { + called = 1; + if (function) { + if (file) { + len = _snprintf(buf, sizeof(buf)-1, Invalid parameter detected in CRT function '%ws' (%ws:%d), function, file, line); + } else { + len = _snprintf(buf, sizeof(buf)-1, Invalid parameter detected in CRT function '%ws', function); + } + } else { + len = _snprintf(buf, sizeof(buf)-1, Invalid CRT parameters detected); + } + zend_error(E_WARNING, %s, buf); + called = 0; + } +} +#endif + /* {{{ php_module_startup */ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint num_additional_modules) @@ -1576,6 +1607,13 @@ php_os=WIN32; } } +#if defined(_MSC_VER) (_MSC_VER = 1400) + old_invalid_parameter_handler = + _set_invalid_parameter_handler(dummy_invalid_parameter_handler); + if (old_invalid_parameter_handler != NULL) { + _set_invalid_parameter_handler(old_invalid_parameter_handler); + } +#endif #else php_os=PHP_OS; #endif @@ -1763,37 +1801,6 @@ /* start additional PHP extensions */ php_register_extensions(additional_modules, num_additional_modules TSRMLS_CC); -#if defined(PHP_WIN32) defined(_MSC_VER) (_MSC_VER = 1400) -static _invalid_parameter_handler old_invalid_parameter_handler; - -void dummy_invalid_parameter_handler( - const wchar_t *expression, - const wchar_t *function, - const wchar_t *file, - unsigned int line, - uintptr_t pEwserved) -{ - static int called = 0; - char buf[1024]; - int len; - - if (!called) { - called = 1; - if (function) { - if (file) { - len = _snprintf(buf, sizeof(buf)-1, Invalid parameter detected in CRT function '%ws' (%ws:%d), function, file, line); - } else { - len = _snprintf(buf, sizeof(buf)-1, Invalid parameter detected in CRT function '%ws', function); - } - } else { - len = _snprintf(buf, sizeof(buf)-1, Invalid CRT parameters detected); - } - zend_error(E_WARNING, %s, buf); - called = 0; - } -} -#endif - /* load and startup extensions compiled as shared objects (aka DLLs) as requested by php.ini entries theese are loaded after initialization of internal extensions @@ -2003,13 +2010,6 @@ fchdir(old_cwd_fd); close(old_cwd_fd); } -#if defined(_MSC_VER) (_MSC_VER = 1400) - old_invalid_parameter_handler = - _set_invalid_parameter_handler(dummy_invalid_parameter_handler); - if (old_invalid_parameter_handler != NULL) { - _set_invalid_parameter_handler(old_invalid_parameter_handler); - } -#endif #else if (old_cwd[0] != '\0') { VCWD_CHDIR(old_cwd); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
tony2001Sun Apr 8 08:02:02 2007 UTC Modified files: /php-src/main main.c Log: MFB: Avoid locks when appening to the error log file http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.724r2=1.725diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.724 php-src/main/main.c:1.725 --- php-src/main/main.c:1.724 Wed Mar 28 10:22:32 2007 +++ php-src/main/main.c Sun Apr 8 08:02:02 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.724 2007/03/28 10:22:32 tony2001 Exp $ */ +/* $Id: main.c,v 1.725 2007/04/08 08:02:02 tony2001 Exp $ */ /* {{{ includes */ @@ -27,6 +27,7 @@ #include php.h #include stdio.h +#include fcntl.h #ifdef PHP_WIN32 #include win32/time.h #include win32/signal.h @@ -440,7 +441,7 @@ */ PHPAPI void php_log_err(char *log_message TSRMLS_DC) { - FILE *log_file; + int fd = -1; char error_time_str[128]; struct tm tmbuf; time_t error_time; @@ -453,14 +454,16 @@ return; } #endif - log_file = VCWD_FOPEN(PG(error_log), ab); - if (log_file != NULL) { + fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644); + if (fd != -1) { + char *tmp; + int len; time(error_time); strftime(error_time_str, sizeof(error_time_str), %d-%b-%Y %H:%M:%S, php_localtime_r(error_time, tmbuf)); - fprintf(log_file, [%s] , error_time_str); - fprintf(log_file, %s, log_message); - fprintf(log_file, %s, PHP_EOL); - fclose(log_file); + len = spprintf(tmp, 0, [%s] %s%s, error_time_str, log_message, PHP_EOL); + write(fd, tmp, len); + efree(tmp); + close(fd); return; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c php_globals.h php_variables.c
stasFri Mar 2 22:04:46 2007 UTC Modified files: /php-src/main main.c php_globals.h php_variables.c Log: limit nesting level of input variables http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.722r2=1.723diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.722 php-src/main/main.c:1.723 --- php-src/main/main.c:1.722 Sat Feb 3 14:57:24 2007 +++ php-src/main/main.c Fri Mar 2 22:04:46 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.722 2007/02/03 14:57:24 helly Exp $ */ +/* $Id: main.c,v 1.723 2007/03/02 22:04:46 stas Exp $ */ /* {{{ includes */ @@ -402,6 +402,7 @@ STD_PHP_INI_ENTRY(upload_max_filesize,2M, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLong, upload_max_filesize,php_core_globals, core_globals) STD_PHP_INI_ENTRY(post_max_size, 8M, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLong, post_max_size, sapi_globals_struct,sapi_globals) STD_PHP_INI_ENTRY(upload_tmp_dir, NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, upload_tmp_dir, php_core_globals, core_globals) + STD_PHP_INI_ENTRY(max_input_nesting_level, 64, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLongGEZero, max_input_nesting_level,php_core_globals, core_globals) STD_PHP_INI_ENTRY(user_dir, NULL, PHP_INI_SYSTEM, OnUpdateString, user_dir, php_core_globals, core_globals) STD_PHP_INI_ENTRY(variables_order,EGPCS, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateStringUnempty, variables_order,php_core_globals, core_globals) http://cvs.php.net/viewvc.cgi/php-src/main/php_globals.h?r1=1.110r2=1.111diff_format=u Index: php-src/main/php_globals.h diff -u php-src/main/php_globals.h:1.110 php-src/main/php_globals.h:1.111 --- php-src/main/php_globals.h:1.110Wed Jan 24 21:43:47 2007 +++ php-src/main/php_globals.h Fri Mar 2 22:04:46 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_globals.h,v 1.110 2007/01/24 21:43:47 pollita Exp $ */ +/* $Id: php_globals.h,v 1.111 2007/03/02 22:04:46 stas Exp $ */ #ifndef PHP_GLOBALS_H #define PHP_GLOBALS_H @@ -141,6 +141,7 @@ #ifdef PHP_WIN32 zend_bool com_initialized; #endif + long max_input_nesting_level; }; http://cvs.php.net/viewvc.cgi/php-src/main/php_variables.c?r1=1.136r2=1.137diff_format=u Index: php-src/main/php_variables.c diff -u php-src/main/php_variables.c:1.136 php-src/main/php_variables.c:1.137 --- php-src/main/php_variables.c:1.136 Mon Jan 1 09:29:35 2007 +++ php-src/main/php_variables.cFri Mar 2 22:04:46 2007 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_variables.c,v 1.136 2007/01/01 09:29:35 sebastian Exp $ */ +/* $Id: php_variables.c,v 1.137 2007/03/02 22:04:46 stas Exp $ */ #include stdio.h #include php.h @@ -127,10 +127,16 @@ index_len = var_len; if (is_array) { + int nest_level = 0; while (1) { char *index_s; int new_idx_len = 0; + if(++nest_level PG(max_input_nesting_level)) { + /* too many levels of nesting */ + php_error_docref(NULL TSRMLS_CC, E_ERROR, Input variable nesting level more than allowed %d (change max_input_nesting_level in php.ini to increase the limit), PG(max_input_nesting_level)); + } + ip++; index_s = ip; if (isspace(*ip)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c php_open_temporary_file.c php_open_temporary_file.h
helly Sat Feb 3 14:57:25 2007 UTC Modified files: /php-src/main main.c php_open_temporary_file.c php_open_temporary_file.h Log: - Fix memleak http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.721r2=1.722diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.721 php-src/main/main.c:1.722 --- php-src/main/main.c:1.721 Wed Jan 24 21:43:47 2007 +++ php-src/main/main.c Sat Feb 3 14:57:24 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.721 2007/01/24 21:43:47 pollita Exp $ */ +/* $Id: main.c,v 1.722 2007/02/03 14:57:24 helly Exp $ */ /* {{{ includes */ @@ -83,6 +83,7 @@ #include php_ticks.h #include php_logos.h #include php_streams.h +#include php_open_temporary_file.h #include SAPI.h #include rfc1867.h @@ -1852,6 +1853,7 @@ #endif php_output_shutdown(); + php_shutdown_temporary_directory(); module_initialized = 0; http://cvs.php.net/viewvc.cgi/php-src/main/php_open_temporary_file.c?r1=1.40r2=1.41diff_format=u Index: php-src/main/php_open_temporary_file.c diff -u php-src/main/php_open_temporary_file.c:1.40 php-src/main/php_open_temporary_file.c:1.41 --- php-src/main/php_open_temporary_file.c:1.40 Mon Jan 1 09:29:35 2007 +++ php-src/main/php_open_temporary_file.c Sat Feb 3 14:57:24 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_open_temporary_file.c,v 1.40 2007/01/01 09:29:35 sebastian Exp $ */ +/* $Id: php_open_temporary_file.c,v 1.41 2007/02/03 14:57:24 helly Exp $ */ #include php.h @@ -148,14 +148,22 @@ } /* }}} */ +/* Cache the chosen temporary directory. */ +static char* temporary_directory; + +PHPAPI void php_shutdown_temporary_directory() +{ + if (temporary_directory) { + free(temporary_directory); + temporary_directory = NULL; + } +} + /* * Determine where to place temporary files. */ PHPAPI const char* php_get_temporary_directory(void) { - /* Cache the chosen temporary directory. */ - static char* temporary_directory; - /* Did we determine the temporary directory already? */ if (temporary_directory) { return temporary_directory; http://cvs.php.net/viewvc.cgi/php-src/main/php_open_temporary_file.h?r1=1.15r2=1.16diff_format=u Index: php-src/main/php_open_temporary_file.h diff -u php-src/main/php_open_temporary_file.h:1.15 php-src/main/php_open_temporary_file.h:1.16 --- php-src/main/php_open_temporary_file.h:1.15 Mon Jan 1 09:29:35 2007 +++ php-src/main/php_open_temporary_file.h Sat Feb 3 14:57:24 2007 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_open_temporary_file.h,v 1.15 2007/01/01 09:29:35 sebastian Exp $ */ +/* $Id: php_open_temporary_file.h,v 1.16 2007/02/03 14:57:24 helly Exp $ */ #ifndef PHP_OPEN_TEMPORARY_FILE_H #define PHP_OPEN_TEMPORARY_FILE_H @@ -25,6 +25,7 @@ PHPAPI FILE *php_open_temporary_file(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); PHPAPI int php_open_temporary_fd(const char *dir, const char *pfx, char **opened_path_p TSRMLS_DC); PHPAPI const char *php_get_temporary_directory(void); +PHPAPI void php_shutdown_temporary_directory(); END_EXTERN_C() #endif /* PHP_OPEN_TEMPORARY_FILE_H */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
tony2001Thu Jan 18 12:37:44 2007 UTC Modified files: /php-src/main main.c Log: fix fodling, mark set_time_limit() unicode safe http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.719r2=1.720diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.719 php-src/main/main.c:1.720 --- php-src/main/main.c:1.719 Tue Jan 9 18:38:38 2007 +++ php-src/main/main.c Thu Jan 18 12:37:44 2007 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.719 2007/01/09 18:38:38 helly Exp $ */ +/* $Id: main.c,v 1.720 2007/01/18 12:37:44 tony2001 Exp $ */ /* {{{ includes */ @@ -123,7 +123,6 @@ } /* }}} */ - /* {{{ php_disable_functions */ static void php_disable_functions(TSRMLS_D) @@ -956,7 +955,7 @@ } /* }}} */ -/* {{{ proto bool set_time_limit(int seconds) +/* {{{ proto bool set_time_limit(int seconds) U Sets the maximum time a script can run */ PHP_FUNCTION(set_time_limit) { @@ -1001,22 +1000,25 @@ } /* }}} */ -static void stream_closer_for_zend(void *handle TSRMLS_DC) +static void stream_closer_for_zend(void *handle TSRMLS_DC) /* {{{ */ { php_stream_close((php_stream*)handle); } +/* }}} */ -static long stream_fteller_for_zend(void *handle TSRMLS_DC) +static long stream_fteller_for_zend(void *handle TSRMLS_DC) /* {{{ */ { return (long)php_stream_tell((php_stream*)handle); } +/* }}} */ -static int php_stream_open_for_zend(const char *filename, zend_file_handle *handle TSRMLS_DC) +static int php_stream_open_for_zend(const char *filename, zend_file_handle *handle TSRMLS_DC) /* {{{ */ { return php_stream_open_for_zend_ex(filename, handle, ENFORCE_SAFE_MODE|USE_PATH|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE TSRMLS_CC); } +/* }}} */ -PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *handle, int mode TSRMLS_DC) +PHPAPI int php_stream_open_for_zend_ex(const char *filename, zend_file_handle *handle, int mode TSRMLS_DC) /* {{{ */ { php_stream *stream; @@ -1038,6 +1040,7 @@ } return FAILURE; } +/* }}} */ /* {{{ php_get_configuration_directive_for_zend */ @@ -1135,12 +1138,12 @@ } /* }}} */ - -void php_on_timeout(int seconds TSRMLS_DC) +void php_on_timeout(int seconds TSRMLS_DC) /* {{{ */ { PG(connection_status) |= PHP_CONNECTION_TIMEOUT; zend_set_timeout(EG(timeout_seconds)); } +/* }}} */ #if PHP_SIGCHILD /* {{{ sigchld_handler @@ -1458,7 +1461,6 @@ } /* }}} */ - /* {{{ php_com_initialize */ PHPAPI void php_com_initialize(TSRMLS_D) @@ -1528,7 +1530,6 @@ } /* }}} */ - /* {{{ php_module_startup */ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_modules, uint num_additional_modules) @@ -1856,7 +1857,6 @@ } /* }}} */ - /* {{{ php_execute_script */ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
iliaa Sun Dec 17 18:30:50 2006 UTC Modified files: /php-src/main main.c Log: Fixed compiler warning http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.712r2=1.713diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.712 php-src/main/main.c:1.713 --- php-src/main/main.c:1.712 Fri Dec 8 19:13:31 2006 +++ php-src/main/main.c Sun Dec 17 18:30:50 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.712 2006/12/08 19:13:31 andrei Exp $ */ +/* $Id: main.c,v 1.713 2006/12/17 18:30:50 iliaa Exp $ */ /* {{{ includes */ @@ -1076,7 +1076,7 @@ if (message==ZMSG_MEMORY_LEAK_DETECTED) { zend_leak_info *t = (zend_leak_info *) data; - snprintf(memory_leak_buf, 512, %s(%d) : Freeing 0x%.8lX (%d bytes), script=%s\n, t-filename, t-lineno, (unsigned long)t-addr, t-size, SAFE_FILENAME(SG(request_info).path_translated)); + snprintf(memory_leak_buf, 512, %s(%d) : Freeing 0x%.8lX (%zu bytes), script=%s\n, t-filename, t-lineno, (unsigned long)t-addr, t-size, SAFE_FILENAME(SG(request_info).path_translated)); if (t-orig_filename) { char relay_buf[512]; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
andrei Fri Dec 8 19:13:31 2006 UTC Modified files: /php-src/main main.c Log: Don't use zend_ascii_hash_find() here -- module names are binary strings. http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.711r2=1.712diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.711 php-src/main/main.c:1.712 --- php-src/main/main.c:1.711 Tue Dec 5 02:55:27 2006 +++ php-src/main/main.c Fri Dec 8 19:13:31 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.711 2006/12/05 02:55:27 stas Exp $ */ +/* $Id: main.c,v 1.712 2006/12/08 19:13:31 andrei Exp $ */ /* {{{ includes */ @@ -1764,7 +1764,7 @@ if (sapi_module.additional_functions) { zend_module_entry *module; - if (zend_ascii_hash_find(module_registry, standard, sizeof(standard), (void**)module)==SUCCESS) { + if (zend_hash_find(module_registry, standard, sizeof(standard), (void**)module)==SUCCESS) { EG(current_module) = module; zend_register_functions(NULL, sapi_module.additional_functions, NULL, MODULE_PERSISTENT TSRMLS_CC); EG(current_module) = NULL; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
stasTue Dec 5 02:55:27 2006 UTC Modified files: /php-src/main main.c Log: Merge from 5.2: Improve tolower()-related functions on Windows and VC2005 by caching locale and using tolower_l function. http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.710r2=1.711diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.710 php-src/main/main.c:1.711 --- php-src/main/main.c:1.710 Mon Dec 4 15:58:35 2006 +++ php-src/main/main.c Tue Dec 5 02:55:27 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.710 2006/12/04 15:58:35 tony2001 Exp $ */ +/* $Id: main.c,v 1.711 2006/12/05 02:55:27 stas Exp $ */ /* {{{ includes */ @@ -1620,6 +1620,7 @@ #if HAVE_SETLOCALE setlocale(LC_CTYPE, ); + zend_update_current_locale(); #endif #if HAVE_TZSET -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Thu Nov 23 08:37:34 2006 UTC Modified files: /php-src/main main.c Log: Fixed bug #39548 (ZMSG_LOG_SCRIPT_NAME not routed to OutputDebugString() on Windows) http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.708r2=1.709diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.708 php-src/main/main.c:1.709 --- php-src/main/main.c:1.708 Fri Nov 17 11:41:13 2006 +++ php-src/main/main.c Thu Nov 23 08:37:34 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.708 2006/11/17 11:41:13 dmitry Exp $ */ +/* $Id: main.c,v 1.709 2006/11/23 08:37:34 dmitry Exp $ */ /* {{{ includes */ @@ -1114,12 +1114,18 @@ struct tm *ta, tmbuf; time_t curtime; char *datetime_str, asctimebuf[52]; + char memory_leak_buf[4096]; time(curtime); ta = php_localtime_r(curtime, tmbuf); datetime_str = php_asctime_r(ta, asctimebuf); datetime_str[strlen(datetime_str)-1]=0; /* get rid of the trailing newline */ - fprintf(stderr, [%s] Script: '%s'\n, datetime_str, SAFE_FILENAME(SG(request_info).path_translated)); + snprintf(memory_leak_buf, sizeof(memory_leak_buf), [%s] Script: '%s'\n, datetime_str, SAFE_FILENAME(SG(request_info).path_translated)); +# if defined(PHP_WIN32) + OutputDebugString(memory_leak_buf); +# else + fprintf(stderr, %s, memory_leak_buf); +# endif } break; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c ZendEngine2 zend.c zend.h zend_builtin_functions.c
pollita Tue Oct 3 16:28:02 2006 UTC Modified files: /ZendEngine2zend.c zend.h zend_builtin_functions.c /php-src/main main.c Log: PHP6 Update for get_included_files() and export of path decode for Zend http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c?r1=1.373r2=1.374diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.373 ZendEngine2/zend.c:1.374 --- ZendEngine2/zend.c:1.373Fri Sep 29 20:59:26 2006 +++ ZendEngine2/zend.c Tue Oct 3 16:28:02 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.c,v 1.373 2006/09/29 20:59:26 andrei Exp $ */ +/* $Id: zend.c,v 1.374 2006/10/03 16:28:02 pollita Exp $ */ #include zend.h #include zend_extensions.h @@ -56,6 +56,7 @@ ZEND_API int (*zend_printf)(const char *format, ...); ZEND_API zend_write_func_t zend_write; ZEND_API int (*zend_path_encode)(char **encpath, int *encpath_len, const UChar *path, int path_len TSRMLS_DC); +ZEND_API int (*zend_path_decode)(UChar **decpath, int *decpath_len, const char *path, int path_len TSRMLS_DC); ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path); ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); ZEND_API void (*zend_block_interruptions)(void); @@ -624,6 +625,22 @@ return SUCCESS; } +static int zend_path_decode_wrapper(UChar **decpath, int *decpath_len, const char *path, int path_len TSRMLS_DC) +{ + UErrorCode status = U_ZERO_ERROR; + + zend_string_to_unicode_ex(ZEND_U_CONVERTER(UG(filesystem_encoding_conv)), decpath, decpath_len, path, path_len, status); + + if (U_FAILURE(status)) { + efree(*decpath); + *decpath = NULL; + *decpath_len = 0; + return FAILURE; + } + + return SUCCESS; +} + static FILE *zend_fopen_wrapper(const char *filename, char **opened_path) { if (opened_path) { @@ -1012,6 +1029,10 @@ if (!zend_path_encode) { zend_path_encode = zend_path_encode_wrapper; } + zend_path_decode = utility_functions-path_decode_function; + if (!zend_path_decode) { + zend_path_decode = zend_path_decode_wrapper; + } zend_fopen = utility_functions-fopen_function; if (!zend_fopen) { zend_fopen = zend_fopen_wrapper; http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.h?r1=1.327r2=1.328diff_format=u Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.327 ZendEngine2/zend.h:1.328 --- ZendEngine2/zend.h:1.327Thu Sep 14 10:32:57 2006 +++ ZendEngine2/zend.h Tue Oct 3 16:28:02 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.h,v 1.327 2006/09/14 10:32:57 dmitry Exp $ */ +/* $Id: zend.h,v 1.328 2006/10/03 16:28:02 pollita Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -411,6 +411,7 @@ int (*printf_function)(const char *format, ...); int (*write_function)(const char *str, uint str_length); int (*path_encode_function)(char **encpath, int *encpath_len, const UChar *path, int path_len TSRMLS_DC); + int (*path_decode_function)(UChar **decpath, int *decpath_len, const char *path, int path_len TSRMLS_DC); FILE *(*fopen_function)(const char *filename, char **opened_path); void (*message_handler)(long message, void *data); void (*block_interruptions)(void); @@ -557,6 +558,7 @@ extern ZEND_API int (*zend_printf)(const char *format, ...); extern ZEND_API zend_write_func_t zend_write; extern ZEND_API int (*zend_path_encode)(char **encpath, int *encpath_len, const UChar *path, int path_len TSRMLS_DC); +extern ZEND_API int (*zend_path_decode)(UChar **decpath, int *decpath_len, const char *path, int path_len TSRMLS_DC); extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path); extern ZEND_API void (*zend_block_interruptions)(void); extern ZEND_API void (*zend_unblock_interruptions)(void); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.326r2=1.327diff_format=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.326 ZendEngine2/zend_builtin_functions.c:1.327 --- ZendEngine2/zend_builtin_functions.c:1.326 Tue Sep 26 07:55:40 2006 +++ ZendEngine2/zend_builtin_functions.cTue Oct 3 16:28:02 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_builtin_functions.c,v 1.326 2006/09/26 07:55:40 dmitry Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.327 2006/10/03 16:28:02 pollita Exp $ */ #include zend.h #include zend_API.h @@ -1197,22 +1197,28 @@ #endif /* ZEND_DEBUG */ -/* {{{ proto array get_included_files(void) - Returns an array with the file names that were include_once()'d */ +/* {{{ proto array get_included_files(void) U + Returns an
[PHP-CVS] cvs: php-src /main main.c
iliaa Mon Sep 25 14:49:34 2006 UTC Modified files: /php-src/main main.c Log: MFB: Fixed bug #38904 (apache2filter changes cwd to /). http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.702r2=1.703diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.702 php-src/main/main.c:1.703 --- php-src/main/main.c:1.702 Tue Sep 19 10:38:31 2006 +++ php-src/main/main.c Mon Sep 25 14:49:34 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.702 2006/09/19 10:38:31 dmitry Exp $ */ +/* $Id: main.c,v 1.703 2006/09/25 14:49:34 iliaa Exp $ */ /* {{{ includes */ @@ -1859,8 +1859,7 @@ PG(during_request_startup) = 0; - if (primary_file-type == ZEND_HANDLE_FILENAME -primary_file-filename) { + if ((primary_file-type == ZEND_HANDLE_FILENAME || primary_file-type == ZEND_HANDLE_STREAM) primary_file-filename) { #if HAVE_BROKEN_GETCWD /* this looks nasty to me */ old_cwd_fd = open(., 0); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
iliaa Mon Sep 18 23:11:02 2006 UTC Modified files: /php-src/main main.c Log: MFB: Avoid generating php_errormsg twice in some instances. http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.700r2=1.701diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.700 php-src/main/main.c:1.701 --- php-src/main/main.c:1.700 Thu Aug 17 13:43:51 2006 +++ php-src/main/main.c Mon Sep 18 23:11:01 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.700 2006/08/17 13:43:51 iliaa Exp $ */ +/* $Id: main.c,v 1.701 2006/09/18 23:11:01 iliaa Exp $ */ /* {{{ includes */ @@ -680,7 +680,8 @@ php_error(type, %s, message); efree(message); - if (PG(track_errors) module_initialized EG(active_symbol_table)) { + if (PG(track_errors) module_initialized EG(active_symbol_table) + (!EG(user_error_handler) || !(EG(user_error_handler_error_reporting) type))) { zval *tmp; ALLOC_INIT_ZVAL(tmp); ZVAL_RT_STRINGL(tmp, buffer, buffer_len, 1); @@ -947,8 +948,7 @@ if (PG(track_errors) module_initialized EG(active_symbol_table)) { zval *tmp; - ALLOC_ZVAL(tmp); - INIT_PZVAL(tmp); + ALLOC_INIT_ZVAL(tmp); ZVAL_RT_STRINGL(tmp, buffer, buffer_len, 1); zend_hash_update(EG(active_symbol_table), php_errormsg, sizeof(php_errormsg), (void **) tmp, sizeof(zval *), NULL); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Mon Jul 17 07:20:28 2006 UTC Modified files: /php-src/main main.c Log: Fixed memory leaks in ZTS mode http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.696r2=1.697diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.696 php-src/main/main.c:1.697 --- php-src/main/main.c:1.696 Thu Jul 13 17:55:50 2006 +++ php-src/main/main.c Mon Jul 17 07:20:28 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.696 2006/07/13 17:55:50 tony2001 Exp $ */ +/* $Id: main.c,v 1.697 2006/07/17 07:20:28 dmitry Exp $ */ /* {{{ includes */ @@ -1457,6 +1457,25 @@ /* }}} */ #endif +/* {{{ core_globals_dtor + */ +static void core_globals_dtor(php_core_globals *core_globals TSRMLS_DC) +{ + if (core_globals-last_error_message) { + free(core_globals-last_error_message); + } + if (core_globals-last_error_file) { + free(core_globals-last_error_file); + } + if (core_globals-disable_functions) { + free(core_globals-disable_functions); + } + if (core_globals-disable_classes) { + free(core_globals-disable_classes); + } +} +/* }}} */ + /* {{{ php_register_extensions */ int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC) @@ -1545,7 +1564,7 @@ #ifdef ZTS executor_globals = ts_resource(executor_globals_id); - ts_allocate_id(core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, NULL); + ts_allocate_id(core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, (ts_allocate_dtor) core_globals_dtor); core_globals = ts_resource(core_globals_id); #ifdef PHP_WIN32 ts_allocate_id(php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor) php_win32_core_globals_ctor, NULL); @@ -1795,18 +1814,12 @@ php_output_shutdown(); module_initialized = 0; - if (PG(last_error_message)) { - free(PG(last_error_message)); - } - if (PG(last_error_file)) { - free(PG(last_error_file)); - } - if (PG(disable_functions)) { - free(PG(disable_functions)); - } - if (PG(disable_classes)) { - free(PG(disable_classes)); - } + +#ifndef ZTS + core_globals_dtor(core_globals TSRMLS_CC); +#else + ts_free_id(core_globals_id); +#endif } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c ZendEngine2 zend.c zend.h zend_vm_def.h zend_vm_execute.h
andrei Wed Jul 12 17:04:14 2006 UTC Modified files: /ZendEngine2zend.c zend.h zend_vm_def.h zend_vm_execute.h /php-src/main main.c Log: Commit Sara's patch for supporting filesystem enccoding in include/require. http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.c?r1=1.363r2=1.364diff_format=u Index: ZendEngine2/zend.c diff -u ZendEngine2/zend.c:1.363 ZendEngine2/zend.c:1.364 --- ZendEngine2/zend.c:1.363Wed Jun 28 14:13:13 2006 +++ ZendEngine2/zend.c Wed Jul 12 17:04:12 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.c,v 1.363 2006/06/28 14:13:13 andrei Exp $ */ +/* $Id: zend.c,v 1.364 2006/07/12 17:04:12 andrei Exp $ */ #include zend.h #include zend_extensions.h @@ -55,6 +55,7 @@ ZEND_API zend_class_entry *zend_standard_class_def = NULL; ZEND_API int (*zend_printf)(const char *format, ...); ZEND_API zend_write_func_t zend_write; +ZEND_API int (*zend_path_encode)(char **encpath, int *encpath_len, const UChar *path, int path_len TSRMLS_DC); ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path); ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC); ZEND_API void (*zend_block_interruptions)(void); @@ -607,6 +608,21 @@ } } +static int zend_path_encode_wrapper(char **encpath, int *encpath_len, const UChar *path, int path_len TSRMLS_DC) +{ + UErrorCode status = U_ZERO_ERROR; + + zend_convert_from_unicode(ZEND_U_CONVERTER(UG(filesystem_encoding_conv)), encpath, encpath_len, path, path_len, status); + + if (U_FAILURE(status)) { + efree(*encpath); + *encpath = NULL; + *encpath_len = 0; + return FAILURE; + } + + return SUCCESS; +} static FILE *zend_fopen_wrapper(const char *filename, char **opened_path) { @@ -990,6 +1006,10 @@ zend_error_cb = utility_functions-error_function; zend_printf = utility_functions-printf_function; zend_write = (zend_write_func_t) utility_functions-write_function; + zend_path_encode = utility_functions-path_encode_function; + if (!zend_path_encode) { + zend_path_encode = zend_path_encode_wrapper; + } zend_fopen = utility_functions-fopen_function; if (!zend_fopen) { zend_fopen = zend_fopen_wrapper; http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.h?r1=1.323r2=1.324diff_format=u Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.323 ZendEngine2/zend.h:1.324 --- ZendEngine2/zend.h:1.323Mon Jun 12 17:06:39 2006 +++ ZendEngine2/zend.h Wed Jul 12 17:04:13 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend.h,v 1.323 2006/06/12 17:06:39 andrei Exp $ */ +/* $Id: zend.h,v 1.324 2006/07/12 17:04:13 andrei Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -410,6 +410,7 @@ void (*error_function)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args); int (*printf_function)(const char *format, ...); int (*write_function)(const char *str, uint str_length); + int (*path_encode_function)(char **encpath, int *encpath_len, const UChar *path, int path_len TSRMLS_DC); FILE *(*fopen_function)(const char *filename, char **opened_path); void (*message_handler)(long message, void *data); void (*block_interruptions)(void); @@ -555,6 +556,7 @@ BEGIN_EXTERN_C() extern ZEND_API int (*zend_printf)(const char *format, ...); extern ZEND_API zend_write_func_t zend_write; +extern ZEND_API int (*zend_path_encode)(char **encpath, int *encpath_len, const UChar *path, int path_len TSRMLS_DC); extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path); extern ZEND_API void (*zend_block_interruptions)(void); extern ZEND_API void (*zend_unblock_interruptions)(void); http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.122r2=1.123diff_format=u Index: ZendEngine2/zend_vm_def.h diff -u ZendEngine2/zend_vm_def.h:1.122 ZendEngine2/zend_vm_def.h:1.123 --- ZendEngine2/zend_vm_def.h:1.122 Tue Jul 11 08:52:44 2006 +++ ZendEngine2/zend_vm_def.h Wed Jul 12 17:04:13 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: zend_vm_def.h,v 1.122 2006/07/11 08:52:44 dmitry Exp $ */ +/* $Id: zend_vm_def.h,v 1.123 2006/07/12 17:04:13 andrei Exp $ */ /* If you change this file, please regenerate the zend_vm_execute.h and * zend_vm_opcodes.h files by running: @@ -2761,7 +2761,19 @@ convert_to_unicode(tmp_inc_filename); inc_filename = tmp_inc_filename; } - } else if (Z_TYPE_P(inc_filename)!=IS_STRING) { + } else if (Z_TYPE_P(inc_filename) == IS_UNICODE) { + char *encpath; + int
[PHP-CVS] cvs: php-src /main main.c
johannesSat May 27 20:53:38 2006 UTC Modified files: /php-src/main main.c Log: - nitpicking PHP6 vs. PHP 6 http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.691r2=1.692diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.691 php-src/main/main.c:1.692 --- php-src/main/main.c:1.691 Wed May 24 22:00:57 2006 +++ php-src/main/main.c Sat May 27 20:53:38 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.691 2006/05/24 22:00:57 edink Exp $ */ +/* $Id: main.c,v 1.692 2006/05/27 20:53:38 johannes Exp $ */ /* {{{ includes */ @@ -1602,7 +1602,7 @@ while (*p) { if (cfg_get_long((char*)*p, val) == SUCCESS val) { - zend_error(E_CORE_ERROR, Directive '%s' is no longer supported in PHP6 and greater, *p); + zend_error(E_CORE_ERROR, Directive '%s' is no longer supported in PHP 6 and greater, *p); } ++p; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
edink Wed May 24 22:00:57 2006 UTC Modified files: /php-src/main main.c Log: MFB: Initialize windows globals, fixes #37428 http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.690r2=1.691diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.690 php-src/main/main.c:1.691 --- php-src/main/main.c:1.690 Fri May 19 06:11:02 2006 +++ php-src/main/main.c Wed May 24 22:00:57 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.690 2006/05/19 06:11:02 dmitry Exp $ */ +/* $Id: main.c,v 1.691 2006/05/24 22:00:57 edink Exp $ */ /* {{{ includes */ @@ -30,6 +30,7 @@ #ifdef PHP_WIN32 #include win32/time.h #include win32/signal.h +#include win32/php_win32_globals.h #include process.h #elif defined(NETWARE) #include sys/timeval.h @@ -1539,6 +1540,9 @@ executor_globals = ts_resource(executor_globals_id); ts_allocate_id(core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, NULL); core_globals = ts_resource(core_globals_id); +#ifdef PHP_WIN32 + ts_allocate_id(php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor) php_win32_core_globals_ctor, NULL); +#endif #endif EG(bailout) = NULL; EG(error_reporting) = E_ALL ~E_NOTICE; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
iliaa Tue May 16 00:40:36 2006 UTC Modified files: /php-src/main main.c Log: MFB: Disable realpath cache when open_basedir or safe_mode are enabled on a per-request basis. http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.688r2=1.689diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.688 php-src/main/main.c:1.689 --- php-src/main/main.c:1.688 Thu May 11 22:08:55 2006 +++ php-src/main/main.c Tue May 16 00:40:36 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.688 2006/05/11 22:08:55 dmitry Exp $ */ +/* $Id: main.c,v 1.689 2006/05/16 00:40:36 iliaa Exp $ */ /* {{{ includes */ @@ -1197,6 +1197,11 @@ zend_set_timeout(PG(max_input_time)); } + /* Disable realpath cache if safe_mode or open_basedir are set */ + if (PG(open_basedir) *PG(open_basedir)) { + CWDG(realpath_cache_size_limit) = 0; + } + if (PG(expose_php)) { sapi_add_header(SAPI_PHP_VERSION_HEADER, sizeof(SAPI_PHP_VERSION_HEADER)-1, 1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
helly Thu May 11 07:55:48 2006 UTC Modified files: /php-src/main main.c Log: - Fix error mode handling http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.686r2=1.687diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.686 php-src/main/main.c:1.687 --- php-src/main/main.c:1.686 Wed Apr 12 12:52:00 2006 +++ php-src/main/main.c Thu May 11 07:55:48 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.686 2006/04/12 12:52:00 tony2001 Exp $ */ +/* $Id: main.c,v 1.687 2006/05/11 07:55:48 helly Exp $ */ /* {{{ includes */ @@ -796,8 +796,10 @@ /* according to error handling mode, suppress error, throw exception or show it */ if (PG(error_handling) != EH_NORMAL) { switch (type) { + case E_ERROR: case E_CORE_ERROR: case E_COMPILE_ERROR: + case E_USER_ERROR: case E_PARSE: /* fatal errors are real errors and cannot be made exceptions */ break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c /sapi/cli php_cli.c
dmitry Thu May 11 22:08:55 2006 UTC Modified files: /php-src/main main.c /php-src/sapi/cli php_cli.c Log: Fixed bug #37306 (max_execution_time = max_input_time). http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.687r2=1.688diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.687 php-src/main/main.c:1.688 --- php-src/main/main.c:1.687 Thu May 11 07:55:48 2006 +++ php-src/main/main.c Thu May 11 22:08:55 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.687 2006/05/11 07:55:48 helly Exp $ */ +/* $Id: main.c,v 1.688 2006/05/11 22:08:55 dmitry Exp $ */ /* {{{ includes */ @@ -1871,11 +1871,11 @@ } else { append_file_p = NULL; } - if (PG(max_input_time) == -1) { + if (PG(max_input_time) != -1) { #ifdef PHP_WIN32 zend_unset_timeout(TSRMLS_C); #endif - zend_set_timeout(EG(timeout_seconds)); + zend_set_timeout(INI_INT(max_execution_time)); } retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS); http://cvs.php.net/viewcvs.cgi/php-src/sapi/cli/php_cli.c?r1=1.152r2=1.153diff_format=u Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.152 php-src/sapi/cli/php_cli.c:1.153 --- php-src/sapi/cli/php_cli.c:1.152Sat Apr 29 14:53:26 2006 +++ php-src/sapi/cli/php_cli.c Thu May 11 22:08:55 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_cli.c,v 1.152 2006/04/29 14:53:26 fmk Exp $ */ +/* $Id: php_cli.c,v 1.153 2006/05/11 22:08:55 dmitry Exp $ */ #include php.h #include php_globals.h @@ -111,8 +111,8 @@ register_argc_argv=1\n\ implicit_flush=1\n\ output_buffering=0\n \ - max_execution_time=0\n - + max_execution_time=0\n\ + max_input_time=-1\n static char *php_optarg = NULL; static int php_optind = 1; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Fri Apr 7 11:43:43 2006 UTC Modified files: /php-src/main main.c Log: We don't need setup the same time-out two times. http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.684r2=1.685diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.684 php-src/main/main.c:1.685 --- php-src/main/main.c:1.684 Wed Mar 29 01:20:43 2006 +++ php-src/main/main.c Fri Apr 7 11:43:43 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.684 2006/03/29 01:20:43 pollita Exp $ */ +/* $Id: main.c,v 1.685 2006/04/07 11:43:43 dmitry Exp $ */ /* {{{ includes */ @@ -1861,10 +1861,12 @@ } else { append_file_p = NULL; } + if (PG(max_input_time) == -1) { #ifdef PHP_WIN32 - zend_unset_timeout(TSRMLS_C); + zend_unset_timeout(TSRMLS_C); #endif - zend_set_timeout(INI_INT(max_execution_time)); + zend_set_timeout(EG(timeout_seconds)); + } retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS); } zend_end_try(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Tue Mar 21 08:49:58 2006 UTC Modified files: /php-src/main main.c Log: Fixed bug #36809 (__FILE__ behavior changed) http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.679r2=1.680diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.679 php-src/main/main.c:1.680 --- php-src/main/main.c:1.679 Fri Mar 17 13:45:43 2006 +++ php-src/main/main.c Tue Mar 21 08:49:58 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.679 2006/03/17 13:45:43 dmitry Exp $ */ +/* $Id: main.c,v 1.680 2006/03/21 08:49:58 dmitry Exp $ */ /* {{{ includes */ @@ -1831,6 +1831,7 @@ if (VCWD_REALPATH(primary_file-filename, realfile)) { realfile_len = strlen(realfile); zend_hash_add(EG(included_files), realfile, realfile_len+1, (void *)dummy, sizeof(int), NULL); + primary_file-opened_path = estrndup(realfile, realfile_len); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
tony2001Tue Mar 21 13:46:51 2006 UTC Modified files: /php-src/main main.c Log: fix spelling http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.680r2=1.681diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.680 php-src/main/main.c:1.681 --- php-src/main/main.c:1.680 Tue Mar 21 08:49:58 2006 +++ php-src/main/main.c Tue Mar 21 13:46:51 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.680 2006/03/21 08:49:58 dmitry Exp $ */ +/* $Id: main.c,v 1.681 2006/03/21 13:46:51 tony2001 Exp $ */ /* {{{ includes */ @@ -1583,7 +1583,7 @@ while (*p) { if (cfg_get_long((char*)*p, val) == SUCCESS val) { - zend_error(E_CORE_ERROR, Directive '%s' is not longer supported in PHP-6 and above, *p); + zend_error(E_CORE_ERROR, Directive '%s' is no longer supported in PHP6 and greater, *p); } ++p; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c TSRM TSRM.c TSRM.h
dmitry Tue Mar 14 15:16:27 2006 UTC Modified files: /TSRM TSRM.c TSRM.h /php-src/main main.c Log: Fixed bug #35988 (Unknown persistent list entry type in module shutdown) http://cvs.php.net/viewcvs.cgi/TSRM/TSRM.c?r1=1.70r2=1.71diff_format=u Index: TSRM/TSRM.c diff -u TSRM/TSRM.c:1.70 TSRM/TSRM.c:1.71 --- TSRM/TSRM.c:1.70Wed Jan 4 23:54:12 2006 +++ TSRM/TSRM.c Tue Mar 14 15:16:27 2006 @@ -480,6 +480,52 @@ } +/* frees all resources allocated for all threads except current */ +void ts_free_worker_threads(void) +{ + tsrm_tls_entry *thread_resources; + int i; + THREAD_T thread_id = tsrm_thread_id(); + int hash_value; + tsrm_tls_entry *last=NULL; + + tsrm_mutex_lock(tsmm_mutex); + hash_value = THREAD_HASH_OF(thread_id, tsrm_tls_table_size); + thread_resources = tsrm_tls_table[hash_value]; + + while (thread_resources) { + if (thread_resources-thread_id != thread_id) { + for (i=0; ithread_resources-count; i++) { + if (resource_types_table[i].dtor) { + resource_types_table[i].dtor(thread_resources-storage[i], thread_resources-storage); + } + } + for (i=0; ithread_resources-count; i++) { + free(thread_resources-storage[i]); + } + free(thread_resources-storage); + if (last) { + last-next = thread_resources-next; + } else { + tsrm_tls_table[hash_value] = thread_resources-next; + } + free(thread_resources); + if (last) { + thread_resources = last-next; + } else { + thread_resources = tsrm_tls_table[hash_value]; + } + } else { + if (thread_resources-next) { + last = thread_resources; + } + thread_resources = thread_resources-next; + } + } + tsrm_mutex_unlock(tsmm_mutex); +} + + /* deallocates all occurrences of a given id */ void ts_free_id(ts_rsrc_id id) { http://cvs.php.net/viewcvs.cgi/TSRM/TSRM.h?r1=1.51r2=1.52diff_format=u Index: TSRM/TSRM.h diff -u TSRM/TSRM.h:1.51 TSRM/TSRM.h:1.52 --- TSRM/TSRM.h:1.51Wed Jan 4 23:54:12 2006 +++ TSRM/TSRM.h Tue Mar 14 15:16:27 2006 @@ -106,6 +106,9 @@ /* frees all resources allocated for the current thread */ TSRM_API void ts_free_thread(void); +/* frees all resources allocated for all threads except current */ +void ts_free_worker_threads(void); + /* deallocates all occurrences of a given id */ TSRM_API void ts_free_id(ts_rsrc_id id); http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.673r2=1.674diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.673 php-src/main/main.c:1.674 --- php-src/main/main.c:1.673 Mon Mar 13 09:36:05 2006 +++ php-src/main/main.c Tue Mar 14 15:16:27 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.673 2006/03/13 09:36:05 dmitry Exp $ */ +/* $Id: main.c,v 1.674 2006/03/14 15:16:27 dmitry Exp $ */ /* {{{ includes */ @@ -1699,6 +1699,10 @@ return; } +#ifdef ZTS + ts_free_worker_threads(); +#endif + #if defined(PHP_WIN32) || (defined(NETWARE) defined(USE_WINSOCK)) /*close winsock */ WSACleanup(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Mon Mar 13 09:36:05 2006 UTC Modified files: /php-src/main main.c Log: Fixed realpath() cache for main script with FastCGI SAPI http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.672r2=1.673diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.672 php-src/main/main.c:1.673 --- php-src/main/main.c:1.672 Fri Mar 10 18:16:24 2006 +++ php-src/main/main.c Mon Mar 13 09:36:05 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.672 2006/03/10 18:16:24 bfrance Exp $ */ +/* $Id: main.c,v 1.673 2006/03/13 09:36:05 dmitry Exp $ */ /* {{{ includes */ @@ -1752,7 +1752,6 @@ #else char *old_cwd; #endif - char *old_primary_file_path = NULL; int retval = 0; EG(exit_status) = 0; @@ -1789,16 +1788,14 @@ /* Only lookup the real file path and add it to the included_files list if already opened * otherwise it will get opened and added to the included_files list in zend_execute_scripts */ - if (primary_file-filename primary_file-type != ZEND_HANDLE_FILENAME) { + if (primary_file-filename + primary_file-opened_path == NULL + primary_file-type != ZEND_HANDLE_FILENAME) { int realfile_len; int dummy = 1; if (VCWD_REALPATH(primary_file-filename, realfile)) { realfile_len = strlen(realfile); zend_hash_add(EG(included_files), realfile, realfile_len+1, (void *)dummy, sizeof(int), NULL); - if (strncmp(realfile, primary_file-filename, realfile_len)) { - old_primary_file_path = primary_file-filename; - primary_file-filename = realfile; - } } } @@ -1827,10 +1824,6 @@ zend_set_timeout(INI_INT(max_execution_time)); retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS); - if (old_primary_file_path) { - primary_file-filename = old_primary_file_path; - } - } zend_end_try(); #if HAVE_BROKEN_GETCWD -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
bfrance Fri Mar 10 18:16:24 2006 UTC Modified files: /php-src/main main.c Log: for the primary file only lookup the real file path and add it to the included_files list if already opened otherwise it will get opened and added to the included_files list in zend_execute_scripts http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.671r2=1.672diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.671 php-src/main/main.c:1.672 --- php-src/main/main.c:1.671 Thu Mar 9 20:31:58 2006 +++ php-src/main/main.c Fri Mar 10 18:16:24 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.671 2006/03/09 20:31:58 pollita Exp $ */ +/* $Id: main.c,v 1.672 2006/03/10 18:16:24 bfrance Exp $ */ /* {{{ includes */ @@ -1786,7 +1786,10 @@ VCWD_CHDIR_FILE(primary_file-filename); } - if (primary_file-filename) { + /* Only lookup the real file path and add it to the included_files list if already opened +* otherwise it will get opened and added to the included_files list in zend_execute_scripts +*/ + if (primary_file-filename primary_file-type != ZEND_HANDLE_FILENAME) { int realfile_len; int dummy = 1; if (VCWD_REALPATH(primary_file-filename, realfile)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
pollita Thu Mar 9 20:31:58 2006 UTC Modified files: /php-src/main main.c Log: Move temporary local storage of primary file's realpath up one block to ensure it stays on the stack. http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.670r2=1.671diff_format=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.670 php-src/main/main.c:1.671 --- php-src/main/main.c:1.670 Wed Mar 8 14:41:45 2006 +++ php-src/main/main.c Thu Mar 9 20:31:58 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.670 2006/03/08 14:41:45 iliaa Exp $ */ +/* $Id: main.c,v 1.671 2006/03/09 20:31:58 pollita Exp $ */ /* {{{ includes */ @@ -1767,6 +1767,8 @@ #endif zend_try { + char realfile[MAXPATHLEN]; + #ifdef PHP_WIN32 UpdateIniFromRegistry(primary_file-filename TSRMLS_CC); #endif @@ -1785,7 +1787,6 @@ } if (primary_file-filename) { - char realfile[MAXPATHLEN]; int realfile_len; int dummy = 1; if (VCWD_REALPATH(primary_file-filename, realfile)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c TSRM tsrm_virtual_cwd.c tsrm_virtual_cwd.h
dmitry Mon Jan 16 09:17:50 2006 UTC Modified files: /TSRM tsrm_virtual_cwd.c tsrm_virtual_cwd.h /php-src/main main.c Log: Fixed bug #36016 (realpath cache memleaks) http://cvs.php.net/viewcvs.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.79r2=1.80diff_format=u Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.79 TSRM/tsrm_virtual_cwd.c:1.80 --- TSRM/tsrm_virtual_cwd.c:1.79Wed Jan 4 12:22:23 2006 +++ TSRM/tsrm_virtual_cwd.c Mon Jan 16 09:17:50 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.79 2006/01/04 12:22:23 derick Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.80 2006/01/16 09:17:50 dmitry Exp $ */ #include sys/types.h #include sys/stat.h @@ -163,18 +163,15 @@ static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC) { CWD_STATE_COPY(cwd_globals-cwd, main_cwd_state); -#ifdef REALPATH_CACHE cwd_globals-realpath_cache_size = 0; cwd_globals-realpath_cache_size_limit = REALPATH_CACHE_SIZE; cwd_globals-realpath_cache_ttl = REALPATH_CACHE_TTL; memset(cwd_globals-realpath_cache, 0, sizeof(cwd_globals-realpath_cache)); -#endif } static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals TSRMLS_DC) { CWD_STATE_FREE(cwd_globals-cwd); -#ifdef REALPATH_CACHE { int i; @@ -187,7 +184,6 @@ } } } -#endif } static char *tsrm_strndup(const char *s, size_t length) @@ -308,7 +304,6 @@ return buf; } -#ifdef REALPATH_CACHE static inline unsigned long realpath_cache_key(const char *path, int path_len) { register unsigned long h; @@ -352,19 +347,18 @@ while (*bucket != NULL) { if (CWDG(realpath_cache_ttl) (*bucket)-expires t) { realpath_cache_bucket *r = *bucket; - *bucket = (*bucket)-next; - CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r-path_len + 1 + r-realpath_len + 1; - free(r); + *bucket = (*bucket)-next; + CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r-path_len + 1 + r-realpath_len + 1; + free(r); } else if (key == (*bucket)-key path_len == (*bucket)-path_len memcmp(path, (*bucket)-path, path_len) == 0) { return *bucket; } else { - *bucket = (*bucket)-next; + bucket = (*bucket)-next; } } return NULL; } -#endif /* Resolve path relatively to state and put the real path into state */ @@ -385,20 +379,17 @@ #else char *new_path; #endif -#ifdef REALPATH_CACHE char orig_path[MAXPATHLEN]; int orig_path_len; realpath_cache_bucket *bucket; time_t t; TSRMLS_FETCH(); -#endif if (path_length == 0) return (0); if (path_length = MAXPATHLEN) return (1); -#ifdef REALPATH_CACHE if (use_realpath CWDG(realpath_cache_size_limit)) { if (IS_ABSOLUTE_PATH(path, path_length) || (state-cwd_length 1)) { memcpy(orig_path, path, path_length+1); @@ -430,7 +421,6 @@ } } } -#endif #if !defined(TSRM_WIN32) !defined(NETWARE) /* cwd_length can be 0 when getcwd() fails. * This can happen under solaris when a dir does not have read permissions @@ -609,11 +599,9 @@ #endif free(free_path); -#ifdef REALPATH_CACHE if (use_realpath CWDG(realpath_cache_size_limit)) { realpath_cache_add(orig_path, orig_path_len, state-cwd, state-cwd_length, t TSRMLS_CC); } -#endif if (verify_path verify_path(state)) { CWD_STATE_FREE(state); http://cvs.php.net/viewcvs.cgi/TSRM/tsrm_virtual_cwd.h?r1=1.50r2=1.51diff_format=u Index: TSRM/tsrm_virtual_cwd.h diff -u TSRM/tsrm_virtual_cwd.h:1.50 TSRM/tsrm_virtual_cwd.h:1.51 --- TSRM/tsrm_virtual_cwd.h:1.50Wed Jan 4 12:22:23 2006 +++ TSRM/tsrm_virtual_cwd.h Mon Jan 16 09:17:50 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: tsrm_virtual_cwd.h,v 1.50 2006/01/04 12:22:23 derick Exp $ */ +/* $Id: tsrm_virtual_cwd.h,v 1.51 2006/01/16 09:17:50 dmitry Exp $ */ #ifndef VIRTUAL_CWD_H #define VIRTUAL_CWD_H @@ -195,11 +195,9 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func verify_path, int use_realpath); -#define REALPATH_CACHE #define REALPATH_CACHE_TTL (2*60) /* 2 minutes */ #define REALPATH_CACHE_SIZE 0 /* disabled while php.ini isn't loaded */ -#ifdef REALPATH_CACHE typedef struct _realpath_cache_bucket { unsigned long
[PHP-CVS] cvs: php-src /main main.c
dmitry Wed Dec 7 04:00:33 2005 EDT Modified files: /php-src/main main.c Log: Fixed memory overflow, because usage of initialized value http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.657r2=1.658ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.657 php-src/main/main.c:1.658 --- php-src/main/main.c:1.657 Tue Dec 6 21:37:35 2005 +++ php-src/main/main.c Wed Dec 7 04:00:29 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.657 2005/12/07 02:37:35 iliaa Exp $ */ +/* $Id: main.c,v 1.658 2005/12/07 09:00:29 dmitry Exp $ */ /* {{{ includes */ @@ -556,6 +556,7 @@ char *origin; char *message; char *stage; + int function_name_is_string = 1; /* get error text into buffer and escape for html if necessary */ buffer_len = vspprintf(buffer, 0, format, args); @@ -595,6 +596,7 @@ stage = Unknown; } } else { + function_name_is_string = 0; function = get_active_function_name(TSRMLS_C); if (!function || !USTR_LEN(function)) { stage = Unknown; @@ -604,9 +606,13 @@ /* if we still have memory then format the origin */ if (function) { - spprintf(origin, 0, %v%s%v(%s), class_name, space, function, params); + if (function_name_is_string) { + origin_len = spprintf(origin, 0, %v%s%s(%s), class_name, space, function, params); + } else { + origin_len = spprintf(origin, 0, %v%s%v(%s), class_name, space, function, params); + } } else { - spprintf(origin, 0, %s, stage); + origin_len = spprintf(origin, 0, %s, stage); } if (PG(html_errors)) { @@ -614,7 +620,7 @@ char *replace = php_escape_html_entities(origin, origin_len, len, 0, ENT_COMPAT, NULL TSRMLS_CC); efree(origin); origin = replace; - } + } /* origin and buffer available, so lets come up with the error message */ if (docref docref[0] == '#') { @@ -624,7 +630,11 @@ /* no docref given but function is known (the default) */ if (!docref function) { - spprintf(docref_buf, 0, function.%v, function); + if (function_name_is_string) { + spprintf(docref_buf, 0, function.%s, function); + } else { + spprintf(docref_buf, 0, function.%v, function); + } while((p = strchr(docref_buf, '_')) != NULL) { *p = '-'; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
iliaa Tue Dec 6 18:32:27 2005 EDT Modified files: /php-src/main main.c Log: MFB51: Fixed bug #30760 (Remove MessageBox on win32 for E_CORE errors if display_startup_error is off). http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.655r2=1.656ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.655 php-src/main/main.c:1.656 --- php-src/main/main.c:1.655 Mon Dec 5 22:13:53 2005 +++ php-src/main/main.c Tue Dec 6 18:32:27 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.655 2005/12/06 03:13:53 iliaa Exp $ */ +/* $Id: main.c,v 1.656 2005/12/06 23:32:27 iliaa Exp $ */ /* {{{ includes */ @@ -862,9 +862,8 @@ if (!module_initialized || PG(log_errors)) { char *log_buffer; - #ifdef PHP_WIN32 - if (type==E_CORE_ERROR || type==E_CORE_WARNING) { + if ((type == E_CORE_ERROR || type == E_CORE_WARNING) PG(display_startup_errors)) { MessageBox(NULL, buffer, error_type_str, MB_OK|ZEND_SERVICE_MB_STYLE); } #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
iliaa Mon Dec 5 22:13:53 2005 EDT Modified files: /php-src/main main.c Log: MFB51: Fixed possible XSS inside error reporting functionality. http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.654r2=1.655ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.654 php-src/main/main.c:1.655 --- php-src/main/main.c:1.654 Mon Dec 5 20:04:39 2005 +++ php-src/main/main.c Mon Dec 5 22:13:53 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.654 2005/12/06 01:04:39 sniper Exp $ */ +/* $Id: main.c,v 1.655 2005/12/06 03:13:53 iliaa Exp $ */ /* {{{ includes */ @@ -551,6 +551,7 @@ int buffer_len = 0; char *space; char *class_name = get_active_class_name(space TSRMLS_CC); + int origin_len; char *function = NULL; char *origin; char *message; @@ -608,6 +609,13 @@ spprintf(origin, 0, %s, stage); } + if (PG(html_errors)) { + int len; + char *replace = php_escape_html_entities(origin, origin_len, len, 0, ENT_COMPAT, NULL TSRMLS_CC); + efree(origin); + origin = replace; + } + /* origin and buffer available, so lets come up with the error message */ if (docref docref[0] == '#') { docref_target = strchr(docref, '#'); @@ -877,10 +885,17 @@ } else { char *prepend_string = INI_STR(error_prepend_string); char *append_string = INI_STR(error_append_string); - char *error_format = PG(html_errors) ? - %sbr /\nb%s/b: %s in b%s/b on line b%d/bbr /\n%s - : %s\n%s: %s in %s on line %d\n%s; - php_printf(error_format, STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); + + if (PG(html_errors)) { + char *buf, *buf2; + int len2, len = spprintf(buf, 0, %sbr /\nb%s/b: %s in b%s/b on line b%d/bbr /\n%s, STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); + buf2 = php_escape_html_entities(buf, len, len2, 0, ENT_COMPAT, NULL TSRMLS_CC); + php_printf(%s, buf2); + efree(buf); + efree(buf2); + } else { + php_printf(%s\n%s: %s in %s on line %d\n%s, STR_PRINT(prepend_string), error_type_str, buffer, error_filename, error_lineno, STR_PRINT(append_string)); + } } } #if ZEND_DEBUG -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
iliaa Thu Nov 24 19:07:57 2005 EDT Modified files: /php-src/main main.c Log: MFB51: Fixed bug #35170 (PHP_AUTH_DIGEST differs under Apache 1.x and 2.x) http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.652r2=1.653ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.652 php-src/main/main.c:1.653 --- php-src/main/main.c:1.652 Fri Nov 18 11:20:43 2005 +++ php-src/main/main.c Thu Nov 24 19:07:57 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.652 2005/11/18 16:20:43 rasmus Exp $ */ +/* $Id: main.c,v 1.653 2005/11/25 00:07:57 iliaa Exp $ */ /* {{{ includes */ @@ -1924,7 +1924,7 @@ } if (ret == -1 auth auth[0] != '\0' strncmp(auth, Digest , 7) == 0) { - SG(request_info).auth_digest = estrdup(auth); + SG(request_info).auth_digest = estrdup(auth + 7); ret = 0; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c /tests/lang bug35176.phpt
dmitry Tue Nov 15 06:14:34 2005 EDT Modified files: /php-src/tests/lang bug35176.phpt /php-src/main main.c Log: Fixed bug #35176 (include()/require()/*_once() produce wrong error messages about main()) http://cvs.php.net/diff.php/php-src/tests/lang/bug35176.phpt?r1=1.1r2=1.2ty=u Index: php-src/tests/lang/bug35176.phpt diff -u /dev/null php-src/tests/lang/bug35176.phpt:1.2 --- /dev/null Tue Nov 15 06:14:34 2005 +++ php-src/tests/lang/bug35176.phptTue Nov 15 06:14:34 2005 @@ -0,0 +1,14 @@ +--TEST-- +Bug #35176 (include()/require()/*_once() produce wrong error messages about main()) +--INI-- +html_errors=1 +error_reporting=4095 +--FILE-- +?php +require_once('nonexisiting.php'); +? +--EXPECTF-- +br / +bWarning/b: require_once(nonexisiting.php) [a href='function.require-once.html'function.require-once.html/a]: failed to open stream: No such file or directory in b%sbug35176.php/b on line b2/bbr / +br / +bFatal error/b: require_once() [a href='function.require.html'function.require.html/a]: Failed opening required 'nonexisiting.php' (%s) in b%sbug35176.php/b on line b2/bbr / http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.650r2=1.651ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.650 php-src/main/main.c:1.651 --- php-src/main/main.c:1.650 Sun Oct 9 22:26:13 2005 +++ php-src/main/main.c Tue Nov 15 06:14:34 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.650 2005/10/10 02:26:13 rrichards Exp $ */ +/* $Id: main.c,v 1.651 2005/11/15 11:14:34 dmitry Exp $ */ /* {{{ includes */ @@ -570,6 +570,28 @@ stage = PHP Startup; } else if (php_during_module_shutdown()) { stage = PHP Shutdown; + } else if (EG(current_execute_data) + EG(current_execute_data)-opline + EG(current_execute_data)-opline-opcode == ZEND_INCLUDE_OR_EVAL) { + switch (EG(current_execute_data)-opline-op2.u.constant.value.lval) { + case ZEND_EVAL: + function = eval; + break; + case ZEND_INCLUDE: + function = include; + break; + case ZEND_INCLUDE_ONCE: + function = include_once; + break; + case ZEND_REQUIRE: + function = require; + break; + case ZEND_REQUIRE_ONCE: + function = require_once; + break; + default: + stage = Unknown; + } } else { function = get_active_function_name(TSRMLS_C); if (!function || !USTR_LEN(function)) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
rrichards Sun Oct 9 22:26:14 2005 EDT Modified files: /php-src/main main.c Log: PHP_CONFIG_FILE_PATH needs to use strlen() due to Win build http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.649r2=1.650ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.649 php-src/main/main.c:1.650 --- php-src/main/main.c:1.649 Thu Sep 15 12:19:46 2005 +++ php-src/main/main.c Sun Oct 9 22:26:13 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.649 2005/09/15 16:19:46 derick Exp $ */ +/* $Id: main.c,v 1.650 2005/10/10 02:26:13 rrichards Exp $ */ /* {{{ includes */ @@ -1593,7 +1593,7 @@ REGISTER_MAIN_STRINGL_CONSTANT(PHP_DATADIR, PHP_DATADIR, sizeof(PHP_DATADIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_SYSCONFDIR, PHP_SYSCONFDIR, sizeof(PHP_SYSCONFDIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_LOCALSTATEDIR, PHP_LOCALSTATEDIR, sizeof(PHP_LOCALSTATEDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_PATH, PHP_CONFIG_FILE_PATH, sizeof(PHP_CONFIG_FILE_PATH)-1, CONST_PERSISTENT | CONST_CS); + REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_PATH, PHP_CONFIG_FILE_PATH, strlen(PHP_CONFIG_FILE_PATH), CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_SCAN_DIR, PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_SHLIB_SUFFIX, PHP_SHLIB_SUFFIX, sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_EOL, PHP_EOL, sizeof(PHP_EOL)-1, CONST_PERSISTENT | CONST_CS); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c php_ini.c php_ini.h
sniper Fri Sep 2 10:08:10 2005 EDT Modified files: /php-src/main main.c php_ini.c php_ini.h Log: revert http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.647r2=1.648ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.647 php-src/main/main.c:1.648 --- php-src/main/main.c:1.647 Thu Sep 1 10:42:52 2005 +++ php-src/main/main.c Fri Sep 2 10:08:09 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.647 2005/09/01 14:42:52 sniper Exp $ */ +/* $Id: main.c,v 1.648 2005/09/02 14:08:09 sniper Exp $ */ /* {{{ includes */ @@ -1535,8 +1535,10 @@ le_index_ptr = zend_register_list_destructors_ex(NULL, NULL, index pointer, 0); - /* Initialize configuration_hash */ - if (php_init_config_hash() == FAILURE) { + /* this will read in php.ini, set up the configuration parameters, + load zend extensions and register php function extensions + to be loaded later */ + if (php_init_config(TSRMLS_C) == FAILURE) { return FAILURE; } @@ -1546,13 +1548,6 @@ /* Register Zend ini entries */ zend_register_standard_ini_entries(TSRMLS_C); - /* this will read in php.ini, set up the configuration parameters, - load zend extensions and register php function extensions - to be loaded later */ - if (php_init_config(TSRMLS_C) == FAILURE) { - return FAILURE; - } - orig_unicode = UG(unicode); UG(unicode) = 0; http://cvs.php.net/diff.php/php-src/main/php_ini.c?r1=1.138r2=1.139ty=u Index: php-src/main/php_ini.c diff -u php-src/main/php_ini.c:1.138 php-src/main/php_ini.c:1.139 --- php-src/main/php_ini.c:1.138Fri Sep 2 04:26:05 2005 +++ php-src/main/php_ini.c Fri Sep 2 10:08:09 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_ini.c,v 1.138 2005/09/02 08:26:05 sniper Exp $ */ +/* $Id: php_ini.c,v 1.139 2005/09/02 14:08:09 sniper Exp $ */ #include php.h #include ext/standard/info.h @@ -254,14 +254,6 @@ } /* }}} */ -/* {{{ php_init_config_hash - */ -int php_init_config_hash(void) -{ - return zend_hash_init(configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1); -} -/* }}} */ - /* {{{ php_init_config */ int php_init_config(TSRMLS_D) @@ -278,6 +270,10 @@ int l, total_l=0; zend_llist_element *element; + if (zend_hash_init(configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1) == FAILURE) { + return FAILURE; + } + if (sapi_module.ini_defaults) { sapi_module.ini_defaults(configuration_hash); } http://cvs.php.net/diff.php/php-src/main/php_ini.h?r1=1.46r2=1.47ty=u Index: php-src/main/php_ini.h diff -u php-src/main/php_ini.h:1.46 php-src/main/php_ini.h:1.47 --- php-src/main/php_ini.h:1.46 Thu Sep 1 10:42:54 2005 +++ php-src/main/php_ini.h Fri Sep 2 10:08:09 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_ini.h,v 1.46 2005/09/01 14:42:54 sniper Exp $ */ +/* $Id: php_ini.h,v 1.47 2005/09/02 14:08:09 sniper Exp $ */ #ifndef PHP_INI_H #define PHP_INI_H @@ -24,7 +24,6 @@ #include zend_ini.h BEGIN_EXTERN_C() -int php_init_config_hash(void); int php_init_config(TSRMLS_D); int php_shutdown_config(void); void php_ini_register_extensions(TSRMLS_D); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c php_ini.c php_ini.h
sniper Thu Sep 1 10:42:56 2005 EDT Modified files: /php-src/main main.c php_ini.c php_ini.h Log: - Fixed bug #34307 (OnUpdateStringUnempty INI options can be set as empty) http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.646r2=1.647ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.646 php-src/main/main.c:1.647 --- php-src/main/main.c:1.646 Mon Aug 29 02:51:51 2005 +++ php-src/main/main.c Thu Sep 1 10:42:52 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.646 2005/08/29 06:51:51 dmitry Exp $ */ +/* $Id: main.c,v 1.647 2005/09/01 14:42:52 sniper Exp $ */ /* {{{ includes */ @@ -1535,17 +1535,24 @@ le_index_ptr = zend_register_list_destructors_ex(NULL, NULL, index pointer, 0); + /* Initialize configuration_hash */ + if (php_init_config_hash() == FAILURE) { + return FAILURE; + } + + /* Register PHP core ini entries */ + REGISTER_INI_ENTRIES(); + + /* Register Zend ini entries */ + zend_register_standard_ini_entries(TSRMLS_C); /* this will read in php.ini, set up the configuration parameters, load zend extensions and register php function extensions to be loaded later */ - if (php_init_config() == FAILURE) { + if (php_init_config(TSRMLS_C) == FAILURE) { return FAILURE; } - REGISTER_INI_ENTRIES(); - zend_register_standard_ini_entries(TSRMLS_C); - orig_unicode = UG(unicode); UG(unicode) = 0; http://cvs.php.net/diff.php/php-src/main/php_ini.c?r1=1.136r2=1.137ty=u Index: php-src/main/php_ini.c diff -u php-src/main/php_ini.c:1.136 php-src/main/php_ini.c:1.137 --- php-src/main/php_ini.c:1.136Mon Aug 8 12:49:43 2005 +++ php-src/main/php_ini.c Thu Sep 1 10:42:53 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_ini.c,v 1.136 2005/08/08 16:49:43 sniper Exp $ */ +/* $Id: php_ini.c,v 1.137 2005/09/01 14:42:53 sniper Exp $ */ #include php.h #include ext/standard/info.h @@ -163,16 +163,6 @@ # endif #endif -/* {{{ pvalue_config_destructor - */ -static void pvalue_config_destructor(zval *pvalue) -{ - if (Z_TYPE_P(pvalue) == IS_STRING) { - free(Z_STRVAL_P(pvalue)); - } -} -/* }}} */ - /* {{{ php_config_ini_parser_cb */ static void php_config_ini_parser_cb(zval *arg1, zval *arg2, int callback_type, void *arg) @@ -254,9 +244,29 @@ } /* }}} */ +/* {{{ pvalue_config_destructor + */ +static void pvalue_config_destructor(zval *pvalue) +{ + if (Z_TYPE_P(pvalue) == IS_STRING) { + free(Z_STRVAL_P(pvalue)); + } +} +/* }}} */ + +/* {{{ php_init_config_hash + */ +int php_init_config_hash(void) +{ + if (zend_hash_init(configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1) == FAILURE) { + return FAILURE; + } +} +/* }}} */ + /* {{{ php_init_config */ -int php_init_config() +int php_init_config(TSRMLS_D) { char *php_ini_search_path = NULL; int safe_mode_state; @@ -269,11 +279,6 @@ zend_llist scanned_ini_list; int l, total_l=0; zend_llist_element *element; - TSRMLS_FETCH(); - - if (zend_hash_init(configuration_hash, 0, NULL, (dtor_func_t) pvalue_config_destructor, 1) == FAILURE) { - return FAILURE; - } if (sapi_module.ini_defaults) { sapi_module.ini_defaults(configuration_hash); http://cvs.php.net/diff.php/php-src/main/php_ini.h?r1=1.45r2=1.46ty=u Index: php-src/main/php_ini.h diff -u php-src/main/php_ini.h:1.45 php-src/main/php_ini.h:1.46 --- php-src/main/php_ini.h:1.45 Wed Aug 3 10:08:34 2005 +++ php-src/main/php_ini.h Thu Sep 1 10:42:54 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_ini.h,v 1.45 2005/08/03 14:08:34 sniper Exp $ */ +/* $Id: php_ini.h,v 1.46 2005/09/01 14:42:54 sniper Exp $ */ #ifndef PHP_INI_H #define PHP_INI_H @@ -24,7 +24,8 @@ #include zend_ini.h BEGIN_EXTERN_C() -int php_init_config(); +int php_init_config_hash(void); +int php_init_config(TSRMLS_D); int php_shutdown_config(void); void php_ini_register_extensions(TSRMLS_D); zval *cfg_get_entry(char *name, uint name_length); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Mon Aug 29 02:51:52 2005 EDT Modified files: /php-src/main main.c Log: Fixed SIGSEGV http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.645r2=1.646ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.645 php-src/main/main.c:1.646 --- php-src/main/main.c:1.645 Wed Aug 17 03:52:17 2005 +++ php-src/main/main.c Mon Aug 29 02:51:51 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.645 2005/08/17 07:52:17 sniper Exp $ */ +/* $Id: main.c,v 1.646 2005/08/29 06:51:51 dmitry Exp $ */ /* {{{ includes */ @@ -572,7 +572,7 @@ stage = PHP Shutdown; } else { function = get_active_function_name(TSRMLS_C); - if (function !USTR_LEN(function)) { + if (!function || !USTR_LEN(function)) { stage = Unknown; function = NULL; } @@ -582,7 +582,7 @@ if (function) { spprintf(origin, 0, %v%s%v(%s), class_name, space, function, params); } else { - spprintf(origin, 0, %v, stage); + spprintf(origin, 0, %s, stage); } /* origin and buffer available, so lets come up with the error message */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
sniper Wed Aug 17 03:52:23 2005 EDT Modified files: /php-src/main main.c Log: Fix EOLs under winblows http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.644r2=1.645ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.644 php-src/main/main.c:1.645 --- php-src/main/main.c:1.644 Tue Aug 16 14:09:27 2005 +++ php-src/main/main.c Wed Aug 17 03:52:17 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.644 2005/08/16 18:09:27 helly Exp $ */ +/* $Id: main.c,v 1.645 2005/08/17 07:52:17 sniper Exp $ */ /* {{{ includes */ @@ -470,7 +470,7 @@ return; } #endif - log_file = VCWD_FOPEN(PG(error_log), a); + log_file = VCWD_FOPEN(PG(error_log), ab); if (log_file != NULL) { time(error_time); strftime(error_time_str, sizeof(error_time_str), %d-%b-%Y %H:%M:%S, php_localtime_r(error_time, tmbuf)); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
helly Tue Aug 16 14:09:28 2005 EDT Modified files: /php-src/main main.c Log: - Prevent E_STRICT from ending up as exception http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.643r2=1.644ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.643 php-src/main/main.c:1.644 --- php-src/main/main.c:1.643 Mon Aug 15 18:31:59 2005 +++ php-src/main/main.c Tue Aug 16 14:09:27 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.643 2005/08/15 22:31:59 sniper Exp $ */ +/* $Id: main.c,v 1.644 2005/08/16 18:09:27 helly Exp $ */ /* {{{ includes */ @@ -774,6 +774,9 @@ case E_PARSE: /* fatal errors are real errors and cannot be made exceptions */ break; + case E_STRICT: + /* for the sake of BC to old damaged code */ + break; case E_NOTICE: case E_USER_NOTICE: /* notices are no errors and are not treated as such like E_WARNINGS */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
sniper Mon Aug 15 18:32:00 2005 EDT Modified files: /php-src/main main.c Log: These are not defined anymore http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.642r2=1.643ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.642 php-src/main/main.c:1.643 --- php-src/main/main.c:1.642 Fri Aug 12 17:46:14 2005 +++ php-src/main/main.c Mon Aug 15 18:31:59 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.642 2005/08/12 21:46:14 tony2001 Exp $ */ +/* $Id: main.c,v 1.643 2005/08/15 22:31:59 sniper Exp $ */ /* {{{ includes */ @@ -1577,8 +1577,6 @@ REGISTER_MAIN_STRINGL_CONSTANT(PHP_OS, php_os, strlen(php_os), CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_SAPI, sapi_module.name, strlen(sapi_module.name), CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(DEFAULT_INCLUDE_PATH, PHP_INCLUDE_PATH, sizeof(PHP_INCLUDE_PATH)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PEAR_INSTALL_DIR, PEAR_INSTALLDIR, sizeof(PEAR_INSTALLDIR)-1, CONST_PERSISTENT | CONST_CS); - REGISTER_MAIN_STRINGL_CONSTANT(PEAR_EXTENSION_DIR, PHP_EXTENSION_DIR, sizeof(PHP_EXTENSION_DIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_EXTENSION_DIR, PHP_EXTENSION_DIR, sizeof(PHP_EXTENSION_DIR)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_PREFIX, PHP_PREFIX, sizeof(PHP_PREFIX)-1, CONST_PERSISTENT | CONST_CS); REGISTER_MAIN_STRINGL_CONSTANT(PHP_BINDIR, PHP_BINDIR, sizeof(PHP_BINDIR)-1, CONST_PERSISTENT | CONST_CS); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /main main.c
Andrei Zmievski wrote: Does this take into account the fact that default_charset is considered deprecated when unicode_semantics=on? Deprecated or completely removed? If it becomes useless with Unicode support, then I'd remove it at all instead of marking it as deprecated. -- Wbr, Antony Dovgal -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
tony2001Fri Aug 12 17:46:16 2005 EDT Modified files: /php-src/main main.c Log: allow default_charset default_mimetype to be changed during runtime http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.641r2=1.642ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.641 php-src/main/main.c:1.642 --- php-src/main/main.c:1.641 Thu Aug 11 19:36:02 2005 +++ php-src/main/main.c Fri Aug 12 17:46:14 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.641 2005/08/11 23:36:02 andrei Exp $ */ +/* $Id: main.c,v 1.642 2005/08/12 21:46:14 tony2001 Exp $ */ /* {{{ includes */ @@ -231,6 +231,99 @@ } /* }}} */ +#define PHP_INI_OPTION_HEADERS_SENT(option_name) \ + if (SG(headers_sent)) { \ + char *output_start_filename = php_get_output_start_filename(TSRMLS_C); \ + int output_start_lineno = php_get_output_start_lineno(TSRMLS_C); \ + if (output_start_filename) { \ + php_error_docref(NULL TSRMLS_CC, E_WARNING, Option #option_name cannot be changed after headers have been sent (output started at %s:%d), \ + output_start_filename, output_start_lineno); \ + } else { \ + php_error_docref(NULL TSRMLS_CC, E_WARNING, Option #option_name cannot be changed after headers have been sent); \ + } \ + return FAILURE; \ + } + +/* {{{ PHP_INI_MH + */ +static PHP_INI_MH(OnUpdateDefaultCharset) +{ + if (stage == PHP_INI_STAGE_RUNTIME !SG(request_info).no_headers) { + sapi_header_line ctr = {0}; + int mimetype_len; + + PHP_INI_OPTION_HEADERS_SENT(default_charset) + + mimetype_len = SG(default_mimetype) ? strlen(SG(default_mimetype)) : 0; + + if (new_value_length) { + ctr.line = emalloc( sizeof(Content-type: )-1 + mimetype_len + sizeof(; charset=)-1 + new_value_length + 1); + + memcpy(ctr.line, Content-type: , sizeof(Content-type: )); + memcpy(ctr.line + sizeof(Content-type: )-1, SG(default_mimetype), mimetype_len); + memcpy(ctr.line + sizeof(Content-type: )-1 + mimetype_len, ; charset=, sizeof(; charset=)); + memcpy(ctr.line + sizeof(Content-type: )-1 + mimetype_len + sizeof(; charset=)-1, new_value, new_value_length); + + ctr.line_len = sizeof(Content-type: )-1 + mimetype_len + sizeof(; charset=)-1 + new_value_length; + } else { + ctr.line = emalloc( sizeof(Content-type: )-1 + mimetype_len + 1); + + memcpy(ctr.line, Content-type: , sizeof(Content-type: )); + memcpy(ctr.line + sizeof(Content-type: )-1, SG(default_mimetype), mimetype_len); + + ctr.line_len = sizeof(Content-type: )-1 + mimetype_len; + } + ctr.line[ctr.line_len] = 0; + + sapi_header_op(SAPI_HEADER_REPLACE, ctr TSRMLS_CC); + efree(ctr.line); + } + + OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC); + return SUCCESS; +} +/* }}} */ + +/* {{{ PHP_INI_MH + */ +static PHP_INI_MH(OnUpdateDefaultMimetype) +{ + if (stage == PHP_INI_STAGE_RUNTIME !SG(request_info).no_headers) { + sapi_header_line ctr = {0}; + int charset_len; + +
Re: [PHP-CVS] cvs: php-src /main main.c
Jani Taskinen wrote: sniperFri Aug 5 17:44:27 2005 EDT Modified files: /php-src/main main.c Log: - This ini option is only effective when set in php.ini or httpd.conf or .htacces, etc. as GPC variables are set before any ini_set() is called Are you sure? With jit enabled, I should be able to toggle S, for example, before the first access of a $_SERVER variable and have that setting work. -Rasmus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /main main.c
On Sat, 6 Aug 2005, Rasmus Lerdorf wrote: Jani Taskinen wrote: sniper Fri Aug 5 17:44:27 2005 EDT Modified files: /php-src/main main.c Log: - This ini option is only effective when set in php.ini or httpd.conf or .htacces, etc. as GPC variables are set before any ini_set() is called Are you sure? Sure about what? That this option has no effect when set with ini_set()? Yes, I'm sure. PG(variables_order) is set before any ini_set()'s are called. With jit enabled, I should be able to toggle S, for example, before the first access of a $_SERVER variable and have that setting work. That wasn't possible before this patch either. Seems quite impossible too. --Jani -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /main main.c
Jani Taskinen wrote: On Sat, 6 Aug 2005, Rasmus Lerdorf wrote: Jani Taskinen wrote: sniperFri Aug 5 17:44:27 2005 EDT Modified files: /php-src/mainmain.c Log: - This ini option is only effective when set in php.ini or httpd.conf or .htacces, etc. as GPC variables are set before any ini_set() is called Are you sure? Sure about what? That this option has no effect when set with ini_set()? Yes, I'm sure. PG(variables_order) is set before any ini_set()'s are called. Sure, but calling ini_set() on it will reset PG(variables_order) to the new value. The question is whether we want the jit stuff to respect this setting or not which is what the bug report was about. -Rasmus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
sniper Fri Aug 5 17:44:27 2005 EDT Modified files: /php-src/main main.c Log: - This ini option is only effective when set in php.ini or httpd.conf or .htacces, etc. as GPC variables are set before any ini_set() is called http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.639r2=1.640ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.639 php-src/main/main.c:1.640 --- php-src/main/main.c:1.639 Wed Aug 3 10:08:30 2005 +++ php-src/main/main.c Fri Aug 5 17:44:26 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.639 2005/08/03 14:08:30 sniper Exp $ */ +/* $Id: main.c,v 1.640 2005/08/05 21:44:26 sniper Exp $ */ /* {{{ includes */ @@ -302,7 +302,7 @@ STD_PHP_INI_ENTRY(upload_tmp_dir, NULL, PHP_INI_SYSTEM, OnUpdateStringUnempty, upload_tmp_dir, php_core_globals, core_globals) STD_PHP_INI_ENTRY(user_dir, NULL, PHP_INI_SYSTEM, OnUpdateString, user_dir, php_core_globals, core_globals) - STD_PHP_INI_ENTRY(variables_order,EGPCS, PHP_INI_ALL,OnUpdateStringUnempty, variables_order, php_core_globals, core_globals) + STD_PHP_INI_ENTRY(variables_order,EGPCS, PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateStringUnempty, variables_order,php_core_globals, core_globals) STD_PHP_INI_ENTRY(error_append_string,NULL, PHP_INI_ALL,OnUpdateString, error_append_string, php_core_globals, core_globals) STD_PHP_INI_ENTRY(error_prepend_string, NULL, PHP_INI_ALL,OnUpdateString, error_prepend_string, php_core_globals, core_globals) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
dmitry Tue Jul 5 10:13:48 2005 EDT Modified files: /php-src/main main.c Log: Fixed crash in ext\standard\tests\general_functions\bug32647.php on Windows http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.634r2=1.635ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.634 php-src/main/main.c:1.635 --- php-src/main/main.c:1.634 Mon Jun 20 15:58:51 2005 +++ php-src/main/main.c Tue Jul 5 10:13:46 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.634 2005/06/20 19:58:51 tony2001 Exp $ */ +/* $Id: main.c,v 1.635 2005/07/05 14:13:46 dmitry Exp $ */ /* {{{ includes */ @@ -1195,6 +1195,7 @@ * inside zend_executor callback functions. */ EG(opline_ptr) = NULL; + EG(active_op_array) = NULL; /* 1. Call all possible __destruct() functions */ zend_try { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
sniper Mon Jun 20 03:04:08 2005 EDT Modified files: /php-src/main main.c Log: - No extra spaces before #ifndef http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.632r2=1.633ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.632 php-src/main/main.c:1.633 --- php-src/main/main.c:1.632 Fri Jun 17 05:39:21 2005 +++ php-src/main/main.c Mon Jun 20 03:04:07 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.632 2005/06/17 09:39:21 dmitry Exp $ */ +/* $Id: main.c,v 1.633 2005/06/20 07:04:07 sniper Exp $ */ /* {{{ includes */ @@ -1010,7 +1010,7 @@ /* {{{ php_request_startup */ - #ifndef APACHE_HOOKS +#ifndef APACHE_HOOKS int php_request_startup(TSRMLS_D) { int retval = SUCCESS; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
tony2001Mon Jun 20 15:58:56 2005 EDT Modified files: /php-src/main main.c Log: reorder and prevent memleak: bailout after free() http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.633r2=1.634ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.633 php-src/main/main.c:1.634 --- php-src/main/main.c:1.633 Mon Jun 20 03:04:07 2005 +++ php-src/main/main.c Mon Jun 20 15:58:51 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.633 2005/06/20 07:04:07 sniper Exp $ */ +/* $Id: main.c,v 1.634 2005/06/20 19:58:51 tony2001 Exp $ */ /* {{{ includes */ @@ -775,8 +775,8 @@ /* restore memory limit */ AG(memory_limit) = PG(memory_limit); #endif - zend_bailout(); efree(buffer); + zend_bailout(); return; } break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
wez Thu Jun 9 08:15:15 2005 EDT Modified files: /php-src/main main.c Log: hmm, backing out this change, as it seems to cause problems with user-space streams and filters (the ZE needs to close them before it blows away the user-space code. Noticed by Dmitry. Still need to find out how to avoid double-closing streams. http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.630r2=1.631ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.630 php-src/main/main.c:1.631 --- php-src/main/main.c:1.630 Mon Jun 6 18:01:41 2005 +++ php-src/main/main.c Thu Jun 9 08:15:14 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.630 2005/06/06 22:01:41 sniper Exp $ */ +/* $Id: main.c,v 1.631 2005/06/09 12:15:14 wez Exp $ */ /* {{{ includes */ @@ -835,12 +835,10 @@ } /* }}} */ -#if wez_0 static void stream_closer_for_zend(void *handle TSRMLS_DC) { php_stream_close((php_stream*)handle); } -#endif static long stream_fteller_for_zend(void *handle TSRMLS_DC) { @@ -859,10 +857,7 @@ handle-free_filename = 0; handle-handle.stream.handle = stream; handle-handle.stream.reader = (zend_stream_reader_t)_php_stream_read; - /* don't set this; all streams are tracked as part of the resource system, -* and we'll end up double-free'ing them if we allow zend to close them -* down after the resource list has been cleaned up */ - handle-handle.stream.closer = NULL; /* stream_closer_for_zend; */ + handle-handle.stream.closer = stream_closer_for_zend; handle-handle.stream.fteller = stream_fteller_for_zend; handle-handle.stream.interactive = 0; /* suppress warning if this stream is not explicitly closed */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /main main.c
Wez was the one who disabled the use, he just didn't disable the function itself.. --Jani On Tue, 7 Jun 2005, Marcus Boerger wrote: Hello Jani, Tuesday, June 7, 2005, 12:01:43 AM, you wrote: sniper Mon Jun 6 18:01:43 2005 EDT Modified files: /php-src/main main.c Log: silence warning http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.629r2=1.630ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.629 php-src/main/main.c:1.630 --- php-src/main/main.c:1.629 Sun Jun 5 21:51:46 2005 +++ php-src/main/main.c Mon Jun 6 18:01:41 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.629 2005/06/06 01:51:46 wez Exp $ */ +/* $Id: main.c,v 1.630 2005/06/06 22:01:41 sniper Exp $ */ /* {{{ includes */ @@ -835,10 +835,12 @@ } /* }}} */ +#if wez_0 i thought we were supposed to put the name of the one disabling it here so that it should be #if jani_0 and not the name of the one providing the superflous source like you did. static void stream_closer_for_zend(void *handle TSRMLS_DC) { php_stream_close((php_stream*)handle); } +#endif static long stream_fteller_for_zend(void *handle TSRMLS_DC) { -- Donate @ http://pecl.php.net/wishlist.php/sniper -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
sniper Mon Jun 6 18:01:43 2005 EDT Modified files: /php-src/main main.c Log: silence warning http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.629r2=1.630ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.629 php-src/main/main.c:1.630 --- php-src/main/main.c:1.629 Sun Jun 5 21:51:46 2005 +++ php-src/main/main.c Mon Jun 6 18:01:41 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.629 2005/06/06 01:51:46 wez Exp $ */ +/* $Id: main.c,v 1.630 2005/06/06 22:01:41 sniper Exp $ */ /* {{{ includes */ @@ -835,10 +835,12 @@ } /* }}} */ +#if wez_0 static void stream_closer_for_zend(void *handle TSRMLS_DC) { php_stream_close((php_stream*)handle); } +#endif static long stream_fteller_for_zend(void *handle TSRMLS_DC) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /main main.c
Hello Jani, Tuesday, June 7, 2005, 12:01:43 AM, you wrote: sniper Mon Jun 6 18:01:43 2005 EDT Modified files: /php-src/main main.c Log: silence warning http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.629r2=1.630ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.629 php-src/main/main.c:1.630 --- php-src/main/main.c:1.629 Sun Jun 5 21:51:46 2005 +++ php-src/main/main.c Mon Jun 6 18:01:41 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.629 2005/06/06 01:51:46 wez Exp $ */ +/* $Id: main.c,v 1.630 2005/06/06 22:01:41 sniper Exp $ */ /* {{{ includes */ @@ -835,10 +835,12 @@ } /* }}} */ +#if wez_0 i thought we were supposed to put the name of the one disabling it here so that it should be #if jani_0 and not the name of the one providing the superflous source like you did. static void stream_closer_for_zend(void *handle TSRMLS_DC) { php_stream_close((php_stream*)handle); } +#endif static long stream_fteller_for_zend(void *handle TSRMLS_DC) { -- Best regards, Marcusmailto:[EMAIL PROTECTED] -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main main.c
zeevSat Jun 4 12:16:54 2005 EDT Modified files: /php-src/main main.c Log: __halt_compiler() patch interface http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.627r2=1.628ty=u Index: php-src/main/main.c diff -u php-src/main/main.c:1.627 php-src/main/main.c:1.628 --- php-src/main/main.c:1.627 Mon May 16 04:37:08 2005 +++ php-src/main/main.c Sat Jun 4 12:16:53 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: main.c,v 1.627 2005/05/16 08:37:08 tony2001 Exp $ */ +/* $Id: main.c,v 1.628 2005/06/04 16:16:53 zeev Exp $ */ /* {{{ includes */ @@ -840,6 +840,11 @@ php_stream_close((php_stream*)handle); } +static long stream_fteller_for_zend(void *handle TSRMLS_DC) +{ + return (long)php_stream_tell((php_stream*)handle); +} + static int php_stream_open_for_zend(const char *filename, zend_file_handle *handle TSRMLS_DC) { php_stream *stream; @@ -853,6 +858,7 @@ handle-handle.stream.handle = stream; handle-handle.stream.reader = (zend_stream_reader_t)_php_stream_read; handle-handle.stream.closer = stream_closer_for_zend; + handle-handle.stream.fteller = stream_fteller_for_zend; handle-handle.stream.interactive = 0; return SUCCESS; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php