[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog
changelog Sat Mar 18 06:31:51 2006 UTC Modified files: /ZendEngine2ChangeLog Log: ChangeLog update http://cvs.php.net/viewcvs.cgi/ZendEngine2/ChangeLog?r1=1.881r2=1.882diff_format=u Index: ZendEngine2/ChangeLog diff -u ZendEngine2/ChangeLog:1.881 ZendEngine2/ChangeLog:1.882 --- ZendEngine2/ChangeLog:1.881 Fri Mar 17 06:31:49 2006 +++ ZendEngine2/ChangeLog Sat Mar 18 06:31:51 2006 @@ -1,3 +1,21 @@ +2006-03-17 Dmitry Stogov [EMAIL PROTECTED] + +* zend_execute_API.c: + FIX: For some reason SIGSEGV handler wasn't set, but was restoring. Now all + SIGS + EGV related code is commented. + +* (PHP_5_1) + zend_execute_API.c: + FIX: For some reason SIGSEGV handler wasn't set, but was restoring. Now all + SIGSEGV related code is commented. + +* zend.c + zend.c + zend_API.c + zend_API.c: + Optimization of module unloading (temporary modules can be only in the end) + 2006-03-16 Dmitry Stogov [EMAIL PROTECTED] * zend_vm_def.h @@ -12773,7 +12791,7 @@ 2003-06-10 Jani Taskinen [EMAIL PROTECTED] * zend_multiply.h: - - Missing $Id: ChangeLog,v 1.881 2006/03/17 06:31:49 changelog Exp $ tag + - Missing $Id: ChangeLog,v 1.882 2006/03/18 06:31:51 changelog Exp $ tag 2003-06-10 James Cox [EMAIL PROTECTED] @@ -14497,7 +14515,7 @@ zend_types.h zend_variables.c zend_variables.h: - - Added some missing CVS $Id: ChangeLog,v 1.881 2006/03/17 06:31:49 changelog Exp $ tags, headers and footers. + - Added some missing CVS $Id: ChangeLog,v 1.882 2006/03/18 06:31:51 changelog Exp $ tags, headers and footers. 2003-01-30 Ilia Alshanetsky [EMAIL PROTECTED]
[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /main php_variables.c
dmitry Fri Mar 17 08:58:51 2006 UTC Modified files: (Branch: PHP_5_1) /php-srcNEWS /php-src/main php_variables.c Log: Allowed 'auto_globals_jit' work together with 'register_argc_argv' http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.463r2=1.2027.2.464diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.463 php-src/NEWS:1.2027.2.464 --- php-src/NEWS:1.2027.2.463 Wed Mar 15 16:13:18 2006 +++ php-src/NEWSFri Mar 17 08:58:51 2006 @@ -1,6 +1,7 @@ PHPNEWS ||| ?? Mar 2006, PHP 5.1.3RC2 +- Allowed 'auto_globals_jit' work together with 'register_argc_argv'. (Dmitry) - Eliminated run-time constant fetching for TRUE, FALSE and NULL. (Dmitry) - Fixed offset/length parameter validation in substr_compare() function. (Ilia) - Added overflow checks to wordwrap() function. (Ilia) http://cvs.php.net/viewcvs.cgi/php-src/main/php_variables.c?r1=1.104.2.5r2=1.104.2.6diff_format=u Index: php-src/main/php_variables.c diff -u php-src/main/php_variables.c:1.104.2.5 php-src/main/php_variables.c:1.104.2.6 --- php-src/main/php_variables.c:1.104.2.5 Mon Feb 13 12:18:16 2006 +++ php-src/main/php_variables.cFri Mar 17 08:58:51 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_variables.c,v 1.104.2.5 2006/02/13 12:18:16 dmitry Exp $ */ +/* $Id: php_variables.c,v 1.104.2.6 2006/03/17 08:58:51 dmitry Exp $ */ #include stdio.h #include php.h @@ -423,8 +423,7 @@ int count = 0; char *ss, *space; - if (! (PG(register_globals) || SG(request_info).argc || - PG(http_globals)[TRACK_VARS_SERVER]) ) { + if (!(PG(register_globals) || SG(request_info).argc || track_vars_array)) { return; } @@ -614,7 +613,7 @@ unsigned char _gpc_flags[5] = {0, 0, 0, 0, 0}; zval *dummy_track_vars_array = NULL; zend_bool initialized_dummy_track_vars_array=0; - zend_bool jit_initialization = (PG(auto_globals_jit) !PG(register_globals) !PG(register_long_arrays) !PG(register_argc_argv)); + zend_bool jit_initialization = (PG(auto_globals_jit) !PG(register_globals) !PG(register_long_arrays)); struct auto_global_record { char *name; uint name_len; @@ -756,6 +755,18 @@ PG(http_globals)[TRACK_VARS_SERVER]-refcount++; } + if (PG(register_argc_argv)) { + zval **argc, **argv; + + if (zend_hash_find(EG(symbol_table), argc, sizeof(argc), (void**)argc) == SUCCESS + zend_hash_find(EG(symbol_table), argv, sizeof(argv), (void**)argv) == SUCCESS) { + (*argc)-refcount++; + (*argv)-refcount++; + zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), argv, sizeof(argv), argv, sizeof(zval *), NULL); + zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), argc, sizeof(argc), argc, sizeof(zval *), NULL); + } + } + return 0; /* don't rearm */ } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main php_variables.c
dmitry Fri Mar 17 08:59:02 2006 UTC Modified files: /php-src/main php_variables.c Log: Allowed 'auto_globals_jit' work together with 'register_argc_argv' http://cvs.php.net/viewcvs.cgi/php-src/main/php_variables.c?r1=1.120r2=1.121diff_format=u Index: php-src/main/php_variables.c diff -u php-src/main/php_variables.c:1.120 php-src/main/php_variables.c:1.121 --- php-src/main/php_variables.c:1.120 Thu Mar 16 09:44:42 2006 +++ php-src/main/php_variables.cFri Mar 17 08:59:02 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_variables.c,v 1.120 2006/03/16 09:44:42 dmitry Exp $ */ +/* $Id: php_variables.c,v 1.121 2006/03/17 08:59:02 dmitry Exp $ */ #include stdio.h #include php.h @@ -639,7 +639,7 @@ int count = 0; char *ss, *space; - if (! (SG(request_info).argc || PG(http_globals)[TRACK_VARS_SERVER]) ) { + if (!(SG(request_info).argc || track_vars_array)) { return; } @@ -818,7 +818,7 @@ unsigned char _gpc_flags[5] = {0, 0, 0, 0, 0}; zval *dummy_track_vars_array = NULL; zend_bool initialized_dummy_track_vars_array=0; - zend_bool jit_initialization = (PG(auto_globals_jit) !PG(register_argc_argv)); + zend_bool jit_initialization = PG(auto_globals_jit); struct auto_global_record { char *name; uint name_len; @@ -934,6 +934,18 @@ zend_hash_update(EG(symbol_table), name, name_len + 1, PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); PG(http_globals)[TRACK_VARS_SERVER]-refcount++; + if (PG(register_argc_argv)) { + zval **argc, **argv; + + if (zend_hash_find(EG(symbol_table), argc, sizeof(argc), (void**)argc) == SUCCESS + zend_hash_find(EG(symbol_table), argv, sizeof(argv), (void**)argv) == SUCCESS) { + (*argc)-refcount++; + (*argv)-refcount++; + zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), argv, sizeof(argv), argv, sizeof(zval *), NULL); + zend_hash_update(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), argc, sizeof(argc), argc, sizeof(zval *), NULL); + } + } + return 0; /* don't rearm */ } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) /sapi/cgi cgi_main.c
dmitry Fri Mar 17 09:32:30 2006 UTC Modified files: (Branch: PHP_5_1) /php-src/sapi/cgi cgi_main.c Log: Optimized FastCGI SAPI check. Check for ini options only once. http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.8r2=1.267.2.9diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.8 php-src/sapi/cgi/cgi_main.c:1.267.2.9 --- php-src/sapi/cgi/cgi_main.c:1.267.2.8 Tue Mar 7 22:37:53 2006 +++ php-src/sapi/cgi/cgi_main.c Fri Mar 17 09:32:30 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.267.2.8 2006/03/07 22:37:53 alexwaugh Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.9 2006/03/17 09:32:30 dmitry Exp $ */ #include php.h #include php_globals.h @@ -151,6 +151,13 @@ long fix_pathinfo = 1; #endif +#if PHP_FASTCGI +long fcgi_logging = 1; +#endif + +static long rfc2616_headers = 0; +static long cgi_nph = 0; + #ifdef PHP_WIN32 #define TRANSLATE_SLASHES(path) \ { \ @@ -293,25 +300,12 @@ char buf[SAPI_CGI_MAX_HEADER_LENGTH]; sapi_header_struct *h; zend_llist_position pos; - long rfc2616_headers = 0, nph = 0; if (SG(request_info).no_headers == 1) { return SAPI_HEADER_SENT_SUCCESSFULLY; } - /* Check wheater to send RFC2616 style headers compatible with -* PHP versions 4.2.3 and earlier compatible with web servers -* such as IIS. Default is informal CGI RFC header compatible -* with Apache. -*/ - if (cfg_get_long(cgi.rfc2616_headers, rfc2616_headers) == FAILURE) { - rfc2616_headers = 0; - } - - if (cfg_get_long(cgi.nph, nph) == FAILURE) { - nph = 0; - } - if (nph || SG(sapi_headers).http_response_code != 200) + if (cgi_nph || SG(sapi_headers).http_response_code != 200) { int len; @@ -473,15 +467,11 @@ static void sapi_cgi_log_message(char *message) { #if PHP_FASTCGI - long logging = 1; - TSRMLS_FETCH(); - - if (cfg_get_long(fastcgi.logging, logging) == FAILURE) { - logging = 1; - } - - if (!FCGX_IsCGI() logging) { - FCGX_Request *request = (FCGX_Request *) SG(server_context); + if (!FCGX_IsCGI() fcgi_logging) { + FCGX_Request *request; + TSRMLS_FETCH(); + +request = (FCGX_Request *) SG(server_context); if (request) { FCGX_FPrintF(request-err, %s\n, message); } @@ -1126,6 +1116,25 @@ #endif #if PHP_FASTCGI + if (cfg_get_long(fastcgi.logging, fcgi_logging) == FAILURE) { + fcgi_logging = 1; + } +#endif + + /* Check wheater to send RFC2616 style headers compatible with +* PHP versions 4.2.3 and earlier compatible with web servers +* such as IIS. Default is informal CGI RFC header compatible +* with Apache. +*/ + if (cfg_get_long(cgi.rfc2616_headers, rfc2616_headers) == FAILURE) { + rfc2616_headers = 0; + } + + if (cfg_get_long(cgi.nph, cgi_nph) == FAILURE) { + cgi_nph = 0; + } + +#if PHP_FASTCGI #ifndef PHP_WIN32 /* for windows, socket listening is broken in the fastcgi library itself so dissabling this feature on windows till time is available to fix it */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /sapi/cgi cgi_main.c
dmitry Fri Mar 17 09:32:47 2006 UTC Modified files: /php-src/sapi/cgi cgi_main.c Log: Optimized FastCGI SAPI check. Check for ini options only once. http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.279r2=1.280diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.279 php-src/sapi/cgi/cgi_main.c:1.280 --- php-src/sapi/cgi/cgi_main.c:1.279 Thu Mar 16 16:53:09 2006 +++ php-src/sapi/cgi/cgi_main.c Fri Mar 17 09:32:47 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: cgi_main.c,v 1.279 2006/03/16 16:53:09 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.280 2006/03/17 09:32:47 dmitry Exp $ */ #include php.h #include php_globals.h @@ -147,6 +147,10 @@ /* true global. this is retreived once only, even for fastcgi */ static long fix_pathinfo = 1; static long discard_path = 0; +static long fcgi_logging = 1; + +static long rfc2616_headers = 0; +static long cgi_nph = 0; #ifdef PHP_WIN32 #define TRANSLATE_SLASHES(path) \ @@ -287,25 +291,12 @@ char buf[SAPI_CGI_MAX_HEADER_LENGTH]; sapi_header_struct *h; zend_llist_position pos; - long rfc2616_headers = 0, nph = 0; if (SG(request_info).no_headers == 1) { return SAPI_HEADER_SENT_SUCCESSFULLY; } - /* Check wheater to send RFC2616 style headers compatible with -* PHP versions 4.2.3 and earlier compatible with web servers -* such as IIS. Default is informal CGI RFC header compatible -* with Apache. -*/ - if (cfg_get_long(cgi.rfc2616_headers, rfc2616_headers) == FAILURE) { - rfc2616_headers = 0; - } - - if (cfg_get_long(cgi.nph, nph) == FAILURE) { - nph = 0; - } - if (nph || SG(sapi_headers).http_response_code != 200) + if (cgi_nph || SG(sapi_headers).http_response_code != 200) { int len; @@ -449,14 +440,9 @@ static void sapi_cgi_log_message(char *message) { - long logging = 1; - TSRMLS_FETCH(); + if (!FCGX_IsCGI() fcgi_logging) { + TSRMLS_FETCH(); - if (cfg_get_long(fastcgi.logging, logging) == FAILURE) { - logging = 1; - } - - if (!FCGX_IsCGI() logging) { FCGX_Request *request = (FCGX_Request *) SG(server_context); if (request) { FCGX_FPrintF(request-err, %s\n, message); @@ -1084,6 +1070,24 @@ discard_path = 0; } + if (cfg_get_long(fastcgi.logging, fcgi_logging) == FAILURE) { + fcgi_logging = 1; + } + + + /* Check wheater to send RFC2616 style headers compatible with +* PHP versions 4.2.3 and earlier compatible with web servers +* such as IIS. Default is informal CGI RFC header compatible +* with Apache. +*/ + if (cfg_get_long(cgi.rfc2616_headers, rfc2616_headers) == FAILURE) { + rfc2616_headers = 0; + } + + if (cfg_get_long(cgi.nph, cgi_nph) == FAILURE) { + cgi_nph = 0; + } + #ifndef PHP_WIN32 /* for windows, socket listening is broken in the fastcgi library itself so dissabling this feature on windows till time is available to fix it */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /ext/xmlreader php_xmlreader.c /ext/xmlreader/tests bug36743.phpt
tony2001Fri Mar 17 10:15:58 2006 UTC Added files: (Branch: PHP_5_1) /php-src/ext/xmlreader/testsbug36743.phpt Modified files: /php-srcNEWS /php-src/ext/xmlreader php_xmlreader.c Log: fix #36743 (In a class extending XMLReader array properties are not writable) http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.464r2=1.2027.2.465diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.464 php-src/NEWS:1.2027.2.465 --- php-src/NEWS:1.2027.2.464 Fri Mar 17 08:58:51 2006 +++ php-src/NEWSFri Mar 17 10:15:58 2006 @@ -7,6 +7,8 @@ - Added overflow checks to wordwrap() function. (Ilia) - Removed the E_STRICT deprecation notice from var. (Ilia) - Fixed debug_zval_dump() to support private and protected members. (Dmitry) +- Fixed bug #36743 (In a class extending XMLReader array properties are not + writable). (Tony) - Fixed bug #36697 (Transparency is lost when using imagecreatetruecolor). (Pierre) - Fixed bug #36629 (SoapServer::handle() exits on SOAP faults). (Dmitry) http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlreader/php_xmlreader.c?r1=1.13.2.10r2=1.13.2.11diff_format=u Index: php-src/ext/xmlreader/php_xmlreader.c diff -u php-src/ext/xmlreader/php_xmlreader.c:1.13.2.10 php-src/ext/xmlreader/php_xmlreader.c:1.13.2.11 --- php-src/ext/xmlreader/php_xmlreader.c:1.13.2.10 Mon Feb 6 11:28:41 2006 +++ php-src/ext/xmlreader/php_xmlreader.c Fri Mar 17 10:15:58 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xmlreader.c,v 1.13.2.10 2006/02/06 11:28:41 tony2001 Exp $ */ +/* $Id: php_xmlreader.c,v 1.13.2.11 2006/03/17 10:15:58 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -110,6 +110,40 @@ } /* }}} */ +/* {{{ xmlreader_get_property_ptr_ptr */ +zval **xmlreader_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) +{ + xmlreader_object *obj; + zval tmp_member; + zval **retval = NULL; + xmlreader_prop_handler *hnd; + zend_object_handlers *std_hnd; + int ret = FAILURE; + + if (member-type != IS_STRING) { + tmp_member = *member; + zval_copy_ctor(tmp_member); + convert_to_string(tmp_member); + member = tmp_member; + } + + obj = (xmlreader_object *)zend_objects_get_address(object TSRMLS_CC); + + if (obj-prop_handler != NULL) { + ret = zend_hash_find(obj-prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) hnd); + } + if (ret == FAILURE) { + std_hnd = zend_get_std_object_handlers(); + retval = std_hnd-get_property_ptr_ptr(object, member TSRMLS_CC); + } + + if (member == tmp_member) { + zval_dtor(member); + } + return retval; +} +/* }}} */ + /* {{{ xmlreader_read_property */ zval *xmlreader_read_property(zval *object, zval *member, int type TSRMLS_DC) { @@ -1098,7 +1132,7 @@ memcpy(xmlreader_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); xmlreader_object_handlers.read_property = xmlreader_read_property; xmlreader_object_handlers.write_property = xmlreader_write_property; - xmlreader_object_handlers.get_property_ptr_ptr = NULL; + xmlreader_object_handlers.get_property_ptr_ptr = xmlreader_get_property_ptr_ptr; INIT_CLASS_ENTRY(ce, XMLReader, xmlreader_functions); ce.create_object = xmlreader_objects_new; http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlreader/tests/bug36743.phpt?view=markuprev=1.1 Index: php-src/ext/xmlreader/tests/bug36743.phpt +++ php-src/ext/xmlreader/tests/bug36743.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xmlreader php_xmlreader.c /ext/xmlreader/tests bug36743.phpt
tony2001Fri Mar 17 10:17:36 2006 UTC Modified files: /php-src/ext/xmlreader php_xmlreader.c /php-src/ext/xmlreader/testsbug36743.phpt Log: MFB: fix #36743 (In a class extending XMLReader array properties are not writable) http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlreader/php_xmlreader.c?r1=1.27r2=1.28diff_format=u Index: php-src/ext/xmlreader/php_xmlreader.c diff -u php-src/ext/xmlreader/php_xmlreader.c:1.27 php-src/ext/xmlreader/php_xmlreader.c:1.28 --- php-src/ext/xmlreader/php_xmlreader.c:1.27 Mon Feb 6 11:28:20 2006 +++ php-src/ext/xmlreader/php_xmlreader.c Fri Mar 17 10:17:36 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xmlreader.c,v 1.27 2006/02/06 11:28:20 tony2001 Exp $ */ +/* $Id: php_xmlreader.c,v 1.28 2006/03/17 10:17:36 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -109,6 +109,40 @@ } /* }}} */ +/* {{{ xmlreader_get_property_ptr_ptr */ +zval **xmlreader_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC) +{ + xmlreader_object *obj; + zval tmp_member; + zval **retval = NULL; + xmlreader_prop_handler *hnd; + zend_object_handlers *std_hnd; + int ret = FAILURE; + + if (member-type != IS_STRING) { + tmp_member = *member; + zval_copy_ctor(tmp_member); + convert_to_string(tmp_member); + member = tmp_member; + } + + obj = (xmlreader_object *)zend_objects_get_address(object TSRMLS_CC); + + if (obj-prop_handler != NULL) { + ret = zend_hash_find(obj-prop_handler, Z_STRVAL_P(member), Z_STRLEN_P(member)+1, (void **) hnd); + } + if (ret == FAILURE) { + std_hnd = zend_get_std_object_handlers(); + retval = std_hnd-get_property_ptr_ptr(object, member TSRMLS_CC); + } + + if (member == tmp_member) { + zval_dtor(member); + } + return retval; +} +/* }}} */ + /* {{{ xmlreader_read_property */ zval *xmlreader_read_property(zval *object, zval *member, int type TSRMLS_DC) { @@ -1121,7 +1155,7 @@ memcpy(xmlreader_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); xmlreader_object_handlers.read_property = xmlreader_read_property; xmlreader_object_handlers.write_property = xmlreader_write_property; - xmlreader_object_handlers.get_property_ptr_ptr = NULL; + xmlreader_object_handlers.get_property_ptr_ptr = xmlreader_get_property_ptr_ptr; INIT_CLASS_ENTRY(ce, XMLReader, xmlreader_functions); ce.create_object = xmlreader_objects_new; http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlreader/tests/bug36743.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/xmlreader/tests/bug36743.phpt diff -u /dev/null php-src/ext/xmlreader/tests/bug36743.phpt:1.2 --- /dev/null Fri Mar 17 10:17:36 2006 +++ php-src/ext/xmlreader/tests/bug36743.phpt Fri Mar 17 10:17:36 2006 @@ -0,0 +1,25 @@ +--TEST-- +Bug #36743 (In a class extending XMLReader array properties are not writable) +--FILE-- +?php + +class Test extends XMLReader +{ +private $testArr = array(); +public function __construct() +{ +$this-testArr[] = 1; +var_dump($this-testArr); +} +} + +$t = new test; + +echo Done\n; +? +--EXPECT-- +array(1) { + [0]= + int(1) +} +Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) /main fopen_wrappers.c
dmitry Fri Mar 17 10:42:31 2006 UTC Modified files: (Branch: PHP_5_1) /php-src/main fopen_wrappers.c Log: Eliminated unnecessary getcwd() syscall http://cvs.php.net/viewcvs.cgi/php-src/main/fopen_wrappers.c?r1=1.175.2.2r2=1.175.2.3diff_format=u Index: php-src/main/fopen_wrappers.c diff -u php-src/main/fopen_wrappers.c:1.175.2.2 php-src/main/fopen_wrappers.c:1.175.2.3 --- php-src/main/fopen_wrappers.c:1.175.2.2 Sun Jan 1 12:50:17 2006 +++ php-src/main/fopen_wrappers.c Fri Mar 17 10:42:31 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: fopen_wrappers.c,v 1.175.2.2 2006/01/01 12:50:17 sniper Exp $ */ +/* $Id: fopen_wrappers.c,v 1.175.2.3 2006/03/17 10:42:31 dmitry Exp $ */ /* {{{ includes */ @@ -518,9 +518,13 @@ char cwd[MAXPATHLEN]; char *result; - result = VCWD_GETCWD(cwd, MAXPATHLEN); - if (!result) { + if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { cwd[0] = '\0'; + } else{ + result = VCWD_GETCWD(cwd, MAXPATHLEN); + if (!result) { + cwd[0] = '\0'; + } } new_state.cwd = strdup(cwd); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main fopen_wrappers.c
dmitry Fri Mar 17 10:46:02 2006 UTC Modified files: /php-src/main fopen_wrappers.c Log: Eliminated unnecessary getcwd() syscall http://cvs.php.net/viewcvs.cgi/php-src/main/fopen_wrappers.c?r1=1.181r2=1.182diff_format=u Index: php-src/main/fopen_wrappers.c diff -u php-src/main/fopen_wrappers.c:1.181 php-src/main/fopen_wrappers.c:1.182 --- php-src/main/fopen_wrappers.c:1.181 Wed Mar 8 14:41:45 2006 +++ php-src/main/fopen_wrappers.c Fri Mar 17 10:46:02 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: fopen_wrappers.c,v 1.181 2006/03/08 14:41:45 iliaa Exp $ */ +/* $Id: fopen_wrappers.c,v 1.182 2006/03/17 10:46:02 dmitry Exp $ */ /* {{{ includes */ @@ -433,9 +433,13 @@ char cwd[MAXPATHLEN]; char *result; - result = VCWD_GETCWD(cwd, MAXPATHLEN); - if (!result) { + if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { cwd[0] = '\0'; + } else{ + result = VCWD_GETCWD(cwd, MAXPATHLEN); + if (!result) { + cwd[0] = '\0'; + } } new_state.cwd = strdup(cwd); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard string.c type.c /ext/standard/tests/strings strtr2.phpt ucfirst.phpt
derick Fri Mar 17 14:29:05 2006 UTC Added files: /php-src/ext/standard/tests/strings strtr2.phpt ucfirst.phpt Modified files: /php-src/ext/standard string.c type.c Log: - Fixed bug in ucfirst() implementation. If the tmp_len = 0 then it will not write the uppercased character to the buffer, but only returns the length of the uppercased letter as per http://icu.sourceforge.net/apiref/icu4c/ustring_8h.html#a50. - Updated is_string(): If Unicode semantics is turned on, return true for Unicode strings only. If Unicode semantics is turned off, return true for native strings only. - Added is_binary() function that returns true for native strings only. - Added first implementation of upgraded strtr function. It works except if combining sequences or surrogates are used in the non-array method of calling this function. http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/string.c?r1=1.529r2=1.530diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.529 php-src/ext/standard/string.c:1.530 --- php-src/ext/standard/string.c:1.529 Wed Mar 15 12:20:49 2006 +++ php-src/ext/standard/string.c Fri Mar 17 14:29:05 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.529 2006/03/15 12:20:49 derick Exp $ */ +/* $Id: string.c,v 1.530 2006/03/17 14:29:05 derick Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -3263,8 +3263,8 @@ Makes an Unicode string's first character uppercase */ static void php_u_ucfirst(zval *ustr, zval *return_value TSRMLS_DC) { - UChar tmp[3] = { 0,}; /* UChar32 will be converted to upto 2 UChar units ? */ - int tmp_len = 0; + UChar tmp[3] = { 0, 0, 0 }; /* UChar32 will be converted to upto 2 UChar units ? */ + int tmp_len = 2; int pos = 0; UErrorCode status = U_ZERO_ERROR; @@ -3427,6 +3427,181 @@ } /* }}} */ +/* {{{ php_u_strtr + */ +PHPAPI UChar *php_u_strtr(UChar *str, int len, UChar *str_from, int str_from_len, UChar *str_to, int str_to_len, int trlen) +{ + int i, j; + int can_optimize = 1; + + if ((trlen 1) || (len 1)) { + return str; + } + + /* First loop to see if we can use the optimized version */ + for (i = 0; i trlen; i++) { + if (str_from[i] 255 || str_to[i] 255) { + can_optimize = 0; + break; + } + } + if (can_optimize) { + for (i = trlen; i str_from_len; i++) { + if (str_from[i] 255) { + can_optimize = 0; + break; + } + } + } + if (can_optimize) { + for (i = trlen; i str_to_len; i++) { + if (str_from[i] 255) { + can_optimize = 0; + break; + } + } + } + + if (can_optimize) { + UChar xlat[256]; + + for (i = 0; i 256; xlat[i] = i, i++); + + for (i = 0; i trlen; i++) { + xlat[str_from[i]] = str_to[i]; + } + + for (i = 0; i len; i++) { + str[i] = xlat[str[i]]; + } + + return str; + } else { + /* UTODO: We're quite fucked... this is *extremely* slow, better +* algorithm wanted here! It also doesn't handle combining sequences, I +* asked the icu-support list for good algorithms. */ + for (i = 0; i len; i++) { + for (j = 0; j trlen; j++) { + if (str[i] == str_from[j]) { + str[i] = str_to[j]; + } + } + } + return str; + } +} +/* }}} */ + +/* {{{ php_u_strtr_array + */ +static void php_u_strtr_array(zval *return_value, UChar *str, int slen, HashTable *hash) +{ + zval **entry; + zstr string_key; + uint string_key_len; + zval **trans; + zval ctmp; + ulong num_key; + int minlen = 128*1024; + int maxlen = 0, pos, len, found; + UChar *key; + HashPosition hpos; + smart_str result = {0}; + HashTable tmp_hash; + + zend_hash_init(tmp_hash, 0, NULL, NULL, 0); + zend_hash_internal_pointer_reset_ex(hash, hpos); + while (zend_hash_get_current_data_ex(hash, (void **)entry, hpos) == SUCCESS) { + switch (zend_hash_get_current_key_ex(hash, string_key, string_key_len, num_key, 0, hpos)) { + case HASH_KEY_IS_UNICODE: + len =
[PHP-CVS] cvs: php-src /ext/standard basic_functions.c php_type.h
derick Fri Mar 17 14:53:57 2006 UTC Modified files: /php-src/ext/standard basic_functions.c php_type.h Log: - Actually make this is_binary() too. http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/basic_functions.c?r1=1.762r2=1.763diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.762 php-src/ext/standard/basic_functions.c:1.763 --- php-src/ext/standard/basic_functions.c:1.762Thu Mar 16 16:53:09 2006 +++ php-src/ext/standard/basic_functions.c Fri Mar 17 14:53:57 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: basic_functions.c,v 1.762 2006/03/16 16:53:09 dmitry Exp $ */ +/* $Id: basic_functions.c,v 1.763 2006/03/17 14:53:57 derick Exp $ */ #include php.h #include php_streams.h @@ -530,8 +530,9 @@ PHP_FALIAS(is_double, is_float, NULL) PHP_FALIAS(is_real, is_float, NULL) PHP_FE(is_numeric, NULL) + PHP_FE(is_binary, NULL) PHP_FE(is_string, NULL) - PHP_FE(is_unicode, NULL) + PHP_FE(is_unicode, NULL) PHP_FE(is_buffer, NULL) PHP_FE(is_array, NULL) PHP_FE(is_object, NULL) http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/php_type.h?r1=1.8r2=1.9diff_format=u Index: php-src/ext/standard/php_type.h diff -u php-src/ext/standard/php_type.h:1.8 php-src/ext/standard/php_type.h:1.9 --- php-src/ext/standard/php_type.h:1.8 Sun Jan 1 13:09:55 2006 +++ php-src/ext/standard/php_type.h Fri Mar 17 14:53:57 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_type.h,v 1.8 2006/01/01 13:09:55 sniper Exp $ */ +/* $Id: php_type.h,v 1.9 2006/03/17 14:53:57 derick Exp $ */ #ifndef PHP_TYPE_H #define PHP_TYPE_H @@ -32,6 +32,7 @@ PHP_FUNCTION(is_long); PHP_FUNCTION(is_float); PHP_FUNCTION(is_numeric); +PHP_FUNCTION(is_binary); PHP_FUNCTION(is_string); PHP_FUNCTION(is_unicode); PHP_FUNCTION(is_binary); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main php_variables.c /tests/basic 011.phpt bug29971.phpt
dmitry Fri Mar 17 15:04:23 2006 UTC Modified files: /php-src/main php_variables.c /php-src/tests/basic011.phpt bug29971.phpt Log: Fixed register_argc_argv http://cvs.php.net/viewcvs.cgi/php-src/main/php_variables.c?r1=1.121r2=1.122diff_format=u Index: php-src/main/php_variables.c diff -u php-src/main/php_variables.c:1.121 php-src/main/php_variables.c:1.122 --- php-src/main/php_variables.c:1.121 Fri Mar 17 08:59:02 2006 +++ php-src/main/php_variables.cFri Mar 17 15:04:22 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_variables.c,v 1.121 2006/03/17 08:59:02 dmitry Exp $ */ +/* $Id: php_variables.c,v 1.122 2006/03/17 15:04:22 dmitry Exp $ */ #include stdio.h #include php.h @@ -639,7 +639,7 @@ int count = 0; char *ss, *space; - if (!(SG(request_info).argc || track_vars_array)) { + if (!(SG(request_info).argc || (s *s))) { return; } @@ -696,7 +696,7 @@ argc-is_ref = 0; argc-refcount = 0; - if (SG(request_info).argc) { + if (Z_LVAL_P(argc)) { arr-refcount++; argc-refcount++; zend_hash_update(EG(symbol_table), argv, sizeof(argv), arr, sizeof(zval *), NULL); http://cvs.php.net/viewcvs.cgi/php-src/tests/basic/011.phpt?r1=1.4r2=1.5diff_format=u Index: php-src/tests/basic/011.phpt diff -u php-src/tests/basic/011.phpt:1.4 php-src/tests/basic/011.phpt:1.5 --- php-src/tests/basic/011.phpt:1.4Wed Aug 21 23:08:21 2002 +++ php-src/tests/basic/011.phptFri Mar 17 15:04:23 2006 @@ -8,16 +8,9 @@ ab+cd+ef+123+test --FILE-- ?php - -if (!ini_get('register_globals')) { - $argc = $_SERVER['argc']; - $argv = $_SERVER['argv']; -} - for ($i=0; $i$argc; $i++) { echo $i: .$argv[$i].\n; } - ? --EXPECT-- 0: ab http://cvs.php.net/viewcvs.cgi/php-src/tests/basic/bug29971.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/tests/basic/bug29971.phpt diff -u php-src/tests/basic/bug29971.phpt:1.3 php-src/tests/basic/bug29971.phpt:1.4 --- php-src/tests/basic/bug29971.phpt:1.3 Tue Jan 17 12:18:53 2006 +++ php-src/tests/basic/bug29971.phpt Fri Mar 17 15:04:23 2006 @@ -2,6 +2,7 @@ Bug #29971 (variables_order behaviour) --INI-- variables_order=GPC +register_argc_argv=0 --FILE-- ?php var_dump($_ENV,$_SERVER); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /ext/pdo_pgsql pgsql_statement.c /ext/pdo_pgsql/tests bug36727.phpt
tony2001Fri Mar 17 22:15:57 2006 UTC Added files: (Branch: PHP_5_1) /php-src/ext/pdo_pgsql/testsbug36727.phpt Modified files: /php-srcNEWS /php-src/ext/pdo_pgsql pgsql_statement.c Log: fix #36727 (segfault in pdo_pgsql bindValue() when no parameters are defined) http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.465r2=1.2027.2.466diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.465 php-src/NEWS:1.2027.2.466 --- php-src/NEWS:1.2027.2.465 Fri Mar 17 10:15:58 2006 +++ php-src/NEWSFri Mar 17 22:15:57 2006 @@ -9,6 +9,8 @@ - Fixed debug_zval_dump() to support private and protected members. (Dmitry) - Fixed bug #36743 (In a class extending XMLReader array properties are not writable). (Tony) +- Fixed bug #36727 (segfault in pdo_pgsql bindValue() when no parameters are + defined). (Tony) - Fixed bug #36697 (Transparency is lost when using imagecreatetruecolor). (Pierre) - Fixed bug #36629 (SoapServer::handle() exits on SOAP faults). (Dmitry) http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.31.2.10r2=1.31.2.11diff_format=u Index: php-src/ext/pdo_pgsql/pgsql_statement.c diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.10 php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.11 --- php-src/ext/pdo_pgsql/pgsql_statement.c:1.31.2.10 Sun Jan 1 12:50:12 2006 +++ php-src/ext/pdo_pgsql/pgsql_statement.c Fri Mar 17 22:15:57 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: pgsql_statement.c,v 1.31.2.10 2006/01/01 12:50:12 sniper Exp $ */ +/* $Id: pgsql_statement.c,v 1.31.2.11 2006/03/17 22:15:57 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -229,7 +229,7 @@ } else { /* resolve parameter name to rewritten name */ char *nameptr; - if (SUCCESS == zend_hash_find(stmt-bound_param_map, + if (stmt-bound_param_map SUCCESS == zend_hash_find(stmt-bound_param_map, param-name, param-namelen + 1, (void**)nameptr)) { param-paramno = atoi(nameptr + 1) - 1; } else { http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_pgsql/tests/bug36727.phpt?view=markuprev=1.1 Index: php-src/ext/pdo_pgsql/tests/bug36727.phpt +++ php-src/ext/pdo_pgsql/tests/bug36727.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pdo_pgsql pgsql_statement.c /ext/pdo_pgsql/tests bug36727.phpt
tony2001Fri Mar 17 22:17:15 2006 UTC Modified files: /php-src/ext/pdo_pgsql pgsql_statement.c /php-src/ext/pdo_pgsql/testsbug36727.phpt Log: MFB: fix #36727 (segfault in pdo_pgsql bindValue() when no parameters are defined) http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_pgsql/pgsql_statement.c?r1=1.35r2=1.36diff_format=u Index: php-src/ext/pdo_pgsql/pgsql_statement.c diff -u php-src/ext/pdo_pgsql/pgsql_statement.c:1.35 php-src/ext/pdo_pgsql/pgsql_statement.c:1.36 --- php-src/ext/pdo_pgsql/pgsql_statement.c:1.35Sun Jan 1 13:09:53 2006 +++ php-src/ext/pdo_pgsql/pgsql_statement.c Fri Mar 17 22:17:15 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: pgsql_statement.c,v 1.35 2006/01/01 13:09:53 sniper Exp $ */ +/* $Id: pgsql_statement.c,v 1.36 2006/03/17 22:17:15 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -174,7 +174,7 @@ } else { /* resolve parameter name to rewritten name */ char *nameptr; - if (SUCCESS == zend_hash_find(stmt-bound_param_map, + if (stmt-bound_param_map SUCCESS == zend_hash_find(stmt-bound_param_map, param-name, param-namelen + 1, (void**)nameptr)) { param-paramno = atoi(nameptr + 1) - 1; } else { http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_pgsql/tests/bug36727.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/pdo_pgsql/tests/bug36727.phpt diff -u /dev/null php-src/ext/pdo_pgsql/tests/bug36727.phpt:1.2 --- /dev/null Fri Mar 17 22:17:15 2006 +++ php-src/ext/pdo_pgsql/tests/bug36727.phpt Fri Mar 17 22:17:15 2006 @@ -0,0 +1,23 @@ +--TEST-- +Bug #36727 (segfault in bindValue() when no parameters are defined) +--SKIPIF-- +?php +if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded'); +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +require dirname(__FILE__) . '/config.inc'; +PDOTest::skip(); +? +--FILE-- +?php +require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc'; +require dirname(__FILE__) . '/config.inc'; +$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt'); + +$stmt = $db-prepare('SELECT * FROM child'); +var_dump($stmt-bindValue(':test', 1, PDO::PARAM_INT)); + +echo Done\n; +? +--EXPECT-- +bool(false) +Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard string.c
andrei Fri Mar 17 22:51:20 2006 UTC Modified files: /php-src/ext/standard string.c Log: Calculate the size of the tmp[] buffer directly at compile time. http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/string.c?r1=1.530r2=1.531diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.530 php-src/ext/standard/string.c:1.531 --- php-src/ext/standard/string.c:1.530 Fri Mar 17 14:29:05 2006 +++ php-src/ext/standard/string.c Fri Mar 17 22:51:20 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.530 2006/03/17 14:29:05 derick Exp $ */ +/* $Id: string.c,v 1.531 2006/03/17 22:51:20 andrei Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -3263,13 +3263,13 @@ Makes an Unicode string's first character uppercase */ static void php_u_ucfirst(zval *ustr, zval *return_value TSRMLS_DC) { - UChar tmp[3] = { 0, 0, 0 }; /* UChar32 will be converted to upto 2 UChar units ? */ - int tmp_len = 2; + UChar tmp[3] = { 0, 0, 0 }; /* UChar32 will be converted to upto 2 UChar units */ + int tmp_len = 0; int pos = 0; UErrorCode status = U_ZERO_ERROR; U16_FWD_1(Z_USTRVAL_P(ustr), pos, Z_USTRLEN_P(ustr)); - tmp_len = u_strToUpper(tmp, tmp_len, Z_USTRVAL_P(ustr), pos, UG(default_locale), status); + tmp_len = u_strToUpper(tmp, sizeof(tmp)/sizeof(UChar), Z_USTRVAL_P(ustr), pos, UG(default_locale), status); Z_USTRVAL_P(return_value) = eumalloc(tmp_len+Z_USTRLEN_P(ustr)-pos+1); Z_USTRVAL_P(return_value)[0] = tmp[0]; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl_directory.c /ext/standard file.c image.c /main/streams streams.c /sapi/cli php_cli.c
andrei Fri Mar 17 22:52:55 2006 UTC Modified files: /php-src/ext/splspl_directory.c /php-src/ext/standard file.c image.c /php-src/main/streams streams.c /php-src/sapi/cli php_cli.c Log: Fix compiler errors by using NULL_ZSTR where zstr is expected. # I guess we need to use NULL_ZSTR instead of NULL when passing NULL to # functions that expect zstr parameter. http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_directory.c?r1=1.85r2=1.86diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.85 php-src/ext/spl/spl_directory.c:1.86 --- php-src/ext/spl/spl_directory.c:1.85Thu Mar 9 23:03:08 2006 +++ php-src/ext/spl/spl_directory.c Fri Mar 17 22:52:55 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.85 2006/03/09 23:03:08 helly Exp $ */ +/* $Id: spl_directory.c,v 1.86 2006/03/17 22:52:55 andrei Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1349,7 +1349,7 @@ return FAILURE; } - buf = php_stream_get_line(intern-u.file.stream, NULL, intern-u.file.max_line_len, line_len); + buf = php_stream_get_line(intern-u.file.stream, NULL_ZSTR, intern-u.file.max_line_len, line_len); if (!buf) { intern-u.file.current_line = estrdup(); http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/file.c?r1=1.427r2=1.428diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.427 php-src/ext/standard/file.c:1.428 --- php-src/ext/standard/file.c:1.427 Wed Mar 15 00:28:57 2006 +++ php-src/ext/standard/file.c Fri Mar 17 22:52:55 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.427 2006/03/15 00:28:57 pollita Exp $ */ +/* $Id: file.c,v 1.428 2006/03/17 22:52:55 andrei Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -1002,7 +1002,7 @@ php_stream_from_zval(stream, zstream); - buf.v = php_stream_get_line_ex(stream, php_stream_reads_unicode(stream) ? IS_UNICODE : IS_STRING, NULL, 0, length, retlen); + buf.v = php_stream_get_line_ex(stream, php_stream_reads_unicode(stream) ? IS_UNICODE : IS_STRING, NULL_ZSTR, 0, length, retlen); if (!buf.v) { RETURN_FALSE; } @@ -1157,7 +1157,7 @@ } - buf = php_stream_get_line((php_stream *) what, NULL, 0, len); + buf = php_stream_get_line((php_stream *) what, NULL_ZSTR, 0, len); if (buf == NULL) { efree(args); RETURN_FALSE; @@ -1991,7 +1991,7 @@ } if (len 0) { - if ((buf = php_stream_get_line(stream, NULL, 0, buf_len)) == NULL) { + if ((buf = php_stream_get_line(stream, NULL_ZSTR, 0, buf_len)) == NULL) { RETURN_FALSE; } } else { @@ -2088,7 +2088,7 @@ memcpy(tptr, line_end, line_end_len); tptr += line_end_len; - if ((new_buf = php_stream_get_line(stream, NULL, 0, new_len)) == NULL) { + if ((new_buf = php_stream_get_line(stream, NULL_ZSTR, 0, new_len)) == NULL) { /* we've got an unterminated enclosure, * assign all the data from the start of * the enclosure to end of data to the http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/image.c?r1=1.120r2=1.121diff_format=u Index: php-src/ext/standard/image.c diff -u php-src/ext/standard/image.c:1.120 php-src/ext/standard/image.c:1.121 --- php-src/ext/standard/image.c:1.120 Thu Mar 2 13:12:45 2006 +++ php-src/ext/standard/image.cFri Mar 17 22:52:55 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: image.c,v 1.120 2006/03/02 13:12:45 dmitry Exp $ */ +/* $Id: image.c,v 1.121 2006/03/17 22:52:55 andrei Exp $ */ #include php.h #include stdio.h @@ -1023,7 +1023,7 @@ if (php_stream_rewind(stream)) { return 0; } - while ((fline=php_stream_gets(stream, NULL, 0)) != NULL) { + while ((fline=php_stream_gets(stream, NULL_ZSTR, 0)) != NULL) { iname = estrdup(fline); /* simple way to get necessary buffer of required size */ if (sscanf(fline, #define %s %d, iname, value) == 2) { if (!(type = strrchr(iname, '_'))) {
[PHP-CVS] cvs: php-src /ext/standard type.c
andrei Fri Mar 17 23:00:20 2006 UTC Modified files: /php-src/ext/standard type.c Log: Make is_string() return TRUE for both Unicode and binary strings. http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/type.c?r1=1.41r2=1.42diff_format=u Index: php-src/ext/standard/type.c diff -u php-src/ext/standard/type.c:1.41 php-src/ext/standard/type.c:1.42 --- php-src/ext/standard/type.c:1.41Fri Mar 17 14:29:05 2006 +++ php-src/ext/standard/type.c Fri Mar 17 23:00:20 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: type.c,v 1.41 2006/03/17 14:29:05 derick Exp $ */ +/* $Id: type.c,v 1.42 2006/03/17 23:00:20 andrei Exp $ */ #include php.h #include php_incomplete_class.h @@ -294,10 +294,21 @@ /* }}} */ /* {{{ proto bool is_string(mixed var) - Returns true if variable is a string */ + Returns true if variable is a Unicode or binary string */ PHP_FUNCTION(is_string) { - php_is_type(INTERNAL_FUNCTION_PARAM_PASSTHRU, UG(unicode) ? IS_UNICODE : IS_STRING); + zval **arg; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, arg) == FAILURE) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Only one argument expected); + RETURN_FALSE; + } + + if (Z_TYPE_PP(arg) == IS_UNICODE || Z_TYPE_PP(arg) == IS_STRING) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard string.c
helly Fri Mar 17 23:14:56 2006 UTC Modified files: /php-src/ext/standard string.c Log: - Fix TSRM http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/string.c?r1=1.531r2=1.532diff_format=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.531 php-src/ext/standard/string.c:1.532 --- php-src/ext/standard/string.c:1.531 Fri Mar 17 22:51:20 2006 +++ php-src/ext/standard/string.c Fri Mar 17 23:14:55 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.531 2006/03/17 22:51:20 andrei Exp $ */ +/* $Id: string.c,v 1.532 2006/03/17 23:14:55 helly Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -3494,7 +3494,7 @@ /* {{{ php_u_strtr_array */ -static void php_u_strtr_array(zval *return_value, UChar *str, int slen, HashTable *hash) +static void php_u_strtr_array(zval *return_value, UChar *str, int slen, HashTable *hash TSRMLS_DC) { zval **entry; zstr string_key; @@ -3740,7 +3740,7 @@ if (Z_TYPE_PP(str) == IS_UNICODE) { if (ac == 2) { - php_u_strtr_array(return_value, Z_USTRVAL_PP(str), Z_USTRLEN_PP(str), HASH_OF(*from)); + php_u_strtr_array(return_value, Z_USTRVAL_PP(str), Z_USTRLEN_PP(str), HASH_OF(*from) TSRMLS_CC); Z_TYPE_P(return_value) = IS_UNICODE; } else { convert_to_unicode_ex(from); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_4) /ext/mbstring mbstring.c
masugataSat Mar 18 05:52:33 2006 UTC Modified files: (Branch: PHP_4_4) /php-src/ext/mbstring mbstring.c Log: fixed doesn't return value when omitting arguments in mb_get_info( ). http://cvs.php.net/viewcvs.cgi/php-src/ext/mbstring/mbstring.c?r1=1.142.2.47.2.12r2=1.142.2.47.2.13diff_format=u Index: php-src/ext/mbstring/mbstring.c diff -u php-src/ext/mbstring/mbstring.c:1.142.2.47.2.12 php-src/ext/mbstring/mbstring.c:1.142.2.47.2.13 --- php-src/ext/mbstring/mbstring.c:1.142.2.47.2.12 Sun Mar 12 07:54:56 2006 +++ php-src/ext/mbstring/mbstring.c Sat Mar 18 05:52:33 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mbstring.c,v 1.142.2.47.2.12 2006/03/12 07:54:56 hirokawa Exp $ */ +/* $Id: mbstring.c,v 1.142.2.47.2.13 2006/03/18 05:52:33 masugata Exp $ */ /* * PHP4 Multibyte String module mbstring @@ -3711,22 +3711,19 @@ Returns the current settings of mbstring */ PHP_FUNCTION(mb_get_info) { - zval **type; + char *typ = NULL; + int typ_len; char *name; - int argc = ZEND_NUM_ARGS(); const struct mb_overload_def *over_func; zval *row; + const mbfl_language *lang = mbfl_no2language(MBSTRG(current_language)); - if (argc 0 || argc 1 || zend_get_parameters_ex(1, type) == FAILURE) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |s, typ, typ_len) == FAILURE) { + RETURN_FALSE; } - convert_to_string_ex(type); - - if (argc == 0 || !strcasecmp(all, Z_STRVAL_PP(type))) { - if (array_init(return_value) == FAILURE) { - RETURN_FALSE; - } + if (!typ || !strcasecmp(all, typ)) { + array_init(return_value); if ((name = (char *)mbfl_no_encoding2name(MBSTRG(current_internal_encoding))) != NULL) { add_assoc_string(return_value, internal_encoding, name, 1); } @@ -3750,19 +3747,30 @@ } else { add_assoc_string(return_value, func_overload, no overload, 1); } - } else if (!strcasecmp(internal_encoding, Z_STRVAL_PP(type))) { + if (lang != NULL) { + if ((name = (char *)mbfl_no_encoding2name(lang-mail_charset)) != NULL) { + add_assoc_string(return_value, mail_charset, name, 1); + } + if ((name = (char *)mbfl_no_encoding2name(lang-mail_header_encoding)) != NULL) { + add_assoc_string(return_value, mail_header_encoding, name, 1); + } + if ((name = (char *)mbfl_no_encoding2name(lang-mail_body_encoding)) != NULL) { + add_assoc_string(return_value, mail_body_encoding, name, 1); + } + } + } else if (!strcasecmp(internal_encoding, typ)) { if ((name = (char *)mbfl_no_encoding2name(MBSTRG(current_internal_encoding))) != NULL) { RETVAL_STRING(name, 1); } - } else if (!strcasecmp(http_input, Z_STRVAL_PP(type))) { + } else if (!strcasecmp(http_input, typ)) { if ((name = (char *)mbfl_no_encoding2name(MBSTRG(http_input_identify))) != NULL) { RETVAL_STRING(name, 1); } - } else if (!strcasecmp(http_output, Z_STRVAL_PP(type))) { + } else if (!strcasecmp(http_output, typ)) { if ((name = (char *)mbfl_no_encoding2name(MBSTRG(current_http_output_encoding))) != NULL) { RETVAL_STRING(name, 1); } - } else if (!strcasecmp(func_overload, Z_STRVAL_PP(type))) { + } else if (!strcasecmp(func_overload, typ)) { if (MBSTRG(func_overload)){ over_func = (mb_ovld[0]); array_init(return_value); @@ -3775,6 +3783,18 @@ } else { RETVAL_STRING(no overload, 1); } + } else if (!strcasecmp(mail_charset, typ)) { + if (lang != NULL (name = (char *)mbfl_no_encoding2name(lang-mail_charset)) != NULL) { + RETVAL_STRING(name, 1); + } + } else if (!strcasecmp(mail_header_encoding, typ)) { + if (lang != NULL (name = (char *)mbfl_no_encoding2name(lang-mail_header_encoding)) != NULL) { + RETVAL_STRING(name, 1); + } + } else if (!strcasecmp(mail_body_encoding, typ)) { + if (lang != NULL (name = (char *)mbfl_no_encoding2name(lang-mail_body_encoding)) != NULL) { + RETVAL_STRING(name, 1); +