[PHP-CVS] cvs: php-src / acinclude.m4
sterlingSat Jun 28 02:32:02 2003 EDT Modified files: /php-srcacinclude.m4 Log: ilia points out this is ok Index: php-src/acinclude.m4 diff -u php-src/acinclude.m4:1.249 php-src/acinclude.m4:1.250 --- php-src/acinclude.m4:1.249 Sat Jun 28 01:18:11 2003 +++ php-src/acinclude.m4Sat Jun 28 02:32:02 2003 @@ -1,4 +1,4 @@ -dnl $Id: acinclude.m4,v 1.249 2003/06/28 05:18:11 sterling Exp $ +dnl $Id: acinclude.m4,v 1.250 2003/06/28 06:32:02 sterling Exp $ dnl dnl This file contains local autoconf functions. @@ -1736,7 +1736,7 @@ set $libxml_full_version IFS=$ac_IFS LIBXML_VERSION=`expr [$]1 \* 100 + [$]2 \* 1000 + [$]3` -if test $LIBXML_VERSION -ge 2005007; then +if test $LIBXML_VERSION -ge 2005001; then LIBXML_LIBS=`$XML2_CONFIG --libs` LIBXML_INCS=`$XML2_CONFIG --cflags` PHP_EVAL_LIBLINE($LIBXML_LIBS, $1) @@ -1744,7 +1744,7 @@ AC_DEFINE(HAVE_LIBXML, 1, [ ]) $2 else - AC_MSG_ERROR([libxml2 version 2.5.7 or greater required.]) + AC_MSG_ERROR([libxml2 version 2.5.1 or greater required.]) fi ifelse([$3],[],,[else $3]) fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/wddx wddx.c /ext/wddx/tests .cvsignore 001.phpt wddx.xml
iliaa Sat Jun 28 02:55:47 2003 EDT Added files: /php-src/ext/wddx/tests .cvsignore 001.phpt wddx.xml Modified files: /php-src/ext/wddx wddx.c Log: Added missing handling of dateTime Fixed compiler warning involving streams Added a test case for wddx_deserialize() Index: php-src/ext/wddx/wddx.c diff -u php-src/ext/wddx/wddx.c:1.105 php-src/ext/wddx/wddx.c:1.106 --- php-src/ext/wddx/wddx.c:1.105 Tue Jun 10 16:03:40 2003 +++ php-src/ext/wddx/wddx.c Sat Jun 28 02:55:46 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: wddx.c,v 1.105 2003/06/10 20:03:40 imajes Exp $ */ +/* $Id: wddx.c,v 1.106 2003/06/28 06:55:46 iliaa Exp $ */ #include php.h @@ -34,6 +34,7 @@ #include ext/standard/php_smart_str.h #include ext/standard/html.h #include ext/standard/php_string.h +#include ext/standard/php_parsedate.h #define WDDX_BUF_LEN 256 #define PHP_CLASS_NAME_VAR php_class_name @@ -54,6 +55,7 @@ #define EL_VERSION version #define EL_RECORDSET recordset #define EL_FIELD field +#define EL_DATETIMEdateTime #define php_wddx_deserialize(a,b) \ php_wddx_deserialize_ex((a)-value.str.val, (a)-value.str.len, (b)) @@ -79,7 +81,8 @@ ST_BINARY, ST_STRUCT, ST_RECORDSET, - ST_FIELD + ST_FIELD, + ST_DATETIME } type; char *varname; } st_entry; @@ -861,6 +864,14 @@ } wddx_stack_push((wddx_stack *)stack, ent, sizeof(st_entry)); + } else if (!strcmp(name, EL_DATETIME)) { + ent.type = ST_DATETIME; + SET_STACK_VARNAME; + + ALLOC_ZVAL(ent.data); + INIT_PZVAL(ent.data); + Z_TYPE_P(ent.data) = IS_LONG; + wddx_stack_push((wddx_stack *)stack, ent, sizeof(st_entry)); } } /* }}} */ @@ -884,7 +895,8 @@ if (!strcmp(name, EL_STRING) || !strcmp(name, EL_NUMBER) || !strcmp(name, EL_BOOLEAN) || !strcmp(name, EL_NULL) || !strcmp(name, EL_ARRAY) || !strcmp(name, EL_STRUCT) || - !strcmp(name, EL_RECORDSET) || !strcmp(name, EL_BINARY)) { + !strcmp(name, EL_RECORDSET) || !strcmp(name, EL_BINARY) || + !strcmp(name, EL_DATETIME)) { wddx_stack_top(stack, (void**)ent1); if (!strcmp(name, EL_BINARY)) { @@ -1048,6 +1060,24 @@ } break; + case ST_DATETIME: { + char *tmp; + + tmp = do_alloca(len + 1); + memcpy(tmp, s, len); + tmp[len] = '\0'; + + Z_LVAL_P(ent-data) = php_parse_date(tmp, NULL); + /* date out of range 1969 or 2038 */ + if (Z_LVAL_P(ent-data) == -1) { + Z_TYPE_P(ent-data) = IS_STRING; + Z_STRLEN_P(ent-data) = len; + Z_STRVAL_P(ent-data) = estrndup(s, len); + } + free_alloca(tmp); + } + break; + default: break; } @@ -1280,7 +1310,7 @@ payload_len = Z_STRLEN_P(packet); } else if (Z_TYPE_P(packet) == IS_RESOURCE) { - stream = php_stream_from_zval(stream, packet); + php_stream_from_zval(stream, packet); if (stream) { payload_len = php_stream_copy_to_mem(stream, payload, PHP_STREAM_COPY_ALL, 0); } Index: php-src/ext/wddx/tests/.cvsignore +++ php-src/ext/wddx/tests/.cvsignore phpt.* *.diff *.log *.exp *.out *.php Index: php-src/ext/wddx/tests/001.phpt +++ php-src/ext/wddx/tests/001.phpt --TEST-- wddz deserialization test --FILE-- ?php $path = dirname(__FILE__); var_dump(wddx_deserialize(file_get_contents({$path}/wddx.xml))); ? --EXPECT-- array(11) { [aNull]= NULL [aString]= string(8) a string [aNumber]= float(-12.456) [aDateTime]= int(897600732) [aDateTime2]= string(19) 1930-06-12T04:32:12 [aDateTime3]= string(19) 2040-06-12T04:32:12 [aBoolean]= bool(true) [anArray]= array(2) { [0]= int(10) [1]= string(14) second element } [aBinary]= string(11) binary data [anObject]= array(2) { [s]= string(8) a string [n]= float(-12.456) } [aRecordset]= array(2) { [NAME]= array(2) { [0]=
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/wddx wddx.c /ext/wddx/tests .cvsignore 001.phpt wddx.xml
iliaa Sat Jun 28 02:59:31 2003 EDT Added files: (Branch: PHP_4_3) /php-src/ext/wddx/tests .cvsignore 001.phpt wddx.xml Modified files: /php-src/ext/wddx wddx.c Log: MFH: Added missing handling of dateTime Index: php-src/ext/wddx/wddx.c diff -u php-src/ext/wddx/wddx.c:1.96.2.3 php-src/ext/wddx/wddx.c:1.96.2.4 --- php-src/ext/wddx/wddx.c:1.96.2.3Sat Jan 4 14:51:46 2003 +++ php-src/ext/wddx/wddx.c Sat Jun 28 02:59:31 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: wddx.c,v 1.96.2.3 2003/01/04 19:51:46 helly Exp $ */ +/* $Id: wddx.c,v 1.96.2.4 2003/06/28 06:59:31 iliaa Exp $ */ #include php.h #include php_wddx.h @@ -32,6 +32,7 @@ #include ext/standard/php_smart_str.h #include ext/standard/html.h #include ext/standard/php_string.h +#include ext/standard/php_parsedate.h #define WDDX_BUF_LEN 256 #define PHP_CLASS_NAME_VAR php_class_name @@ -52,6 +53,7 @@ #define EL_VERSION version #define EL_RECORDSET recordset #define EL_FIELD field +#define EL_DATETIMEdateTime #define php_wddx_deserialize(a,b) \ php_wddx_deserialize_ex((a)-value.str.val, (a)-value.str.len, (b)) @@ -77,7 +79,8 @@ ST_BINARY, ST_STRUCT, ST_RECORDSET, - ST_FIELD + ST_FIELD, + ST_DATETIME } type; char *varname; } st_entry; @@ -867,6 +870,14 @@ } wddx_stack_push((wddx_stack *)stack, ent, sizeof(st_entry)); + } else if (!strcmp(name, EL_DATETIME)) { + ent.type = ST_DATETIME; + SET_STACK_VARNAME; + + ALLOC_ZVAL(ent.data); + INIT_PZVAL(ent.data); + Z_TYPE_P(ent.data) = IS_LONG; + wddx_stack_push((wddx_stack *)stack, ent, sizeof(st_entry)); } } /* }}} */ @@ -890,7 +901,8 @@ if (!strcmp(name, EL_STRING) || !strcmp(name, EL_NUMBER) || !strcmp(name, EL_BOOLEAN) || !strcmp(name, EL_NULL) || !strcmp(name, EL_ARRAY) || !strcmp(name, EL_STRUCT) || - !strcmp(name, EL_RECORDSET) || !strcmp(name, EL_BINARY)) { + !strcmp(name, EL_RECORDSET) || !strcmp(name, EL_BINARY) || + !strcmp(name, EL_DATETIME)) { wddx_stack_top(stack, (void**)ent1); if (!strcmp(name, EL_BINARY)) { @@ -1054,6 +1066,22 @@ } break; + case ST_DATETIME: { + char *tmp; + + tmp = do_alloca(len + 1); + memcpy(tmp, s, len); + tmp[len] = '\0'; + + Z_LVAL_P(ent-data) = php_parse_date(tmp, NULL); + /* date out of range 1969 or 2038 */ + if (Z_LVAL_P(ent-data) == -1) { + Z_TYPE_P(ent-data) = IS_STRING; + Z_STRLEN_P(ent-data) = len; + Z_STRVAL_P(ent-data) = estrndup(s, len); + } + free_alloca(tmp); + } default: break; } Index: php-src/ext/wddx/tests/.cvsignore +++ php-src/ext/wddx/tests/.cvsignore phpt.* *.diff *.log *.exp *.out *.php Index: php-src/ext/wddx/tests/001.phpt +++ php-src/ext/wddx/tests/001.phpt --TEST-- wddz deserialization test --FILE-- ?php $path = dirname(__FILE__); var_dump(wddx_deserialize(file_get_contents({$path}/wddx.xml))); ? --EXPECT-- array(11) { [aNull]= NULL [aString]= string(8) a string [aNumber]= float(-12.456) [aDateTime]= int(897600732) [aDateTime2]= string(19) 1930-06-12T04:32:12 [aDateTime3]= string(19) 2040-06-12T04:32:12 [aBoolean]= bool(true) [anArray]= array(2) { [0]= int(10) [1]= string(14) second element } [aBinary]= string(11) binary data [anObject]= array(2) { [s]= string(8) a string [n]= float(-12.456) } [aRecordset]= array(2) { [NAME]= array(2) { [0]= string(8) John Doe [1]= string(8) Jane Doe } [AGE]= array(2) { [0]= int(34) [1]= int(31) } } } Index: php-src/ext/wddx/tests/wddx.xml +++ php-src/ext/wddx/tests/wddx.xml ?xml version='1.0'? !DOCTYPE wddxPacket SYSTEM 'wddx_0100.dtd' wddxPacket version='1.0' header/ data struct var name='aNull' null/ /var var
[PHP-CVS] cvs: php-src /ext/simplexml simplexml.c
sterlingSat Jun 28 03:46:03 2003 EDT Modified files: /php-src/ext/simplexml simplexml.c Log: for now we let xml support build with versions older than 2.5.7, as we want users to actually test this... Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.42 php-src/ext/simplexml/simplexml.c:1.43 --- php-src/ext/simplexml/simplexml.c:1.42 Wed Jun 25 12:26:32 2003 +++ php-src/ext/simplexml/simplexml.c Sat Jun 28 03:46:03 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: simplexml.c,v 1.42 2003/06/25 16:26:32 sterling Exp $ */ +/* $Id: simplexml.c,v 1.43 2003/06/28 07:46:03 sterling Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -543,6 +543,8 @@ #define SCHEMA_BLOB 1 #define SCHEMA_OBJECT 2 +#ifdef xmlSchemaParserCtxtPtr + /* {{{ simplexml_ce_schema_validate_file() */ static void @@ -590,6 +592,8 @@ } /* }}} */ +#endif + /* {{{ simplexml_ce_register_ns() */ static void @@ -657,10 +661,12 @@ { if (!strcmp(method, xsearch)) { simplexml_ce_xpath_search(INTERNAL_FUNCTION_PARAM_PASSTHRU); +#ifdef xmlSchemaParserCtxtPtr } else if (!strcmp(method, validate_schema_file)) { simplexml_ce_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, SCHEMA_FILE); } else if (!strcmp(method, validate_schema_buffer)) { simplexml_ce_schema_validate(INTERNAL_FUNCTION_PARAM_PASSTHRU, SCHEMA_BLOB); +#endif } else if (!strcmp(method, register_ns)) { simplexml_ce_register_ns(INTERNAL_FUNCTION_PARAM_PASSTHRU); } else if (!strcmp(method, to_xml)) { @@ -1042,7 +1048,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, Simplexml support, enabled); - php_info_print_table_row(2, Revision, $Revision: 1.42 $); + php_info_print_table_row(2, Revision, $Revision: 1.43 $); php_info_print_table_end(); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/mbstring mbstring.c mbstring.h /main rfc1867.c
hirokawaSat Jun 28 04:51:05 2003 EDT Modified files: (Branch: PHP_4_3) /php-srcNEWS /php-src/ext/mbstring mbstring.c mbstring.h /php-src/main rfc1867.c Log: Fixed corruption of multibyte character including 0x5c as second byte in multipart/form-data. Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.267 php-src/NEWS:1.1247.2.268 --- php-src/NEWS:1.1247.2.267 Tue Jun 24 14:00:13 2003 +++ php-src/NEWSSat Jun 28 04:51:05 2003 @@ -7,6 +7,8 @@ when open_basedir is used). (Ilia) - Fixed bug #24284 (Fixed memory leak inside pg_ping()). (Ilia) - Fixed bug #24028 (Reading raw post message by php://input failed). (Jani) +- Fixed corruption of multibyte character including 0x5c as second + byte in multipart/form-data. (Rui) 19 Jun 2003, Version 4.3.3RC1 - Synchronized bundled GD library with GD 2.0.15. (Ilia) Index: php-src/ext/mbstring/mbstring.c diff -u php-src/ext/mbstring/mbstring.c:1.142.2.17 php-src/ext/mbstring/mbstring.c:1.142.2.18 --- php-src/ext/mbstring/mbstring.c:1.142.2.17 Fri May 16 15:28:17 2003 +++ php-src/ext/mbstring/mbstring.c Sat Jun 28 04:51:05 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mbstring.c,v 1.142.2.17 2003/05/16 19:28:17 moriyoshi Exp $ */ +/* $Id: mbstring.c,v 1.142.2.18 2003/06/28 08:51:05 hirokawa Exp $ */ /* * PHP4 Multibyte String module mbstring @@ -3598,6 +3598,127 @@ MBSTRING_API char *php_mb_strrchr(const char *s, char c TSRMLS_DC) { return php_mb_safe_strrchr(s, c, -1 TSRMLS_CC); +} +/* }}} */ + +/* {{{ MBSTRING_API size_t php_mb_gpc_mbchar_bytes() */ +MBSTRING_API size_t php_mb_gpc_mbchar_bytes(const char *s TSRMLS_DC) +{ + + if (MBSTRG(http_input_identify) != mbfl_no_encoding_invalid){ + return php_mb_mbchar_bytes_ex(s, + mbfl_no2encoding(MBSTRG(http_input_identify))); + } else { + return php_mb_mbchar_bytes_ex(s, + mbfl_no2encoding(MBSTRG(internal_encoding))); + } +} +/* }}} */ + +/* {{{ MBSTRING_API int php_mb_gpc_encoding_converter() */ +MBSTRING_API int php_mb_gpc_encoding_converter(char **str, int *len, const char *encoding_to, const char *encoding_from + TSRMLS_DC) +{ + mbfl_string string, result, *ret; + enum mbfl_no_encoding from_encoding, to_encoding; + mbfl_buffer_converter *convd; + + if (encoding_to) { + /* new encoding */ + to_encoding = mbfl_name2no_encoding(encoding_to); + if (to_encoding == mbfl_no_encoding_invalid) { + return -1; + } + } else { + to_encoding = MBSTRG(current_internal_encoding); + } + if (encoding_from) { + /* old encoding */ + from_encoding = mbfl_name2no_encoding(encoding_from); + if (from_encoding == mbfl_no_encoding_invalid) { + return -1; + } + } else { + from_encoding = MBSTRG(http_input_identify); + } + + /* initialize string */ + mbfl_string_init(string); + mbfl_string_init(result); + string.no_encoding = from_encoding; + string.no_language = MBSTRG(current_language); + string.val = (char*)(*str); + string.len = *len; + + /* initialize converter */ + convd = mbfl_buffer_converter_new(from_encoding, to_encoding, string.len TSRMLS_CC); + if (convd == NULL) { + return -1; + } + mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode) TSRMLS_CC); + mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar) TSRMLS_CC); + + /* do it */ + ret = mbfl_buffer_converter_feed_result(convd, string, result TSRMLS_CC); + if (ret != NULL) { + efree(*str); + *str = ret-val; + *len = ret-len; + } + mbfl_buffer_converter_delete(convd TSRMLS_CC); + + return ret ? 0 : -1; +} + +/* {{{ MBSTRING_API int php_mb_gpc_encoding_detector() + */ +MBSTRING_API int php_mb_gpc_encoding_detector(const char *arg_string, int arg_length, char *arg_list TSRMLS_DC) +{ + mbfl_string string; + const char *ret; + enum mbfl_no_encoding *elist; + enum mbfl_no_encoding encoding; + + int size, *list; + + if (arg_list strlen(arg_list)0) { + /* make encoding list */ + list = NULL; + size = 0; + php_mb_parse_encoding_list(arg_list, strlen(arg_list), list, size, 0); + + if (size 0 list != NULL) { + elist = list; + } else { + elist = MBSTRG(current_detect_order_list); + size = MBSTRG(current_detect_order_list_size); + if (size
[PHP-CVS] cvs: php-src /ext/curl interface.c
derick Sat Jun 28 05:55:13 2003 EDT Modified files: /php-src/ext/curl interface.c Log: - Removed duplicate constants Index: php-src/ext/curl/interface.c diff -u php-src/ext/curl/interface.c:1.23 php-src/ext/curl/interface.c:1.24 --- php-src/ext/curl/interface.c:1.23 Thu Jun 19 19:07:14 2003 +++ php-src/ext/curl/interface.cSat Jun 28 05:55:12 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: interface.c,v 1.23 2003/06/19 23:07:14 edink Exp $ */ +/* $Id: interface.c,v 1.24 2003/06/28 09:55:12 derick Exp $ */ #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS @@ -207,8 +207,6 @@ REGISTER_CURL_CONSTANT(CURLOPT_CRLF); REGISTER_CURL_CONSTANT(CURLOPT_ENCODING); REGISTER_CURL_CONSTANT(CURLOPT_PROXYPORT); - REGISTER_CURL_CONSTANT(CURLPROXY_HTTP); - REGISTER_CURL_CONSTANT(CURLPROXY_SOCKS5); REGISTER_CURL_CONSTANT(CURLOPT_UNRESTRICTED_AUTH); REGISTER_CURL_CONSTANT(CURLOPT_FTP_USE_EPRT); REGISTER_CURL_CONSTANT(CURLOPT_HTTP200ALIASES); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/mbstring mbstring.c
hirokawaSat Jun 28 07:00:37 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/mbstring mbstring.c Log: deleted code for debuging. Index: php-src/ext/mbstring/mbstring.c diff -u php-src/ext/mbstring/mbstring.c:1.142.2.18 php-src/ext/mbstring/mbstring.c:1.142.2.19 --- php-src/ext/mbstring/mbstring.c:1.142.2.18 Sat Jun 28 04:51:05 2003 +++ php-src/ext/mbstring/mbstring.c Sat Jun 28 07:00:37 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mbstring.c,v 1.142.2.18 2003/06/28 08:51:05 hirokawa Exp $ */ +/* $Id: mbstring.c,v 1.142.2.19 2003/06/28 11:00:37 hirokawa Exp $ */ /* * PHP4 Multibyte String module mbstring @@ -3713,10 +3713,8 @@ encoding = mbfl_identify_encoding_no(string, elist, size TSRMLS_CC); if (encoding != mbfl_no_encoding_invalid) { MBSTRG(http_input_identify) = encoding; - sapi_module.sapi_error(E_WARNING, encoding: %s %s, string.val, (char *)mbfl_no_encoding2name(encoding)); return SUCCESS; } else { - sapi_module.sapi_error(E_WARNING, encoding detection failed: %s , string.val); return FAILURE; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main/streams transports.c
wez Sat Jun 28 07:06:11 2003 EDT Modified files: /php-src/main/streams transports.c Log: Fix for mips compiler Index: php-src/main/streams/transports.c diff -u php-src/main/streams/transports.c:1.4 php-src/main/streams/transports.c:1.5 --- php-src/main/streams/transports.c:1.4 Tue Jun 10 16:03:42 2003 +++ php-src/main/streams/transports.c Sat Jun 28 07:06:11 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: transports.c,v 1.4 2003/06/10 20:03:42 imajes Exp $ */ +/* $Id: transports.c,v 1.5 2003/06/28 11:06:11 wez Exp $ */ #include php.h #include php_streams_int.h @@ -62,7 +62,9 @@ const char *p, *protocol = NULL; int n = 0, failed = 0; char *error_text = NULL; - struct timeval default_timeout = { FG(default_socket_timeout), 0 }; + struct timeval default_timeout = { 0, 0 }; + + default_timeout.tv_sec = FG(default_socket_timeout); if (timeout == NULL) { timeout = default_timeout; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main network.c
wez Sat Jun 28 07:12:48 2003 EDT Modified files: /php-src/main network.c Log: Merge getaddrinfo() tidy-up from PHP_4_3 branch. Index: php-src/main/network.c diff -u php-src/main/network.c:1.100 php-src/main/network.c:1.101 --- php-src/main/network.c:1.100Tue Jun 10 16:03:41 2003 +++ php-src/main/network.c Sat Jun 28 07:12:48 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: network.c,v 1.100 2003/06/10 20:03:41 imajes Exp $ */ +/* $Id: network.c,v 1.101 2003/06/28 11:12:48 wez Exp $ */ /*#define DEBUG_MAIN_NETWORK 1*/ @@ -164,11 +164,12 @@ /* {{{ php_network_getaddresses * Returns number of addresses, 0 for none/error */ -static int php_network_getaddresses(const char *host, struct sockaddr ***sal, char **error_string TSRMLS_DC) +static int php_network_getaddresses(const char *host, int socktype, struct sockaddr ***sal, char **error_string TSRMLS_DC) { struct sockaddr **sap; int n; #ifdef HAVE_GETADDRINFO + static int ipv6_borked = -1; /* the way this is used *is* thread safe */ struct addrinfo hints, *res, *sai; #else struct hostent *host_info; @@ -178,59 +179,59 @@ if (host == NULL) { return 0; } - #ifdef HAVE_GETADDRINFO memset(hints, '\0', sizeof(hints)); - + + hints.ai_family = AF_INET; /* default to regular inet (see below) */ + hints.ai_socktype = socktype; + # ifdef HAVE_IPV6 - hints.ai_family = AF_UNSPEC; -# else - hints.ai_family = AF_INET; -# endif - - if ((n = getaddrinfo(host, NULL, hints, res)) || res == NULL) { - if (error_string) { - spprintf(error_string, 0, getaddrinfo: %s, (res == NULL ? null result pointer : PHP_GAI_STRERROR(n))); + /* probe for a working IPv6 stack; even if detected as having v6 at compile +* time, at runtime some stacks are slow to resolve or have other issues +* if they are not correctly configured. +* static variable use is safe here since simple store or fetch operations +* are atomic and because the actual probe process is not in danger of +* collisions or race conditions. */ + if (ipv6_borked == -1) { + int s; + + s = socket(PF_INET6, SOCK_DGRAM, 0); + if (s == SOCK_ERR) { + ipv6_borked = 1; } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, php_network_getaddresses: getaddrinfo failed: %s, (res == NULL ? null result pointer : PHP_GAI_STRERROR(n))); + ipv6_borked = 0; + closesocket(s); } + } + hints.ai_family = ipv6_borked ? AF_INET : AF_UNSPEC; +# endif + + if ((n = getaddrinfo(host, NULL, hints, res))) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, php_network_getaddresses: getaddrinfo failed: %s, PHP_GAI_STRERROR(n)); + return 0; + } else if (res == NULL) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, php_network_getaddresses: getaddrinfo failed (null result pointer)); return 0; } sai = res; - - for (n = 1; (sai = sai-ai_next) != NULL; n++) { + for (n = 1; (sai = sai-ai_next) != NULL; n++) ; - } - + *sal = safe_emalloc((n + 1), sizeof(*sal), 0); sai = res; sap = *sal; + do { - switch (sai-ai_family) { -# if HAVE_IPV6 - case AF_INET6: - *sap = emalloc(sizeof(struct sockaddr_in6)); - *(struct sockaddr_in6 *)*sap = - *((struct sockaddr_in6 *)sai-ai_addr); - sap++; - break; -# endif - case AF_INET: - *sap = emalloc(sizeof(struct sockaddr_in)); - *(struct sockaddr_in *)*sap = - *((struct sockaddr_in *)sai-ai_addr); - sap++; - break; - } + *sap = emalloc(sai-ai_addrlen); + memcpy(*sap, sai-ai_addr, sai-ai_addrlen); + sap++; } while ((sai = sai-ai_next) != NULL); + freeaddrinfo(res); #else - if (!inet_aton(host, in)) { - /* XXX NOT THREAD SAFE -* (but it *is* thread safe under win32) -*/ + /* XXX NOT THREAD SAFE (is safe under win32) */ host_info = gethostbyname(host); if (host_info == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING,
[PHP-CVS] cvs: php-src /ext/standard streamsfuncs.c /main php_streams.h /main/streams cast.c plain_wrapper.c xp_socket.c
wez Sat Jun 28 07:24:47 2003 EDT Modified files: /php-src/ext/standard streamsfuncs.c /php-src/main php_streams.h /php-src/main/streams cast.c plain_wrapper.c xp_socket.c Log: Merge selectable descriptor casting from PHP_4_3 branch. Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.23 php-src/ext/standard/streamsfuncs.c:1.24 --- php-src/ext/standard/streamsfuncs.c:1.23Fri Jun 27 12:23:57 2003 +++ php-src/ext/standard/streamsfuncs.c Sat Jun 28 07:24:46 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: streamsfuncs.c,v 1.23 2003/06/27 16:23:57 pollita Exp $ */ +/* $Id: streamsfuncs.c,v 1.24 2003/06/28 11:24:46 wez Exp $ */ #include php.h #include php_globals.h @@ -422,7 +422,7 @@ * when casting. It is only used here so that the buffered data warning * is not displayed. * */ - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL, (void*)this_fd, 1)) { + if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)this_fd, 1)) { FD_SET(this_fd, fds); if (this_fd *max_fd) { *max_fd = this_fd; @@ -458,7 +458,7 @@ * when casting. It is only used here so that the buffered data warning * is not displayed. */ - if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD | PHP_STREAM_CAST_INTERNAL, (void*)this_fd, 1)) { + if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL, (void*)this_fd, 1)) { if (FD_ISSET(this_fd, fds)) { zend_hash_next_index_insert(new_hash, (void *)elem, sizeof(zval *), (void **)dest_elem); if (dest_elem) { Index: php-src/main/php_streams.h diff -u php-src/main/php_streams.h:1.81 php-src/main/php_streams.h:1.82 --- php-src/main/php_streams.h:1.81 Tue Jun 10 16:03:42 2003 +++ php-src/main/php_streams.h Sat Jun 28 07:24:47 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_streams.h,v 1.81 2003/06/10 20:03:42 imajes Exp $ */ +/* $Id: php_streams.h,v 1.82 2003/06/28 11:24:47 wez Exp $ */ #ifndef PHP_STREAMS_H #define PHP_STREAMS_H @@ -388,6 +388,8 @@ #define PHP_STREAM_AS_FD 1 /* cast as a socketd */ #define PHP_STREAM_AS_SOCKETD 2 +/* cast as fd/socket for select purposes */ +#define PHP_STREAM_AS_FD_FOR_SELECT 3 /* try really, really hard to make sure the cast happens (avoid using this flag if possible) */ #define PHP_STREAM_CAST_TRY_HARD 0x8000 Index: php-src/main/streams/cast.c diff -u php-src/main/streams/cast.c:1.7 php-src/main/streams/cast.c:1.8 --- php-src/main/streams/cast.c:1.7 Tue Jun 10 16:03:42 2003 +++ php-src/main/streams/cast.c Sat Jun 28 07:24:47 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: cast.c,v 1.7 2003/06/10 20:03:42 imajes Exp $ */ +/* $Id: cast.c,v 1.8 2003/06/28 11:24:47 wez Exp $ */ #define _GNU_SOURCE #include php.h @@ -137,10 +137,6 @@ #endif /* }}} */ - - - - /* {{{ php_stream_cast */ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show_err TSRMLS_DC) { @@ -148,7 +144,7 @@ castas = ~PHP_STREAM_CAST_MASK; /* synchronize our buffer (if possible) */ - if (ret) { + if (ret castas != PHP_STREAM_AS_FD_FOR_SELECT) { php_stream_flush(stream); if (stream-ops-seek (stream-flags PHP_STREAM_FLAG_NO_SEEK) == 0) { off_t dummy; @@ -248,8 +244,8 @@ if (show_err) { /* these names depend on the values of the PHP_STREAM_AS_XXX defines in php_streams.h */ - static const char *cast_names[3] = { - STDIO FILE*, File Descriptor, Socket Descriptor + static const char *cast_names[4] = { + STDIO FILE*, File Descriptor, Socket Descriptor, select()able descriptor }; php_error_docref(NULL TSRMLS_CC, E_WARNING, cannot represent a stream of type %s as a %s, Index: php-src/main/streams/plain_wrapper.c diff -u php-src/main/streams/plain_wrapper.c:1.18 php-src/main/streams/plain_wrapper.c:1.19 --- php-src/main/streams/plain_wrapper.c:1.18 Tue Jun 10 16:03:42 2003 +++ php-src/main/streams/plain_wrapper.cSat Jun 28 07:24:47 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: plain_wrapper.c,v 1.18 2003/06/10 20:03:42 imajes Exp $ */ +/* $Id: plain_wrapper.c,v 1.19
[PHP-CVS] cvs: php-src(PHP_4_3) / acinclude.m4
sas Sat Jun 28 08:29:07 2003 EDT Modified files: (Branch: PHP_4_3) /php-srcacinclude.m4 Log: Fix snprintf test. C99 allows for the Single Unix Spec semantics which prescribe a return value of -1 for n == 0 which is treated as an encoding error. This reenables use of snprintf on Solaris at least. Relevant excerpts from ection 7.19.6.5: Description [..] If n is zero, nothing is written, and s may be a null pointer. [..] Returns The snprintf function returns the number of characters that would have been written had n been sufficiently large, not counting the terminating null character, or a negative value if an encoding error occurred. Single Unix Spec: http://www.opengroup.org/onlinepubs/007908799/xsh/fprintf.html Index: php-src/acinclude.m4 diff -u php-src/acinclude.m4:1.218.2.18 php-src/acinclude.m4:1.218.2.19 --- php-src/acinclude.m4:1.218.2.18 Sun May 18 21:33:29 2003 +++ php-src/acinclude.m4Sat Jun 28 08:29:07 2003 @@ -1,4 +1,4 @@ -dnl $Id: acinclude.m4,v 1.218.2.18 2003/05/19 01:33:29 sas Exp $ +dnl $Id: acinclude.m4,v 1.218.2.19 2003/06/28 12:29:07 sas Exp $ dnl dnl This file contains local autoconf functions. @@ -1186,7 +1186,9 @@ int res = 0; res = res || (snprintf(buf, 2, marcus) != 6); res = res || (buf[1] != '\0'); - res = res || (snprintf(buf, 0, boerger) != 7); + /* Implementations may consider this as an encoding error */ + snprintf(buf, 0, boerger); + /* However, they MUST ignore the pointer */ res = res || (buf[0] != 'm'); res = res || (snprintf(NULL, 0, boerger) != 7); res = res || (snprintf(buf, sizeof(buf), %f, 0.12345678) != 8); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / acinclude.m4
sas Sat Jun 28 08:29:43 2003 EDT Modified files: /php-srcacinclude.m4 Log: MFB snprintf test Index: php-src/acinclude.m4 diff -u php-src/acinclude.m4:1.250 php-src/acinclude.m4:1.251 --- php-src/acinclude.m4:1.250 Sat Jun 28 02:32:02 2003 +++ php-src/acinclude.m4Sat Jun 28 08:29:43 2003 @@ -1,4 +1,4 @@ -dnl $Id: acinclude.m4,v 1.250 2003/06/28 06:32:02 sterling Exp $ +dnl $Id: acinclude.m4,v 1.251 2003/06/28 12:29:43 sas Exp $ dnl dnl This file contains local autoconf functions. @@ -1119,7 +1119,9 @@ int res = 0; res = res || (snprintf(buf, 2, marcus) != 6); res = res || (buf[1] != '\0'); - res = res || (snprintf(buf, 0, boerger) != 7); + /* Implementations may consider this as an encoding error */ + snprintf(buf, 0, boerger); + /* However, they MUST ignore the pointer */ res = res || (buf[0] != 'm'); res = res || (snprintf(NULL, 0, boerger) != 7); res = res || (snprintf(buf, sizeof(buf), %f, 0.12345678) != 8); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard/tests/general_functions sunfuncts.phpt
iliaa Sat Jun 28 13:36:47 2003 EDT Modified files: /php-src/ext/standard/tests/general_functions sunfuncts.phpt Log: Fixed test failure on systems with short_tags (?) off. Index: php-src/ext/standard/tests/general_functions/sunfuncts.phpt diff -u php-src/ext/standard/tests/general_functions/sunfuncts.phpt:1.3 php-src/ext/standard/tests/general_functions/sunfuncts.phpt:1.4 --- php-src/ext/standard/tests/general_functions/sunfuncts.phpt:1.3 Mon Feb 17 00:51:03 2003 +++ php-src/ext/standard/tests/general_functions/sunfuncts.phpt Sat Jun 28 13:36:46 2003 @@ -3,7 +3,7 @@ --INI-- precision = 14 --FILE-- -? +?php putenv (TZ=Asia/Jerusalem); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard file.c /ext/standard/tests/file 004.phpt
iliaa Sat Jun 28 16:06:13 2003 EDT Added files: /php-src/ext/standard/tests/file004.phpt Modified files: /php-src/ext/standard file.c Log: Added array handling to file_put_contents() More verbose error reporting mechanism. Test case for file_put_contents(). Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.350 php-src/ext/standard/file.c:1.351 --- php-src/ext/standard/file.c:1.350 Sat Jun 28 04:21:02 2003 +++ php-src/ext/standard/file.c Sat Jun 28 16:06:13 2003 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.350 2003/06/28 08:21:02 derick Exp $ */ +/* $Id: file.c,v 1.351 2003/06/28 20:06:13 iliaa Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -474,19 +474,20 @@ } /* }}} */ -/* {{{ proto int file_put_contents(string file, string data[, int flags[, resource context]]) - Write/Create a file with contents data and returns the number */ +/* {{{ proto int file_put_contents(string file, mixed data [, int flags [, resource context]]) + Write/Create a file with contents data and return the number of bytes written */ PHP_FUNCTION(file_put_contents) { php_stream *stream; - char *filename, *data; - size_t filename_len, data_len; - int numbytes, flags = 0; + char *filename; + size_t filename_len; + zval *data; + int numbytes = 0, flags = 0; zval *zcontext = NULL; php_stream_context *context = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss|lr!, filename, filename_len, - data, data_len, flags, zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sz/|lr!, filename, filename_len, + data, flags, zcontext) == FAILURE) { return; } @@ -497,15 +498,66 @@ if (stream == NULL) { RETURN_FALSE; } + switch (Z_TYPE_P(data)) { + case IS_NULL: + case IS_LONG: + case IS_DOUBLE: + case IS_BOOL: + case IS_CONSTANT: + convert_to_string_ex(data); + + case IS_STRING: + if (Z_STRLEN_P(data)) { + numbytes = php_stream_write(stream, Z_STRVAL_P(data), Z_STRLEN_P(data)); + if (numbytes != Z_STRLEN_P(data)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Only %d of %d bytes written, possibly out of free disk space., numbytes, Z_STRLEN_P(data)); + numbytes = -1; + } + } + break; - if (data_len) { - numbytes = php_stream_write(stream, data, data_len); - if (numbytes 0) { - RETURN_FALSE; - } + case IS_ARRAY: + if (zend_hash_num_elements(Z_ARRVAL_P(data))) { + int bytes_written; + zval **tmp; + HashPosition pos; + + zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(data), pos); + while (zend_hash_get_current_data_ex(Z_ARRVAL_P(data), (void **) tmp, pos) == SUCCESS) { + if ((*tmp)-type != IS_STRING) { + SEPARATE_ZVAL(tmp); + convert_to_string(*tmp); + } + if (Z_STRLEN_PP(tmp)) { + numbytes += Z_STRLEN_PP(tmp); + bytes_written = php_stream_write(stream, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); + if (bytes_written 0 || bytes_written != Z_STRLEN_PP(tmp)) { + if (bytes_written 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to write %d bytes to %s., Z_STRLEN_PP(tmp), filename); + } else { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Only %d of %d bytes written, possibly out of free disk space., bytes_written, Z_STRLEN_PP(tmp)); + } + numbytes = -1; + break; + } + } +
[PHP-CVS] cvs: php-src /ext/mysqli mysqli_api.c mysqli_fe.c
georg Sat Jun 28 17:27:08 2003 EDT Modified files: /php-src/ext/mysqli mysqli_api.c mysqli_fe.c Log: added BYREF_FORCE for bind parameters in msqli_bind_param and mysqli_bind_result changed function parameters in mysqli_bind_param from (object statement, mixed var1, long type1, ...) to (object statement, array tyoes, mixed var1, mixed var2, ...) Index: php-src/ext/mysqli/mysqli_api.c diff -u php-src/ext/mysqli/mysqli_api.c:1.33 php-src/ext/mysqli/mysqli_api.c:1.34 --- php-src/ext/mysqli/mysqli_api.c:1.33Sun Jun 22 04:46:39 2003 +++ php-src/ext/mysqli/mysqli_api.c Sat Jun 28 17:27:08 2003 @@ -15,7 +15,7 @@ | Author: Georg Richter [EMAIL PROTECTED]| +--+ - $Id: mysqli_api.c,v 1.33 2003/06/22 08:46:39 georg Exp $ + $Id: mysqli_api.c,v 1.34 2003/06/28 21:27:08 georg Exp $ */ #ifdef HAVE_CONFIG_H @@ -77,7 +77,7 @@ } /* }}} */ -/* {{{ proto bool mysqli_bind_param(object stmt, mixed variable, int type [,mixed,]) +/* {{{ proto bool mysqli_bind_param(object stmt, array types, mixed variable [,mixed,]) Bind variables to a prepared statement as parameters */ PHP_FUNCTION(mysqli_bind_param) { @@ -85,52 +85,43 @@ int argc = ZEND_NUM_ARGS(); int i; int num_vars; - int start = 0; + int start = 2; int ofs; STMT*stmt; + zval*mysql_stmt; MYSQL_BIND *bind; - zval**object; + zval*types; PR_STMT *prstmt; PR_COMMAND *prcommand; + HashPositionhpos; unsigned long rc; /* calculate and check number of parameters */ - num_vars = argc; + num_vars = argc - 1; if (!getThis()) { /* ignore handle parameter in procedural interface*/ --num_vars; } - if (num_vars % 2) { - /* we need variable/type pairs */ - WRONG_PARAM_COUNT; - } - if (num_vars 2) { + if (argc 2) { /* there has to be at least one pair */ WRONG_PARAM_COUNT; } - num_vars /= 2; - - - args = (zval ***)emalloc(argc * sizeof(zval **)); - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; + if (zend_parse_method_parameters((getThis()) ? 1:2 TSRMLS_CC, getThis(), Oa, mysql_stmt, mysqli_stmt_class_entry, types) == FAILURE) { + return; } - if (!getThis()) { - if (Z_TYPE_PP(args[0]) != IS_OBJECT) { - efree(args); - RETURN_FALSE; - } - MYSQLI_FETCH_RESOURCE(stmt, STMT *, prstmt, PR_STMT *, args[0], mysqli_stmt); + MYSQLI_FETCH_RESOURCE(stmt, STMT *, prstmt, PR_STMT *, mysql_stmt, mysqli_stmt); + + if (getThis()) { start = 1; - } else { - object = (getThis()); - MYSQLI_FETCH_RESOURCE(stmt, STMT *, prstmt, PR_STMT *, object, mysqli_stmt); } - + if (zend_hash_num_elements(Z_ARRVAL_P(types)) != argc - start) { + /* number of bind variables doesn't match number of elements in array */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, Number of elements in type array doesn't match number of bind variables); +} + /* prevent leak if variables are already bound */ #if HHOLZGRA_0 /* this would prevent using both bind_param and bind_result on SELECT @@ -141,21 +132,26 @@ RETURN_FALSE; } #endif + args = (zval ***)emalloc(argc * sizeof(zval **)); + + if (zend_get_parameters_array_ex(argc, args) == FAILURE) { + efree(args); + WRONG_PARAM_COUNT; + } stmt-is_null = ecalloc(num_vars, sizeof(char)); bind = (MYSQL_BIND *)ecalloc(num_vars, sizeof(MYSQL_BIND)); - for (i=start; i num_vars * 2 + start; i+=2) { - ofs = (i - start) / 2; - if (!PZVAL_IS_REF(*args[i]) Z_LVAL_PP(args[i+1]) != MYSQLI_BIND_SEND_DATA) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Parameter %d wasn't passed by reference, i+1); - efree(bind); - efree(args); - RETURN_FALSE; - } + zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(types), hpos); + + ofs = 0; + for (i=start; i argc; i++) { + zval **ctype; + + zend_hash_get_current_data_ex(Z_ARRVAL_P(types), (void **)ctype,
[PHP-CVS] cvs: php-src /ext/mysqli/tests 002.phpt 003.phpt 004.phpt 005.phpt 006.phpt 007.phpt 008.phpt 009.phpt 010.phpt 011.phpt 012.phpt 013.phpt 016.phpt 017.phpt 018.phpt 019.phpt 020.phpt 021.phpt 022.phpt 023.phpt 024.phpt 025.phpt 026.phpt 042.phpt 043.phpt 045.phpt 046.phpt 048.phpt
georg Sat Jun 28 17:30:58 2003 EDT Modified files: /php-src/ext/mysqli/tests 002.phpt 003.phpt 004.phpt 005.phpt 006.phpt 007.phpt 008.phpt 009.phpt 010.phpt 011.phpt 012.phpt 013.phpt 016.phpt 017.phpt 018.phpt 019.phpt 020.phpt 021.phpt 022.phpt 023.phpt 024.phpt 025.phpt 026.phpt 042.phpt 043.phpt 045.phpt 046.phpt 048.phpt Log: changed tests (ysqli_bind_param and mysql_bind_result changes) Index: php-src/ext/mysqli/tests/002.phpt diff -u php-src/ext/mysqli/tests/002.phpt:1.1 php-src/ext/mysqli/tests/002.phpt:1.2 --- php-src/ext/mysqli/tests/002.phpt:1.1 Tue Feb 11 19:46:29 2003 +++ php-src/ext/mysqli/tests/002.phpt Sat Jun 28 17:30:58 2003 @@ -21,7 +21,7 @@ $rc = mysqli_query($link,INSERT INTO test_fetch_null(col1,col10, col11) VALUES(1,'foo1', 1000),(2,'foo2', 88),(3,'foo3', 389789)); $stmt = mysqli_prepare($link, SELECT col1, col2, col3, col4, col5, col6, col7, col8, col9, col10, col11 from test_fetch_null); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); + mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7, $c8, $c9, $c10, $c11); mysqli_execute($stmt); mysqli_fetch($stmt); Index: php-src/ext/mysqli/tests/003.phpt diff -u php-src/ext/mysqli/tests/003.phpt:1.1 php-src/ext/mysqli/tests/003.phpt:1.2 --- php-src/ext/mysqli/tests/003.phpt:1.1 Tue Feb 11 19:46:29 2003 +++ php-src/ext/mysqli/tests/003.phpt Sat Jun 28 17:30:58 2003 @@ -24,9 +24,9 @@ '2010-07-10', '2020','1999-12-29')); - $stmt = mysqli_prepare($link, SELECT * FROM test_bind_result); - mysqli_bind_result($stmt,$c1, $c2, $c3, $c4, $c5, $c6, $c7); + $stmt = mysqli_prepare($link, SELECT * FROM test_bind_result); + mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); mysqli_execute($stmt); mysqli_fetch($stmt); Index: php-src/ext/mysqli/tests/004.phpt diff -u php-src/ext/mysqli/tests/004.phpt:1.1 php-src/ext/mysqli/tests/004.phpt:1.2 --- php-src/ext/mysqli/tests/004.phpt:1.1 Tue Feb 11 19:46:29 2003 +++ php-src/ext/mysqli/tests/004.phpt Sat Jun 28 17:30:58 2003 @@ -15,7 +15,7 @@ mysqli_query($link, INSERT INTO test_bind_fetch VALUES ('1234567890', 'this is a test')); $stmt = mysqli_prepare($link, SELECT * FROM test_bind_fetch); - mysqli_bind_result($stmt, $c1, $c2); + mysqli_bind_result($stmt, $c1, $c2); mysqli_execute($stmt); mysqli_fetch($stmt); Index: php-src/ext/mysqli/tests/005.phpt diff -u php-src/ext/mysqli/tests/005.phpt:1.1 php-src/ext/mysqli/tests/005.phpt:1.2 --- php-src/ext/mysqli/tests/005.phpt:1.1 Tue Feb 11 19:46:29 2003 +++ php-src/ext/mysqli/tests/005.phpt Sat Jun 28 17:30:58 2003 @@ -17,7 +17,7 @@ mysqli_query($link, INSERT INTO test_bind_fetch VALUES ('1234567890', '$a')); $stmt = mysqli_prepare($link, SELECT * FROM test_bind_fetch); - mysqli_bind_result($stmt, $c1, $c2); + mysqli_bind_result($stmt, $c1, $c2); mysqli_execute($stmt); mysqli_fetch($stmt); Index: php-src/ext/mysqli/tests/006.phpt diff -u php-src/ext/mysqli/tests/006.phpt:1.1 php-src/ext/mysqli/tests/006.phpt:1.2 --- php-src/ext/mysqli/tests/006.phpt:1.1 Tue Feb 11 19:46:29 2003 +++ php-src/ext/mysqli/tests/006.phpt Sat Jun 28 17:30:58 2003 @@ -21,7 +21,7 @@ mysqli_query($link, INSERT INTO test_bind_fetch VALUES (-23,35999,NULL,-500,-999,-0,0)); $stmt = mysqli_prepare($link, SELECT * FROM test_bind_fetch); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); + mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); mysqli_execute($stmt); mysqli_fetch($stmt); Index: php-src/ext/mysqli/tests/007.phpt diff -u php-src/ext/mysqli/tests/007.phpt:1.1 php-src/ext/mysqli/tests/007.phpt:1.2 --- php-src/ext/mysqli/tests/007.phpt:1.1 Tue Feb 11 19:46:29 2003 +++ php-src/ext/mysqli/tests/007.phpt Sat Jun 28 17:30:58 2003 @@ -21,7 +21,7 @@ mysqli_query($link, INSERT INTO test_bind_fetch VALUES (-23,35999,NULL,-500,-999,+30,0)); $stmt = mysqli_prepare($link, SELECT * FROM test_bind_fetch); - mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); + mysqli_bind_result($stmt, $c1, $c2, $c3, $c4, $c5, $c6, $c7); mysqli_execute($stmt); mysqli_fetch($stmt); Index: php-src/ext/mysqli/tests/008.phpt diff -u php-src/ext/mysqli/tests/008.phpt:1.1 php-src/ext/mysqli/tests/008.phpt:1.2 --- php-src/ext/mysqli/tests/008.phpt:1.1 Tue Feb 11 19:46:29 2003 +++ php-src/ext/mysqli/tests/008.phpt Sat Jun 28
[PHP-CVS] cvs: php-src /ext/simplexml simplexml.c
rrichards Sat Jun 28 17:38:44 2003 EDT Modified files: /php-src/ext/simplexml simplexml.c Log: fix mem leak in sxe_property_read fix compiler warning Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.43 php-src/ext/simplexml/simplexml.c:1.44 --- php-src/ext/simplexml/simplexml.c:1.43 Sat Jun 28 03:46:03 2003 +++ php-src/ext/simplexml/simplexml.c Sat Jun 28 17:38:44 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: simplexml.c,v 1.43 2003/06/28 07:46:03 sterling Exp $ */ +/* $Id: simplexml.c,v 1.44 2003/06/28 21:38:44 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -26,6 +26,7 @@ #include php_ini.h #include ext/standard/info.h #include php_simplexml.h +#include zend_execute_locks.h zend_class_entry *sxe_class_entry; @@ -105,8 +106,7 @@ xmlAttrPtr attr; int counter = 0; - ALLOC_ZVAL(return_value); - return_value-refcount = 0; + MAKE_STD_ZVAL(return_value); ZVAL_NULL(return_value); name = Z_STRVAL_P(member); @@ -146,7 +146,6 @@ if (match_ns(sxe, node, name)) { MAKE_STD_ZVAL(value); _node_as_zval(sxe, node-parent, value TSRMLS_CC); - value-refcount = 0; APPEND_CUR_ELEMENT(counter, value); goto next_iter; } @@ -156,8 +155,6 @@ APPEND_PREV_ELEMENT(counter, value); MAKE_STD_ZVAL(value); _node_as_zval(sxe, node, value TSRMLS_CC); - value-refcount = 0; - APPEND_CUR_ELEMENT(counter, value); } @@ -173,6 +170,9 @@ return_value = value; } + /* create temporary variable */ + PZVAL_UNLOCK(return_value); + return return_value; } /* }}} */ @@ -207,7 +207,7 @@ php_sxe_object *sxe; char *name; xmlNodePtr node; - xmlNodePtr newnode; + xmlNodePtr newnode = NULL; xmlAttrPtr attr; int counter = 0; int is_attr = 0; @@ -1048,7 +1048,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, Simplexml support, enabled); - php_info_print_table_row(2, Revision, $Revision: 1.43 $); + php_info_print_table_row(2, Revision, $Revision: 1.44 $); php_info_print_table_end(); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/mysql mysql.dsp
shane Sat Jun 28 18:28:44 2003 EDT Modified files: /php-src/ext/mysql mysql.dsp Log: fix building mysql as a loadable extension Index: php-src/ext/mysql/mysql.dsp diff -u php-src/ext/mysql/mysql.dsp:1.13 php-src/ext/mysql/mysql.dsp:1.14 --- php-src/ext/mysql/mysql.dsp:1.13Tue May 23 05:21:58 2000 +++ php-src/ext/mysql/mysql.dsp Sat Jun 28 18:28:44 2003 @@ -97,7 +97,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ..\.. /I ..\..\..\Zend /I ..\..\..\bindlib_w32 /D _DEBUG /D WIN32 /D _WINDOWS /D _MBCS /D _USRDLL /D MYSQL_EXPORTS /D COMPILE_DL_MYSQL /D HAVE_MYSQL=1 /FR /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ..\.. /I ..\..\Zend /I ..\..\..\bindlib_w32 /I ..\..\..\MySQL\include /I ..\..\TSRM /D _DEBUG /D ZEND_DEBUG=1 /D ZTS /D MYSQL_EXPORTS /D COMPILE_DL_MYSQL_MYSQL /D HAVE_MYSQL=1 /D WIN32 /D _WINDOWS /D _MBCS /D _USRDLL /D ZEND_WIN32 /D PHP_WIN32 /FR /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I ..\.. /I ..\..\main /I ..\..\Zend /I ..\..\..\bindlib_w32 /I ..\..\..\MySQL\include /I ..\..\TSRM /D _DEBUG /D ZEND_DEBUG=1 /D ZTS /D MYSQL_EXPORTS /D COMPILE_DL_MYSQL_MYSQL /D HAVE_MYSQL=1 /D WIN32 /D _WINDOWS /D _MBCS /D _USRDLL /D ZEND_WIN32 /D PHP_WIN32 /FR /YX /FD /GZ /c # ADD BASE MTL /nologo /D _DEBUG /mktyplib203 /win32 # ADD MTL /nologo /D _DEBUG /mktyplib203 /win32 # ADD BASE RSC /l 0x40d /d _DEBUG @@ -107,7 +107,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php4ts.lib /nologo /dll /debug /machine:I386 /out:Debug_TS/php_mysql.dll /pdbtype:sept /libpath:..\..\..\MySQL\lib\Debug /libpath:..\..\Debug_TS +# ADD LINK32 php4ts_debug.lib libmySQL.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:..\..\Debug_TS/php_mysql.dll /pdbtype:sept /libpath:..\..\..\MySQL\lib\Debug /libpath:..\..\Debug_TS !ELSEIF $(CFG) == mysql - Win32 Release_TS @@ -123,7 +123,7 @@ # PROP Ignore_Export_Lib 0 # PROP Target_Dir # ADD BASE CPP /nologo /MT /W3 /GX /O2 /I ..\.. /I ..\..\..\Zend /I ..\..\..\bindlib_w32 /D NDEBUG /D WIN32 /D _WINDOWS /D _MBCS /D _USRDLL /D MYSQL_EXPORTS /D COMPILE_DL_MYSQL /D HAVE_MYSQL=1 /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I ..\.. /I ..\..\Zend /I ..\..\..\bindlib_w32 /I ..\..\..\MySQL\include /I ..\..\TSRM /D NDEBUG /D ZTS /D MYSQL_EXPORTS /D COMPILE_DL_MYSQL_MYSQL /D HAVE_MYSQL=1 /D WIN32 /D _WINDOWS /D _MBCS /D _USRDLL /D ZEND_WIN32 /D PHP_WIN32 /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I ..\.. /I ..\..\main /I ..\..\Zend /I ..\..\..\bindlib_w32 /I ..\..\..\MySQL\include /I ..\..\TSRM /D NDEBUG /D ZEND_DEBUG=0 /D ZTS /D MYSQL_EXPORTS /D COMPILE_DL_MYSQL_MYSQL /D HAVE_MYSQL=1 /D WIN32 /D _WINDOWS /D _MBCS /D _USRDLL /D ZEND_WIN32 /D PHP_WIN32 /YX /FD /c # ADD BASE MTL /nologo /D NDEBUG /mktyplib203 /win32 # ADD MTL /nologo /D NDEBUG /mktyplib203 /win32 # ADD BASE RSC /l 0x40d /d NDEBUG @@ -133,7 +133,7 @@ # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php4ts.lib /nologo /dll /machine:I386 /out:Release_TS/php_mysql.dll /libpath:..\..\..\MySQL\lib\opt /libpath:..\..\Release_TS +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libmySQL.lib php4ts.lib /nologo /dll /machine:I386 /out:..\..\Release_TS/php_mysql.dll /libpath:..\..\..\MySQL\lib\opt /libpath:..\..\Release_TS /libpath:..\..\Release_TS_Inline !ENDIF -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / makedist
sterlingSat Jun 28 19:32:05 2003 EDT Modified files: /php-srcmakedist Log: what's a php5? Index: php-src/makedist diff -u php-src/makedist:1.30 php-src/makedist:1.31 --- php-src/makedist:1.30 Wed May 21 20:31:31 2003 +++ php-src/makedistSat Jun 28 19:32:04 2003 @@ -24,7 +24,7 @@ # # Written by Stig Bakken [EMAIL PROTECTED] 1997-05-28. # -# $Id: makedist,v 1.30 2003/05/22 00:31:31 wez Exp $ +# $Id: makedist,v 1.31 2003/06/28 23:32:04 sterling Exp $ # if test $# != 2; then @@ -45,7 +45,7 @@ IFS=$old_IFS PHPROOT=:pserver:[EMAIL PROTECTED]:/repository -PHPMOD=php5 +PHPMOD=php-src LT_TARGETS='ltconfig ltmain.sh config.guess config.sub' if echo '\c' | grep -s c /dev/null 21 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS /ext/mbstring mbstring.c mbstring.h /main rfc1867.c
hirokawaSat Jun 28 19:37:18 2003 EDT Modified files: /php-srcNEWS /php-src/ext/mbstring mbstring.c mbstring.h /php-src/main rfc1867.c Log: Fixed corruption of multibyte character including 0x5c as second byte in multipart/form-data. Index: php-src/NEWS diff -u php-src/NEWS:1.1431 php-src/NEWS:1.1432 --- php-src/NEWS:1.1431 Sat Jun 28 01:22:39 2003 +++ php-src/NEWSSat Jun 28 19:37:18 2003 @@ -4,6 +4,9 @@ ? ? ??? 2003, PHP 5 Beta 1 +- Fixed corruption of multibyte character including 0x5c as second + byte in multipart/form-data. (Rui) + - Switch to using Zend Engine 2, which includes numerous engine level improvements. A full list is available at http://www.php.net/zend-engine-2.php. Index: php-src/ext/mbstring/mbstring.c diff -u php-src/ext/mbstring/mbstring.c:1.176 php-src/ext/mbstring/mbstring.c:1.177 --- php-src/ext/mbstring/mbstring.c:1.176 Tue Jun 10 16:03:31 2003 +++ php-src/ext/mbstring/mbstring.c Sat Jun 28 19:37:18 2003 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: mbstring.c,v 1.176 2003/06/10 20:03:31 imajes Exp $ */ +/* $Id: mbstring.c,v 1.177 2003/06/28 23:37:18 hirokawa Exp $ */ /* * PHP4 Multibyte String module mbstring @@ -3219,6 +3219,124 @@ MBSTRING_API char *php_mb_strrchr(const char *s, char c TSRMLS_DC) { return php_mb_safe_strrchr(s, c, -1 TSRMLS_CC); +} +/* }}} */ + +/* {{{ MBSTRING_API size_t php_mb_gpc_mbchar_bytes() */ +MBSTRING_API size_t php_mb_gpc_mbchar_bytes(const char *s TSRMLS_DC) +{ + + if (MBSTRG(http_input_identify) != mbfl_no_encoding_invalid){ + return php_mb_mbchar_bytes_ex(s, + mbfl_no2encoding(MBSTRG(http_input_identify))); + } else { + return php_mb_mbchar_bytes_ex(s, + mbfl_no2encoding(MBSTRG(internal_encoding))); + } +} +/* }}} */ + +/* {{{ MBSTRING_API int php_mb_gpc_encoding_converter() */ +MBSTRING_API int php_mb_gpc_encoding_converter(char **str, int *len, const char *encoding_to, const char *encoding_from + TSRMLS_DC) +{ + mbfl_string string, result, *ret; + enum mbfl_no_encoding from_encoding, to_encoding; + mbfl_buffer_converter *convd; + + if (encoding_to) { + /* new encoding */ + to_encoding = mbfl_name2no_encoding(encoding_to); + if (to_encoding == mbfl_no_encoding_invalid) { + return -1; + } + } else { + to_encoding = MBSTRG(current_internal_encoding); + } + if (encoding_from) { + /* old encoding */ + from_encoding = mbfl_name2no_encoding(encoding_from); + if (from_encoding == mbfl_no_encoding_invalid) { + return -1; + } + } else { + from_encoding = MBSTRG(http_input_identify); + } + + /* initialize string */ + mbfl_string_init(string); + mbfl_string_init(result); + string.no_encoding = from_encoding; + string.no_language = MBSTRG(current_language); + string.val = (char*)(*str); + string.len = *len; + + /* initialize converter */ + convd = mbfl_buffer_converter_new(from_encoding, to_encoding, string.len TSRMLS_CC); + if (convd == NULL) { + return -1; + } + mbfl_buffer_converter_illegal_mode(convd, MBSTRG(current_filter_illegal_mode) TSRMLS_CC); + mbfl_buffer_converter_illegal_substchar(convd, MBSTRG(current_filter_illegal_substchar) TSRMLS_CC); + + /* do it */ + ret = mbfl_buffer_converter_feed_result(convd, string, result TSRMLS_CC); + if (ret != NULL) { + efree(*str); + *str = ret-val; + *len = ret-len; + } + mbfl_buffer_converter_delete(convd TSRMLS_CC); + + return ret ? 0 : -1; +} + +/* {{{ MBSTRING_API int php_mb_gpc_encoding_detector() + */ +MBSTRING_API int php_mb_gpc_encoding_detector(const char *arg_string, int arg_length, char *arg_list TSRMLS_DC) +{ + mbfl_string string; + enum mbfl_no_encoding *elist; + enum mbfl_no_encoding encoding; + + int size, *list; + + if (arg_list strlen(arg_list)0) { + /* make encoding list */ + list = NULL; + size = 0; + php_mb_parse_encoding_list(arg_list, strlen(arg_list), list, size, 0); + + if (size 0 list != NULL) { + elist = list; + } else { + elist = MBSTRG(current_detect_order_list); + size = MBSTRG(current_detect_order_list_size); + if (size = 0){ + elist = (int*)php_mb_default_identify_list; + size = php_mb_default_identify_list_size; +
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/pcre config.m4 php_pcre.c
andrei Sat Jun 28 20:08:30 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/pcre config.m4 php_pcre.c Log: - Added a new parameter to preg_match_* functions that can be used to specify the offset to start matching from. - Added support for named subpatterns. Index: php-src/ext/pcre/config.m4 diff -u php-src/ext/pcre/config.m4:1.29.2.2 php-src/ext/pcre/config.m4:1.29.2.3 --- php-src/ext/pcre/config.m4:1.29.2.2 Fri Jun 27 10:47:54 2003 +++ php-src/ext/pcre/config.m4 Sat Jun 28 20:08:29 2003 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.29.2.2 2003/06/27 14:47:54 andrei Exp $ +dnl $Id: config.m4,v 1.29.2.3 2003/06/29 00:08:29 andrei Exp $ dnl dnl By default we'll compile and link against the bundled PCRE library @@ -50,7 +50,7 @@ AC_DEFINE(HAVE_PCRE, 1, [ ]) PHP_ADD_INCLUDE($PCRE_INCDIR) -PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -DLINK_SIZE=2) +PHP_NEW_EXTENSION(pcre, php_pcre.c, $ext_shared,,-DSUPPORT_UTF8 -DLINK_SIZE=2 -DPOSIX_MALLOC_THRESHOLD=10) fi PHP_SUBST(PCRE_SHARED_LIBADD) fi Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.132.2.7 php-src/ext/pcre/php_pcre.c:1.132.2.8 --- php-src/ext/pcre/php_pcre.c:1.132.2.7 Sun May 25 22:00:37 2003 +++ php-src/ext/pcre/php_pcre.c Sat Jun 28 20:08:29 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.132.2.7 2003/05/26 02:00:37 iliaa Exp $ */ +/* $Id: php_pcre.c,v 1.132.2.8 2003/06/29 00:08:29 andrei Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -318,7 +318,7 @@ /* }}} */ /* {{{ add_offset_pair */ -static inline void add_offset_pair(zval *result, char *str, int len, int offset) +static inline void add_offset_pair(zval *result, char *str, int len, int offset, char *name) { zval *match_pair; @@ -330,6 +330,10 @@ add_next_index_stringl(match_pair, str, len, 1); add_next_index_long(match_pair, offset); + if (name) { + zval_add_ref(match_pair); + zend_hash_update(Z_ARRVAL_P(result), name, strlen(name)+1, match_pair, sizeof(zval *), NULL); + } zend_hash_next_index_insert(Z_ARRVAL_P(result), match_pair, sizeof(zval *), NULL); } /* }}} */ @@ -338,11 +342,15 @@ */ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) { - zval**regex,/* Regular expression */ - **subject, /* String to match against */ - **subpats = NULL, /* Array for subpatterns */ - **flags,/* Match control flags */ - *result_set,/* Holds a set of subpatterns after + /* parameters */ + char*regex; /* Regular expression */ + char*subject; /* String to match against */ + int regex_len; + int subject_len; + zval*subpats = NULL;/* Array for subpatterns */ + int flags; /* Match control flags */ + + zval*result_set,/* Holds a set of subpatterns after a global match */ **match_sets = NULL; /* An array of sets of matches for each subpattern after a global match */ @@ -354,63 +362,56 @@ int *offsets; /* Array of subpattern offsets */ int num_subpats; /* Number of captured subpatterns */ int size_offsets; /* Size of the offsets array */ - int start_offset; /* Where the new search starts */ + int start_offset = 0; /* Where the new search starts */ int matched; /* Has anything matched */ - int i; - int subpats_order = 0; /* Order of subpattern matches */ + int subpats_order = 0; /* Order of subpattern matches */ int offset_capture = 0;/* Capture match offsets: yes/no */ int g_notempty = 0;/* If the match should not be empty */ - const char **stringlist;/* Used to hold list of subpatterns */ + const char
[PHP-CVS] cvs: php-src /ext/pcre php_pcre.c
andrei Sat Jun 28 20:09:41 2003 EDT Modified files: /php-src/ext/pcre php_pcre.c Log: MFB Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.142 php-src/ext/pcre/php_pcre.c:1.143 --- php-src/ext/pcre/php_pcre.c:1.142 Tue Jun 10 16:03:34 2003 +++ php-src/ext/pcre/php_pcre.c Sat Jun 28 20:09:41 2003 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.142 2003/06/10 20:03:34 imajes Exp $ */ +/* $Id: php_pcre.c,v 1.143 2003/06/29 00:09:41 andrei Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -317,7 +317,7 @@ /* }}} */ /* {{{ add_offset_pair */ -static inline void add_offset_pair(zval *result, char *str, int len, int offset) +static inline void add_offset_pair(zval *result, char *str, int len, int offset, char *name) { zval *match_pair; @@ -329,6 +329,10 @@ add_next_index_stringl(match_pair, str, len, 1); add_next_index_long(match_pair, offset); + if (name) { + zval_add_ref(match_pair); + zend_hash_update(Z_ARRVAL_P(result), name, strlen(name)+1, match_pair, sizeof(zval *), NULL); + } zend_hash_next_index_insert(Z_ARRVAL_P(result), match_pair, sizeof(zval *), NULL); } /* }}} */ @@ -337,11 +341,15 @@ */ static void php_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) { - zval**regex,/* Regular expression */ - **subject, /* String to match against */ - **subpats = NULL, /* Array for subpatterns */ - **flags,/* Match control flags */ - *result_set,/* Holds a set of subpatterns after + /* parameters */ + char*regex; /* Regular expression */ + char*subject; /* String to match against */ + int regex_len; + int subject_len; + zval*subpats = NULL;/* Array for subpatterns */ + int flags; /* Match control flags */ + + zval*result_set,/* Holds a set of subpatterns after a global match */ **match_sets = NULL; /* An array of sets of matches for each subpattern after a global match */ @@ -353,63 +361,56 @@ int *offsets; /* Array of subpattern offsets */ int num_subpats; /* Number of captured subpatterns */ int size_offsets; /* Size of the offsets array */ - int start_offset; /* Where the new search starts */ + int start_offset = 0; /* Where the new search starts */ int matched; /* Has anything matched */ - int i; - int subpats_order = 0; /* Order of subpattern matches */ + int subpats_order = 0; /* Order of subpattern matches */ int offset_capture = 0;/* Capture match offsets: yes/no */ int g_notempty = 0;/* If the match should not be empty */ - const char **stringlist;/* Used to hold list of subpatterns */ + const char **stringlist;/* Holds list of subpatterns */ char*match; /* The current match */ + char **subpat_names = NULL;/* Array for named subpatterns */ + int i; - - /* Get function parameters and do error-checking. */ - switch(ZEND_NUM_ARGS()) { - case 2: - if (global || zend_get_parameters_ex(2, regex, subject) == FAILURE) { - WRONG_PARAM_COUNT; - } - break; - - case 3: - if (zend_get_parameters_ex(3, regex, subject, subpats) == FAILURE) { - WRONG_PARAM_COUNT; - } - if (global) - subpats_order = PREG_PATTERN_ORDER; - break; - - case
Re: [PHP-CVS] cvs: php-src(PHP_4_3) /ext/pcre config.m4 php_pcre.c
You know that little file called NEWS? Why not add some note about these in there, in PHP_4_3 branch.. --Jani On Sun, 29 Jun 2003, Andrei Zmievski wrote: andrei Sat Jun 28 20:08:30 2003 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/pcre config.m4 php_pcre.c Log: - Added a new parameter to preg_match_* functions that can be used to specify the offset to start matching from. - Added support for named subpatterns. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS
sniper Sat Jun 28 22:08:17 2003 EDT Modified files: (Branch: PHP_4_3) /php-srcNEWS Log: Note about PCRE upgrade -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / Makefile.global
sniper Sun Jun 29 01:59:30 2003 EDT Modified files: /php-srcMakefile.global Log: Fixed bug #24363 (plain ./configure make install failed) Index: php-src/Makefile.global diff -u php-src/Makefile.global:1.46 php-src/Makefile.global:1.47 --- php-src/Makefile.global:1.46Sun May 18 19:52:09 2003 +++ php-src/Makefile.global Sun Jun 29 01:59:29 2003 @@ -20,7 +20,7 @@ libs/libphp5.bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ cp $@ libs/libphp5.so -install: $(install_targets) +install: $(all_targets) $(install_targets) install-sapi: libphp5.la @echo Installing PHP SAPI module -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php