[PHP-CVS-DAILY] cvs: php-src / ChangeLog
changelog Fri Jul 21 01:30:49 2006 UTC Modified files: /php-srcChangeLog Log: ChangeLog update http://cvs.php.net/viewvc.cgi/php-src/ChangeLog?r1=1.2397r2=1.2398diff_format=u Index: php-src/ChangeLog diff -u php-src/ChangeLog:1.2397 php-src/ChangeLog:1.2398 --- php-src/ChangeLog:1.2397Thu Jul 20 01:30:52 2006 +++ php-src/ChangeLog Fri Jul 21 01:30:49 2006 @@ -1,3 +1,329 @@ +2006-07-20 Andrei Zmievski [EMAIL PROTECTED] + +* unicode-progress.txt + ext/standard/array.c + ext/standard/basic_functions.c + ext/standard/basic_functions.h: + Make array_walk(_recursive) use params API with FCI cache and mark them + with U. + +2006-07-20 Marcus Boerger [EMAIL PROTECTED] + +* (PHP_5_2) + ext/spl/doxygen.cfg + ext/spl/spl_functions.c + ext/spl/spl_functions.h + ext/spl/spl_iterators.c + ext/spl/spl_iterators.h + ext/spl/internal/regexiterator.inc + ext/spl/tests/iterator_050.phpt + ext/spl/tests/iterator_051.phpt + ext/spl/tests/iterator_052.phpt + ext/spl/tests/iterator_053.phpt + ext/spl/tests/iterator_054.phpt + ext/spl/tests/iterator_055.phpt: + - Synch RegexIterator with HEAD + +* (PHP_5_2) + ext/pcre/php_pcre.c + ext/pcre/php_pcre.h + ext/pcre/tests/grep2.phpt + ext/pcre/tests/match_flags3.phpt + ext/pcre/tests/preg_replace.phpt + ext/pcre/tests/split.phpt: + - MFH Clean up (after consulting Andrei) +. Change the handlers SPL uses to + php_pcre_*_impl(pcre_cache_entry*,) +. All refactored funcs (match, split, replace, grep) use the above +. Change (zend|php)_error() to php_error_docref() +. Move from old to new param parsing api +. Fix memleaks in unicode mode + +* ext/spl/spl_iterators.c: + - Need to initialized zvals completley + +2006-07-20 Andrei Zmievski [EMAIL PROTECTED] + +* unicode-progress.txt + ext/standard/array.c: + Make all array_*diff* functions use params API (along with FCI cache) + and mark them with U. + + +2006-07-20 Rob Richards [EMAIL PROTECTED] + +* ext/pcre/php_pcre.c: + tsrmls fix + +2006-07-20 Marcus Boerger [EMAIL PROTECTED] + +* ext/spl/spl_iterators.c + ext/spl/internal/regexiterator.inc + ext/spl/tests/iterator_050.phpt + ext/spl/tests/iterator_051.phpt + ext/spl/tests/iterator_052.phpt + ext/spl/tests/iterator_053.phpt + ext/spl/tests/iterator_054.phpt + ext/spl/tests/iterator_055.phpt: + - Change order of ctor args + +2006-07-20 Edin Kadribasic [EMAIL PROTECTED] + +* (PHP_5_2) + NEWS: + Lib update + +2006-07-20 Marcus Boerger [EMAIL PROTECTED] + +* ext/pcre/php_pcre.c: + - TSRM fixes + +* ext/spl/internal/regexiterator.inc: + - Update docu + +* ext/pcre/php_pcre.c: + - WS + +* ext/pcre/tests/grep2.phpt: + - Fix unicode expectations + +* ext/spl/spl_iterators.c: + + +* ext/spl/doxygen.cfg + ext/spl/spl_functions.c + ext/spl/spl_functions.h + ext/spl/spl_iterators.c + ext/spl/spl_iterators.h + ext/spl/internal/regexiterator.inc + ext/spl/tests/iterator_052.phpt + ext/spl/tests/iterator_053.phpt: + - Update RegexIterator + +* ext/pcre/php_pcre.c + ext/pcre/php_pcre.h + ext/pcre/tests/grep2.phpt + ext/pcre/tests/match_flags3.phpt + ext/pcre/tests/preg_replace.phpt + ext/pcre/tests/preg_replace_callback2.phpt + ext/pcre/tests/split.phpt: + - Clean up (after consulting Andrei) + . Change the handlers SPL uses to php_pcre_*_impl(pcre_cache_entry*,) + . All refactored funcs (match, split, replace, grep) use the above + . Change (zend|php)_error() to php_error_docref() + . Move from old to new param parsing api + . Fix memleaks in unicode mode + +* ZendEngine2/zend_API.c + ZendEngine2/zend_API.h: + - Add new unicode functions: add_u_assoc_*[_ex]() which allow to add values +using a unicode key. + +2006-07-20 Andrei Zmievski [EMAIL PROTECTED] + +* unicode-progress.txt + ZendEngine2/zend_API.h + ZendEngine2/zend_execute_API.c + ext/standard/array.c: + Rewrite array_map() to use params API with fci cache and mark it with U. + +* unicode-todo.txt: + -** empty log message *** + +2006-07-20 Seiji Masugata [EMAIL PROTECTED] + +* ext/mbstring/oniguruma/enc/gb18030.c + ext/mbstring/oniguruma/enc/gb18030.c: + + file gb18030.c was initially added on branch PHP_5_2. + +2006-07-20 Derick Rethans [EMAIL PROTECTED] + +* (PHP_5_2) + ext/date/php_date.c + ext/date/tests/date_create-1.phpt: + - MFH: Rename date classes to DateTime and DateTimeZone + +* ext/date/php_date.c + ext/date/tests/date_create-1.phpt: + - Rename date classes to DateTime and DateTimeZone + +2006-07-20 Andrei
[PHP-CVS] cvs: php-src /ext/json json.c
tony2001Thu Jul 20 07:40:41 2006 UTC Modified files: /php-src/ext/json json.c Log: json_escape_string() doesn't use tsrm_ls, so no need to pass it http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.10r2=1.11diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.10 php-src/ext/json/json.c:1.11 --- php-src/ext/json/json.c:1.10Wed Jul 19 16:17:56 2006 +++ php-src/ext/json/json.c Thu Jul 20 07:40:41 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: json.c,v 1.10 2006/07/19 16:17:56 iliaa Exp $ */ +/* $Id: json.c,v 1.11 2006/07/20 07:40:41 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -82,7 +82,7 @@ /* }}} */ static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC); -static void json_escape_string(smart_str *buf, char *s, int len TSRMLS_DC); +static void json_escape_string(smart_str *buf, char *s, int len); static int json_determine_array_type(zval **val TSRMLS_DC) { int i; @@ -181,7 +181,7 @@ need_comma = 1; } -json_escape_string(buf, key, key_len - 1 TSRMLS_CC); +json_escape_string(buf, key, key_len - 1); smart_str_appendc(buf, ':'); json_encode_r(buf, *data TSRMLS_CC); @@ -216,7 +216,7 @@ #define REVERSE16(us) (((us 0xf) 12) | (((us 4) 0xf) 8) | (((us 8) 0xf) 4) | ((us 12) 0xf)) -static void json_escape_string(smart_str *buf, char *s, int len TSRMLS_DC) +static void json_escape_string(smart_str *buf, char *s, int len) { int pos = 0; unsigned short us; @@ -359,7 +359,7 @@ } break; case IS_STRING: -json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val) TSRMLS_CC); +json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val)); break; case IS_ARRAY: case IS_OBJECT: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/json json.c
tony2001Thu Jul 20 07:40:49 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/json json.c Log: MFH http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.9.2.1r2=1.9.2.2diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.9.2.1 php-src/ext/json/json.c:1.9.2.2 --- php-src/ext/json/json.c:1.9.2.1 Wed Jul 19 16:17:15 2006 +++ php-src/ext/json/json.c Thu Jul 20 07:40:49 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: json.c,v 1.9.2.1 2006/07/19 16:17:15 iliaa Exp $ */ +/* $Id: json.c,v 1.9.2.2 2006/07/20 07:40:49 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -82,7 +82,7 @@ /* }}} */ static void json_encode_r(smart_str *buf, zval *val TSRMLS_DC); -static void json_escape_string(smart_str *buf, char *s, int len TSRMLS_DC); +static void json_escape_string(smart_str *buf, char *s, int len); static int json_determine_array_type(zval **val TSRMLS_DC) { int i; @@ -181,7 +181,7 @@ need_comma = 1; } -json_escape_string(buf, key, key_len - 1 TSRMLS_CC); +json_escape_string(buf, key, key_len - 1); smart_str_appendc(buf, ':'); json_encode_r(buf, *data TSRMLS_CC); @@ -216,7 +216,7 @@ #define REVERSE16(us) (((us 0xf) 12) | (((us 4) 0xf) 8) | (((us 8) 0xf) 4) | ((us 12) 0xf)) -static void json_escape_string(smart_str *buf, char *s, int len TSRMLS_DC) +static void json_escape_string(smart_str *buf, char *s, int len) { int pos = 0; unsigned short us; @@ -359,7 +359,7 @@ } break; case IS_STRING: -json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val) TSRMLS_CC); +json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val)); break; case IS_ARRAY: case IS_OBJECT: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/json JSON_parser.c /ext/json/tests 001.phpt
tony2001Thu Jul 20 08:23:45 2006 UTC Added files: /php-src/ext/json/tests 001.phpt Modified files: /php-src/ext/json JSON_parser.c Log: fix segfault caused by empty keys is JSON data add test http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.1r2=1.2diff_format=u Index: php-src/ext/json/JSON_parser.c diff -u php-src/ext/json/JSON_parser.c:1.1 php-src/ext/json/JSON_parser.c:1.2 --- php-src/ext/json/JSON_parser.c:1.1 Tue Jan 31 08:59:06 2006 +++ php-src/ext/json/JSON_parser.c Thu Jul 20 08:23:45 2006 @@ -338,14 +338,14 @@ { if (!assoc) { -add_property_zval(root, key-c, child); +add_property_zval_ex(root, (key-len ? key-c : _empty_), (key-len ? (key-len + 1) : sizeof(_empty_)), child); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(child); #endif } else { -add_assoc_zval(root, key-c, child); +add_assoc_zval_ex(root, (key-len ? key-c : _empty_), (key-len ? (key-len + 1) : sizeof(_empty_)), child); } key-len = 0; } @@ -481,14 +481,14 @@ if (!assoc) { -add_property_zval(JSON(the_zstack)[JSON(the_top)], key.c, mval); +add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(mval); #endif } else { -add_assoc_zval(JSON(the_zstack)[JSON(the_top)], key.c, mval); +add_assoc_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); } key.len = 0; buf.len = 0; @@ -604,14 +604,14 @@ { if (!assoc) { - add_property_zval(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), mval); + add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(mval); #endif } else { - add_assoc_zval(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), mval); + add_assoc_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); } key.len = 0; } http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/001.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/001.phpt +++ php-src/ext/json/tests/001.phpt --TEST-- json_decode() tests --FILE-- ?php var_dump(json_decode()); var_dump(json_decode()); var_dump(json_decode(, 1)); var_dump(json_decode(, 0)); var_dump(json_decode(., 1)); var_dump(json_decode(., 0)); var_dump(json_decode(?)); var_dump(json_decode(;)); var_dump(json_decode(ÑÑÑÑиÑ)); var_dump(json_decode(blah)); var_dump(json_decode(NULL)); var_dump(json_decode('{ test: { foo: bar } }')); var_dump(json_decode('{ test: { foo: } }')); var_dump(json_decode('{ : { foo: } }')); var_dump(json_decode('{ : { : } }')); var_dump(json_decode('{ : { : }')); var_dump(json_decode('{ : : } }')); echo Done\n; ? --EXPECTF-- Warning: json_decode() expects at least 1 parameter, 0 given in %s on line %d NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL object(stdClass)#1 (1) { [test]= object(stdClass)#2 (1) { [foo]= string(3) bar } } object(stdClass)#1 (1) { [test]= object(stdClass)#2 (1) { [foo]= string(0) } } object(stdClass)#1 (1) { [_empty_]= object(stdClass)#2 (1) { [foo]= string(0) } } object(stdClass)#1 (1) { [_empty_]= object(stdClass)#2 (1) { [_empty_]= string(0) } } NULL NULL 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_2) /ext/json JSON_parser.c /ext/json/tests 001.phpt
tony2001Thu Jul 20 08:24:31 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/json/tests 001.phpt Modified files: /php-src/ext/json JSON_parser.c Log: fix segfault, add test http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.1r2=1.1.2.1diff_format=u Index: php-src/ext/json/JSON_parser.c diff -u php-src/ext/json/JSON_parser.c:1.1 php-src/ext/json/JSON_parser.c:1.1.2.1 --- php-src/ext/json/JSON_parser.c:1.1 Tue Jan 31 08:59:06 2006 +++ php-src/ext/json/JSON_parser.c Thu Jul 20 08:24:31 2006 @@ -338,14 +338,14 @@ { if (!assoc) { -add_property_zval(root, key-c, child); +add_property_zval_ex(root, (key-len ? key-c : _empty_), (key-len ? (key-len + 1) : sizeof(_empty_)), child); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(child); #endif } else { -add_assoc_zval(root, key-c, child); +add_assoc_zval_ex(root, (key-len ? key-c : _empty_), (key-len ? (key-len + 1) : sizeof(_empty_)), child); } key-len = 0; } @@ -481,14 +481,14 @@ if (!assoc) { -add_property_zval(JSON(the_zstack)[JSON(the_top)], key.c, mval); +add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(mval); #endif } else { -add_assoc_zval(JSON(the_zstack)[JSON(the_top)], key.c, mval); +add_assoc_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); } key.len = 0; buf.len = 0; @@ -604,14 +604,14 @@ { if (!assoc) { - add_property_zval(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), mval); + add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(mval); #endif } else { - add_assoc_zval(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), mval); + add_assoc_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); } key.len = 0; } http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/001.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/001.phpt +++ php-src/ext/json/tests/001.phpt --TEST-- json_decode() tests --FILE-- ?php var_dump(json_decode()); var_dump(json_decode()); var_dump(json_decode(, 1)); var_dump(json_decode(, 0)); var_dump(json_decode(., 1)); var_dump(json_decode(., 0)); var_dump(json_decode(?)); var_dump(json_decode(;)); var_dump(json_decode(ÑÑÑÑиÑ)); var_dump(json_decode(blah)); var_dump(json_decode(NULL)); var_dump(json_decode('{ test: { foo: bar } }')); var_dump(json_decode('{ test: { foo: } }')); var_dump(json_decode('{ : { foo: } }')); var_dump(json_decode('{ : { : } }')); var_dump(json_decode('{ : { : }')); var_dump(json_decode('{ : : } }')); echo Done\n; ? --EXPECTF-- Warning: json_decode() expects at least 1 parameter, 0 given in %s on line %d NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL object(stdClass)#1 (1) { [test]= object(stdClass)#2 (1) { [foo]= string(3) bar } } object(stdClass)#1 (1) { [test]= object(stdClass)#2 (1) { [foo]= string(0) } } object(stdClass)#1 (1) { [_empty_]= object(stdClass)#2 (1) { [foo]= string(0) } } object(stdClass)#1 (1) { [_empty_]= object(stdClass)#2 (1) { [_empty_]= string(0) } } NULL NULL Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/json json.c /ext/json/tests 001.phpt 002.phpt 003.phpt 004.phpt 005.phpt
tony2001Thu Jul 20 08:56:24 2006 UTC Added files: /php-src/ext/json/tests 002.phpt 003.phpt 004.phpt 005.phpt Modified files: /php-src/ext/json json.c /php-src/ext/json/tests 001.phpt Log: add recursion protection to json_encode() and new tests http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.11r2=1.12diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.11 php-src/ext/json/json.c:1.12 --- php-src/ext/json/json.c:1.11Thu Jul 20 07:40:41 2006 +++ php-src/ext/json/json.c Thu Jul 20 08:56:24 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: json.c,v 1.11 2006/07/20 07:40:41 tony2001 Exp $ */ +/* $Id: json.c,v 1.12 2006/07/20 08:56:24 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -135,6 +135,11 @@ r = 1; } +if (myht myht-nApplyCount 1) { +php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, recursion detected); +return; +} + if (r == 0) { smart_str_appendc(buf, '['); @@ -151,6 +156,7 @@ ulong index; uint key_len; HashPosition pos; +HashTable *tmp_ht; int need_comma = 0; zend_hash_internal_pointer_reset_ex(myht, pos); @@ -160,6 +166,11 @@ break; if (zend_hash_get_current_data_ex(myht, (void **) data, pos) == SUCCESS) { +tmp_ht = HASH_OF(*data); +if (tmp_ht) { +tmp_ht-nApplyCount++; +} + if (r == 0) { if (need_comma) { smart_str_appendc(buf, ','); @@ -200,6 +211,10 @@ json_encode_r(buf, *data TSRMLS_CC); } } + +if (tmp_ht) { +tmp_ht-nApplyCount--; +} } } } http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/001.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/json/tests/001.phpt diff -u php-src/ext/json/tests/001.phpt:1.1 php-src/ext/json/tests/001.phpt:1.2 --- php-src/ext/json/tests/001.phpt:1.1 Thu Jul 20 08:23:45 2006 +++ php-src/ext/json/tests/001.phpt Thu Jul 20 08:56:24 2006 @@ -1,5 +1,7 @@ --TEST-- json_decode() tests +--SKIPIF-- +?php if (!extension_loaded(json)) print skip; ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/002.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/002.phpt +++ php-src/ext/json/tests/002.phpt --TEST-- json_encode() tests --SKIPIF-- ?php if (!extension_loaded(json)) print skip; ? --FILE-- ?php var_dump(json_encode()); var_dump(json_encode(NULL)); var_dump(json_encode(TRUE)); var_dump(json_encode(array(=))); var_dump(json_encode(array(array(1; var_dump(json_encode(1)); var_dump(json_encode(ÑÑÑÑиÑ)); echo Done\n; ? --EXPECTF-- string(2) string(4) null string(4) true string(2) {} string(5) [[1]] string(1) 1 string(38) \u0440\u0443\u0441\u0441\u0438\u0448 Done http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/003.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/003.phpt +++ php-src/ext/json/tests/003.phpt --TEST-- json_encode() endless loop - 1 --SKIPIF-- ?php if (!extension_loaded(json)) print skip; ? --FILE-- ?php $a = array(); $a[] = $a; var_dump($a); var_dump(json_encode($a)); echo Done\n; ? --EXPECTF-- array(1) { [0]= array(1) { [0]= array(1) { [0]= *RECURSION* } } } Catchable fatal error: json_encode(): recursion detected in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/004.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/004.phpt +++ php-src/ext/json/tests/004.phpt --TEST-- json_encode() endless loop - 2 --SKIPIF-- ?php if (!extension_loaded(json)) print skip; ? --FILE-- ?php $a = new stdclass; $a-prop = $a; var_dump($a); var_dump(json_encode($a)); echo Done\n; ? --EXPECTF-- object(stdClass)#%d (1) { [prop]= object(stdClass)#%d (1) { [prop]= *RECURSION* } } Catchable fatal error: json_encode(): recursion detected in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/005.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/005.phpt +++ php-src/ext/json/tests/005.phpt --TEST-- json_encode() endless loop - 3 --SKIPIF-- ?php if (!extension_loaded(json)) print skip; ? --FILE-- ?php $a = array(); $a[] = $a; var_dump($a); var_dump(json_encode($a)); echo Done\n; ? --EXPECTF-- array(1) { [0]= array(1) { [0]= *RECURSION* } } Catchable fatal error: json_encode(): recursion detected in %s on line %d -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/json json.c /ext/json/tests 001.phpt 002.phpt 003.phpt 004.phpt 005.phpt
tony2001Thu Jul 20 08:56:57 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/json/tests 002.phpt 003.phpt 004.phpt 005.phpt Modified files: /php-src/ext/json json.c /php-src/ext/json/tests 001.phpt Log: MFH: add recursion protection to json_encode() and new tests http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.9.2.2r2=1.9.2.3diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.9.2.2 php-src/ext/json/json.c:1.9.2.3 --- php-src/ext/json/json.c:1.9.2.2 Thu Jul 20 07:40:49 2006 +++ php-src/ext/json/json.c Thu Jul 20 08:56:57 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: json.c,v 1.9.2.2 2006/07/20 07:40:49 tony2001 Exp $ */ +/* $Id: json.c,v 1.9.2.3 2006/07/20 08:56:57 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -135,6 +135,11 @@ r = 1; } +if (myht myht-nApplyCount 1) { +php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, recursion detected); +return; +} + if (r == 0) { smart_str_appendc(buf, '['); @@ -151,6 +156,7 @@ ulong index; uint key_len; HashPosition pos; +HashTable *tmp_ht; int need_comma = 0; zend_hash_internal_pointer_reset_ex(myht, pos); @@ -160,6 +166,11 @@ break; if (zend_hash_get_current_data_ex(myht, (void **) data, pos) == SUCCESS) { +tmp_ht = HASH_OF(*data); +if (tmp_ht) { +tmp_ht-nApplyCount++; +} + if (r == 0) { if (need_comma) { smart_str_appendc(buf, ','); @@ -200,6 +211,10 @@ json_encode_r(buf, *data TSRMLS_CC); } } + +if (tmp_ht) { +tmp_ht-nApplyCount--; +} } } } http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/001.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/json/tests/001.phpt diff -u php-src/ext/json/tests/001.phpt:1.1.2.2 php-src/ext/json/tests/001.phpt:1.1.2.3 --- php-src/ext/json/tests/001.phpt:1.1.2.2 Thu Jul 20 08:24:31 2006 +++ php-src/ext/json/tests/001.phpt Thu Jul 20 08:56:57 2006 @@ -1,5 +1,7 @@ --TEST-- json_decode() tests +--SKIPIF-- +?php if (!extension_loaded(json)) print skip; ? --FILE-- ?php http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/002.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/002.phpt +++ php-src/ext/json/tests/002.phpt --TEST-- json_encode() tests --SKIPIF-- ?php if (!extension_loaded(json)) print skip; ? --FILE-- ?php var_dump(json_encode()); var_dump(json_encode(NULL)); var_dump(json_encode(TRUE)); var_dump(json_encode(array(=))); var_dump(json_encode(array(array(1; var_dump(json_encode(1)); var_dump(json_encode(ÑÑÑÑиÑ)); echo Done\n; ? --EXPECTF-- string(2) string(4) null string(4) true string(2) {} string(5) [[1]] string(1) 1 string(38) \u0440\u0443\u0441\u0441\u0438\u0448 Done http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/003.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/003.phpt +++ php-src/ext/json/tests/003.phpt --TEST-- json_encode() endless loop - 1 --SKIPIF-- ?php if (!extension_loaded(json)) print skip; ? --FILE-- ?php $a = array(); $a[] = $a; var_dump($a); var_dump(json_encode($a)); echo Done\n; ? --EXPECTF-- array(1) { [0]= array(1) { [0]= array(1) { [0]= *RECURSION* } } } Catchable fatal error: json_encode(): recursion detected in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/004.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/004.phpt +++ php-src/ext/json/tests/004.phpt --TEST-- json_encode() endless loop - 2 --SKIPIF-- ?php if (!extension_loaded(json)) print skip; ? --FILE-- ?php $a = new stdclass; $a-prop = $a; var_dump($a); var_dump(json_encode($a)); echo Done\n; ? --EXPECTF-- object(stdClass)#%d (1) { [prop]= object(stdClass)#%d (1) { [prop]= *RECURSION* } } Catchable fatal error: json_encode(): recursion detected in %s on line %d http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/005.phpt?view=markuprev=1.1 Index: php-src/ext/json/tests/005.phpt +++ php-src/ext/json/tests/005.phpt --TEST-- json_encode() endless loop - 3 --SKIPIF-- ?php if (!extension_loaded(json)) print skip; ? --FILE-- ?php $a = array(); $a[] = $a; var_dump($a); var_dump(json_encode($a)); echo Done\n; ? --EXPECTF-- array(1) { [0]= array(1) { [0]= *RECURSION* } } Catchable fatal error: json_encode(): recursion detected in %s on line %d -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/json/tests .cvsignore
tony2001Thu Jul 20 08:58:39 2006 UTC Added files: /php-src/ext/json/tests .cvsignore Log: add missing .cvsignore http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/.cvsignore?view=markuprev=1.1 Index: php-src/ext/json/tests/.cvsignore +++ php-src/ext/json/tests/.cvsignore phpt.* *.diff *.log *.exp *.out *.php *.gcda *.gcno -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/json/tests .cvsignore
tony2001Thu Jul 20 08:58:49 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/json/tests .cvsignore Log: add missing .cvsignore http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/.cvsignore?view=markuprev=1.1 Index: php-src/ext/json/tests/.cvsignore +++ php-src/ext/json/tests/.cvsignore phpt.* *.diff *.log *.exp *.out *.php *.gcda *.gcno -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/json JSON_parser.c
tony2001Thu Jul 20 09:18:46 2006 UTC Modified files: /php-src/ext/json JSON_parser.c Log: ZTS fix http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.2r2=1.3diff_format=u Index: php-src/ext/json/JSON_parser.c diff -u php-src/ext/json/JSON_parser.c:1.2 php-src/ext/json/JSON_parser.c:1.3 --- php-src/ext/json/JSON_parser.c:1.2 Thu Jul 20 08:23:45 2006 +++ php-src/ext/json/JSON_parser.c Thu Jul 20 09:18:46 2006 @@ -338,7 +338,7 @@ { if (!assoc) { -add_property_zval_ex(root, (key-len ? key-c : _empty_), (key-len ? (key-len + 1) : sizeof(_empty_)), child); +add_property_zval_ex(root, (key-len ? key-c : _empty_), (key-len ? (key-len + 1) : sizeof(_empty_)), child TSRMLS_CC); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(child); #endif @@ -481,7 +481,7 @@ if (!assoc) { -add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); +add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval TSRMLS_CC); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(mval); #endif @@ -604,7 +604,7 @@ { if (!assoc) { - add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); + add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval TSRMLS_CC); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(mval); #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/json JSON_parser.c
tony2001Thu Jul 20 09:19:02 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/json JSON_parser.c Log: MFH: ZTS fix http://cvs.php.net/viewvc.cgi/php-src/ext/json/JSON_parser.c?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/json/JSON_parser.c diff -u php-src/ext/json/JSON_parser.c:1.1.2.1 php-src/ext/json/JSON_parser.c:1.1.2.2 --- php-src/ext/json/JSON_parser.c:1.1.2.1 Thu Jul 20 08:24:31 2006 +++ php-src/ext/json/JSON_parser.c Thu Jul 20 09:19:02 2006 @@ -338,7 +338,7 @@ { if (!assoc) { -add_property_zval_ex(root, (key-len ? key-c : _empty_), (key-len ? (key-len + 1) : sizeof(_empty_)), child); +add_property_zval_ex(root, (key-len ? key-c : _empty_), (key-len ? (key-len + 1) : sizeof(_empty_)), child TSRMLS_CC); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(child); #endif @@ -481,7 +481,7 @@ if (!assoc) { -add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); +add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval TSRMLS_CC); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(mval); #endif @@ -604,7 +604,7 @@ { if (!assoc) { - add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval); + add_property_zval_ex(JSON(the_zstack)[JSON(the_top)], (key.len ? key.c : _empty_), (key.len ? (key.len + 1) : sizeof(_empty_)), mval TSRMLS_CC); #if PHP_MAJOR_VERSION = 5 ZVAL_DELREF(mval); #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/json json.c /ext/json/tests 003.phpt 004.phpt 005.phpt
tony2001Thu Jul 20 09:33:16 2006 UTC Modified files: /php-src/ext/json json.c /php-src/ext/json/tests 003.phpt 004.phpt 005.phpt Log: use E_WARNING on recursion and add null to the result to keep it valid http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.12r2=1.13diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.12 php-src/ext/json/json.c:1.13 --- php-src/ext/json/json.c:1.12Thu Jul 20 08:56:24 2006 +++ php-src/ext/json/json.c Thu Jul 20 09:33:15 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: json.c,v 1.12 2006/07/20 08:56:24 tony2001 Exp $ */ +/* $Id: json.c,v 1.13 2006/07/20 09:33:15 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -136,7 +136,8 @@ } if (myht myht-nApplyCount 1) { -php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, recursion detected); +php_error_docref(NULL TSRMLS_CC, E_WARNING, recursion detected); +smart_str_appendl(buf, null, 4); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/003.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/json/tests/003.phpt diff -u php-src/ext/json/tests/003.phpt:1.1 php-src/ext/json/tests/003.phpt:1.2 --- php-src/ext/json/tests/003.phpt:1.1 Thu Jul 20 08:56:24 2006 +++ php-src/ext/json/tests/003.phpt Thu Jul 20 09:33:15 2006 @@ -25,4 +25,6 @@ } } -Catchable fatal error: json_encode(): recursion detected in %s on line %d +Warning: json_encode(): recursion detected in %s on line %d +string(8) [[null]] +Done http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/004.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/json/tests/004.phpt diff -u php-src/ext/json/tests/004.phpt:1.1 php-src/ext/json/tests/004.phpt:1.2 --- php-src/ext/json/tests/004.phpt:1.1 Thu Jul 20 08:56:24 2006 +++ php-src/ext/json/tests/004.phpt Thu Jul 20 09:33:15 2006 @@ -22,4 +22,6 @@ } } -Catchable fatal error: json_encode(): recursion detected in %s on line %d +Warning: json_encode(): recursion detected in %s on line %d +string(22) {prop:{prop:null}} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/005.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/json/tests/005.phpt diff -u php-src/ext/json/tests/005.phpt:1.1 php-src/ext/json/tests/005.phpt:1.2 --- php-src/ext/json/tests/005.phpt:1.1 Thu Jul 20 08:56:24 2006 +++ php-src/ext/json/tests/005.phpt Thu Jul 20 09:33:15 2006 @@ -22,4 +22,6 @@ } } -Catchable fatal error: json_encode(): recursion detected in %s on line %d +Warning: json_encode(): recursion detected in %s on line %d +string(8) [[null]] +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_2) /ext/json json.c /ext/json/tests 003.phpt 004.phpt 005.phpt
tony2001Thu Jul 20 09:33:28 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/json json.c /php-src/ext/json/tests 003.phpt 004.phpt 005.phpt Log: MFH: use E_WARNING on recursion and add null to the result to keep it valid http://cvs.php.net/viewvc.cgi/php-src/ext/json/json.c?r1=1.9.2.3r2=1.9.2.4diff_format=u Index: php-src/ext/json/json.c diff -u php-src/ext/json/json.c:1.9.2.3 php-src/ext/json/json.c:1.9.2.4 --- php-src/ext/json/json.c:1.9.2.3 Thu Jul 20 08:56:57 2006 +++ php-src/ext/json/json.c Thu Jul 20 09:33:28 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: json.c,v 1.9.2.3 2006/07/20 08:56:57 tony2001 Exp $ */ +/* $Id: json.c,v 1.9.2.4 2006/07/20 09:33:28 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -136,7 +136,8 @@ } if (myht myht-nApplyCount 1) { -php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, recursion detected); +php_error_docref(NULL TSRMLS_CC, E_WARNING, recursion detected); +smart_str_appendl(buf, null, 4); return; } http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/003.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/json/tests/003.phpt diff -u php-src/ext/json/tests/003.phpt:1.1.2.2 php-src/ext/json/tests/003.phpt:1.1.2.3 --- php-src/ext/json/tests/003.phpt:1.1.2.2 Thu Jul 20 08:56:57 2006 +++ php-src/ext/json/tests/003.phpt Thu Jul 20 09:33:28 2006 @@ -25,4 +25,6 @@ } } -Catchable fatal error: json_encode(): recursion detected in %s on line %d +Warning: json_encode(): recursion detected in %s on line %d +string(8) [[null]] +Done http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/004.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/json/tests/004.phpt diff -u php-src/ext/json/tests/004.phpt:1.1.2.2 php-src/ext/json/tests/004.phpt:1.1.2.3 --- php-src/ext/json/tests/004.phpt:1.1.2.2 Thu Jul 20 08:56:57 2006 +++ php-src/ext/json/tests/004.phpt Thu Jul 20 09:33:28 2006 @@ -22,4 +22,6 @@ } } -Catchable fatal error: json_encode(): recursion detected in %s on line %d +Warning: json_encode(): recursion detected in %s on line %d +string(22) {prop:{prop:null}} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/json/tests/005.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/json/tests/005.phpt diff -u php-src/ext/json/tests/005.phpt:1.1.2.2 php-src/ext/json/tests/005.phpt:1.1.2.3 --- php-src/ext/json/tests/005.phpt:1.1.2.2 Thu Jul 20 08:56:57 2006 +++ php-src/ext/json/tests/005.phpt Thu Jul 20 09:33:28 2006 @@ -22,4 +22,6 @@ } } -Catchable fatal error: json_encode(): recursion detected in %s on line %d +Warning: json_encode(): recursion detected in %s on line %d +string(8) [[null]] +Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/json CREDITS
sniper Thu Jul 20 10:07:17 2006 UTC Added files: /php-src/ext/json CREDITS Log: missing credits file -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/json CREDITS
sniper Thu Jul 20 10:07:29 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/json CREDITS Log: MFH -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/json config.m4
sniper Thu Jul 20 10:11:02 2006 UTC Modified files: /php-src/ext/json config.m4 Log: Simplify configure, no need to have dozen macros which have no use http://cvs.php.net/viewvc.cgi/php-src/ext/json/config.m4?r1=1.4r2=1.5diff_format=u Index: php-src/ext/json/config.m4 diff -u php-src/ext/json/config.m4:1.4 php-src/ext/json/config.m4:1.5 --- php-src/ext/json/config.m4:1.4 Wed Jul 19 16:17:56 2006 +++ php-src/ext/json/config.m4 Thu Jul 20 10:11:02 2006 @@ -1,88 +1,16 @@ dnl -dnl $Id: config.m4,v 1.4 2006/07/19 16:17:56 iliaa Exp $ -dnl - -AC_DEFUN([PHP_JSON_ADD_SOURCES], [ - PHP_JSON_SOURCES=$PHP_JSON_SOURCES $1 -]) - -AC_DEFUN([PHP_JSON_ADD_BASE_SOURCES], [ - PHP_JSON_BASE_SOURCES=$PHP_JSON_BASE_SOURCES $1 -]) - -AC_DEFUN([PHP_JSON_ADD_BUILD_DIR], [ - PHP_JSON_EXTRA_BUILD_DIRS=$PHP_JSON_EXTRA_BUILD_DIRS $1 -]) - -AC_DEFUN([PHP_JSON_ADD_INCLUDE], [ - PHP_JSON_EXTRA_INCLUDES=$PHP_JSON_EXTRA_INCLUDES $1 -]) - -AC_DEFUN([PHP_JSON_ADD_CONFIG_HEADER], [ - PHP_JSON_EXTRA_CONFIG_HEADERS=$PHP_JSON_EXTRA_CONFIG_HEADERS $1 -]) - -AC_DEFUN([PHP_JSON_ADD_CFLAG], [ - PHP_JSON_CFLAGS=$PHP_JSON_CFLAGS $1 -]) - -AC_DEFUN([PHP_JSON_EXTENSION], [ - PHP_NEW_EXTENSION(json, $PHP_JSON_SOURCES, $ext_shared,, $PHP_JSON_CFLAGS) - PHP_SUBST(JSON_SHARED_LIBADD) - - for dir in $PHP_JSON_EXTRA_BUILD_DIRS; do -PHP_ADD_BUILD_DIR([$ext_builddir/$dir], 1) - done - - for dir in $PHP_JSON_EXTRA_INCLUDES; do -PHP_ADD_INCLUDE([$ext_srcdir/$dir]) -PHP_ADD_INCLUDE([$ext_builddir/$dir]) - done - - if test $ext_shared = no; then -PHP_ADD_SOURCES(PHP_EXT_DIR(json), $PHP_JSON_BASE_SOURCES,$PHP_JSON_CFLAGS) -out=php_config.h - else - PHP_ADD_SOURCES_X(PHP_EXT_DIR(json),$PHP_JSON_BASE_SOURCES,$PHP_JSON_CFLAGS,shared_objects_json,yes) -if test -f $ext_builddir/config.h.in; then - out=$abs_builddir/config.h -else - out=php_config.h -fi - fi - - for cfg in $PHP_JSON_EXTRA_CONFIG_HEADERS; do -cat $ext_builddir/$cfg EOF -#include $out -EOF - done -]) - -AC_DEFUN([PHP_JSON_SETUP_JSON_CHECKER], [ - PHP_JSON_ADD_SOURCES([ -utf8_to_utf16.c -utf8_decode.c -JSON_parser.c - ]) -]) - -dnl -dnl Main config +dnl $Id: config.m4,v 1.5 2006/07/20 10:11:02 sniper Exp $ dnl PHP_ARG_ENABLE(json, whether to enable JavaScript Object Serialization support, [ --disable-json Disable JavaScript Object Serialization support], yes) -if test $PHP_JSON != no; then - AC_DEFINE([HAVE_JSON],1,[whether to have JavaScript Object Serialization support]) +if test $PHP_JSON != no; then + AC_DEFINE([HAVE_JSON],1 ,[whether to have JavaScript Object Serialization support]) AC_HEADER_STDC - PHP_JSON_ADD_BASE_SOURCES([json.c]) - - dnl json_c is required - PHP_JSON_SETUP_JSON_CHECKER - PHP_JSON_EXTENSION - dnl PHP_INSTALL_HEADERS([ext/json], [json_c]) + PHP_NEW_EXTENSION(json, json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c, $ext_shared) + PHP_SUBST(JSON_SHARED_LIBADD) fi # vim600: sts=2 sw=2 et -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/json config.m4
sniper Thu Jul 20 10:11:15 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/json config.m4 Log: MFH: simplify http://cvs.php.net/viewvc.cgi/php-src/ext/json/config.m4?r1=1.3.2.1r2=1.3.2.2diff_format=u Index: php-src/ext/json/config.m4 diff -u php-src/ext/json/config.m4:1.3.2.1 php-src/ext/json/config.m4:1.3.2.2 --- php-src/ext/json/config.m4:1.3.2.1 Wed Jul 19 16:17:15 2006 +++ php-src/ext/json/config.m4 Thu Jul 20 10:11:15 2006 @@ -1,88 +1,16 @@ dnl -dnl $Id: config.m4,v 1.3.2.1 2006/07/19 16:17:15 iliaa Exp $ -dnl - -AC_DEFUN([PHP_JSON_ADD_SOURCES], [ - PHP_JSON_SOURCES=$PHP_JSON_SOURCES $1 -]) - -AC_DEFUN([PHP_JSON_ADD_BASE_SOURCES], [ - PHP_JSON_BASE_SOURCES=$PHP_JSON_BASE_SOURCES $1 -]) - -AC_DEFUN([PHP_JSON_ADD_BUILD_DIR], [ - PHP_JSON_EXTRA_BUILD_DIRS=$PHP_JSON_EXTRA_BUILD_DIRS $1 -]) - -AC_DEFUN([PHP_JSON_ADD_INCLUDE], [ - PHP_JSON_EXTRA_INCLUDES=$PHP_JSON_EXTRA_INCLUDES $1 -]) - -AC_DEFUN([PHP_JSON_ADD_CONFIG_HEADER], [ - PHP_JSON_EXTRA_CONFIG_HEADERS=$PHP_JSON_EXTRA_CONFIG_HEADERS $1 -]) - -AC_DEFUN([PHP_JSON_ADD_CFLAG], [ - PHP_JSON_CFLAGS=$PHP_JSON_CFLAGS $1 -]) - -AC_DEFUN([PHP_JSON_EXTENSION], [ - PHP_NEW_EXTENSION(json, $PHP_JSON_SOURCES, $ext_shared,, $PHP_JSON_CFLAGS) - PHP_SUBST(JSON_SHARED_LIBADD) - - for dir in $PHP_JSON_EXTRA_BUILD_DIRS; do -PHP_ADD_BUILD_DIR([$ext_builddir/$dir], 1) - done - - for dir in $PHP_JSON_EXTRA_INCLUDES; do -PHP_ADD_INCLUDE([$ext_srcdir/$dir]) -PHP_ADD_INCLUDE([$ext_builddir/$dir]) - done - - if test $ext_shared = no; then -PHP_ADD_SOURCES(PHP_EXT_DIR(json), $PHP_JSON_BASE_SOURCES,$PHP_JSON_CFLAGS) -out=php_config.h - else - PHP_ADD_SOURCES_X(PHP_EXT_DIR(json),$PHP_JSON_BASE_SOURCES,$PHP_JSON_CFLAGS,shared_objects_json,yes) -if test -f $ext_builddir/config.h.in; then - out=$abs_builddir/config.h -else - out=php_config.h -fi - fi - - for cfg in $PHP_JSON_EXTRA_CONFIG_HEADERS; do -cat $ext_builddir/$cfg EOF -#include $out -EOF - done -]) - -AC_DEFUN([PHP_JSON_SETUP_JSON_CHECKER], [ - PHP_JSON_ADD_SOURCES([ -utf8_to_utf16.c -utf8_decode.c -JSON_parser.c - ]) -]) - -dnl -dnl Main config +dnl $Id: config.m4,v 1.3.2.2 2006/07/20 10:11:15 sniper Exp $ dnl PHP_ARG_ENABLE(json, whether to enable JavaScript Object Serialization support, [ --disable-json Disable JavaScript Object Serialization support], yes) -if test $PHP_JSON != no; then - AC_DEFINE([HAVE_JSON],1,[whether to have JavaScript Object Serialization support]) +if test $PHP_JSON != no; then + AC_DEFINE([HAVE_JSON],1 ,[whether to have JavaScript Object Serialization support]) AC_HEADER_STDC - PHP_JSON_ADD_BASE_SOURCES([json.c]) - - dnl json_c is required - PHP_JSON_SETUP_JSON_CHECKER - PHP_JSON_EXTENSION - dnl PHP_INSTALL_HEADERS([ext/json], [json_c]) + PHP_NEW_EXTENSION(json, json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c, $ext_shared) + PHP_SUBST(JSON_SHARED_LIBADD) fi # vim600: sts=2 sw=2 et -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard credits_ext.h
sniper Thu Jul 20 10:08:31 2006 UTC Modified files: /php-src/ext/standard credits_ext.h Log: update http://cvs.php.net/viewvc.cgi/php-src/ext/standard/credits_ext.h?r1=1.36r2=1.37diff_format=u Index: php-src/ext/standard/credits_ext.h diff -u php-src/ext/standard/credits_ext.h:1.36 php-src/ext/standard/credits_ext.h:1.37 --- php-src/ext/standard/credits_ext.h:1.36 Mon Apr 10 09:46:31 2006 +++ php-src/ext/standard/credits_ext.h Thu Jul 20 10:08:31 2006 @@ -36,6 +36,7 @@ CREDIT_LINE(IMAP, Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky); CREDIT_LINE(Informix, Danny Heijl, Christian Cartus, Corne' Cornelius); CREDIT_LINE(InterBase, Jouni Ahto, Andrew Avdeev, Ard Biesheuvel); +CREDIT_LINE(JSON, Omar Kilani); CREDIT_LINE(LDAP, Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson, Stig Venaas); CREDIT_LINE(LIBXML, Christian Stocker, Rob Richards, Marcus Boerger, Wez Furlong, Shane Caraveo); CREDIT_LINE(mcrypt, Sascha Schumann, Derick Rethans); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard credits_ext.h
sniper Thu Jul 20 10:09:09 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard credits_ext.h Log: update http://cvs.php.net/viewvc.cgi/php-src/ext/standard/credits_ext.h?r1=1.30.2.6r2=1.30.2.6.2.1diff_format=u Index: php-src/ext/standard/credits_ext.h diff -u php-src/ext/standard/credits_ext.h:1.30.2.6 php-src/ext/standard/credits_ext.h:1.30.2.6.2.1 --- php-src/ext/standard/credits_ext.h:1.30.2.6 Mon Apr 10 09:49:18 2006 +++ php-src/ext/standard/credits_ext.h Thu Jul 20 10:09:09 2006 @@ -35,7 +35,9 @@ CREDIT_LINE(Iconv, Rui Hirokawa, Stig Bakken, Moriyoshi Koizumi ); CREDIT_LINE(IMAP, Rex Logan, Mark Musone, Brian Wang, Kaj-Michael Lang, Antoni Pamies Olive, Rasmus Lerdorf, Andrew Skalski, Chuck Hagenbuch, Daniel R Kalowsky); CREDIT_LINE(Informix, Danny Heijl, Christian Cartus, Corne' Cornelius); +CREDIT_LINE(Input Filter, Rasmus Lerdorf, Derick Rethans); CREDIT_LINE(InterBase, Jouni Ahto, Andrew Avdeev, Ard Biesheuvel); +CREDIT_LINE(JSON, Omar Kilani); CREDIT_LINE(LDAP, Amitay Isaacs, Eric Warnke, Rasmus Lerdorf, Gerrit Thomson, Stig Venaas); CREDIT_LINE(LIBXML, Christian Stocker, Rob Richards, Marcus Boerger, Wez Furlong, Shane Caraveo); CREDIT_LINE(mcrypt, Sascha Schumann, Derick Rethans); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/json config.m4
tony2001Thu Jul 20 10:47:26 2006 UTC Modified files: /php-src/ext/json config.m4 Log: rephrase http://cvs.php.net/viewvc.cgi/php-src/ext/json/config.m4?r1=1.5r2=1.6diff_format=u Index: php-src/ext/json/config.m4 diff -u php-src/ext/json/config.m4:1.5 php-src/ext/json/config.m4:1.6 --- php-src/ext/json/config.m4:1.5 Thu Jul 20 10:11:02 2006 +++ php-src/ext/json/config.m4 Thu Jul 20 10:47:26 2006 @@ -1,12 +1,12 @@ dnl -dnl $Id: config.m4,v 1.5 2006/07/20 10:11:02 sniper Exp $ +dnl $Id: config.m4,v 1.6 2006/07/20 10:47:26 tony2001 Exp $ dnl PHP_ARG_ENABLE(json, whether to enable JavaScript Object Serialization support, [ --disable-json Disable JavaScript Object Serialization support], yes) if test $PHP_JSON != no; then - AC_DEFINE([HAVE_JSON],1 ,[whether to have JavaScript Object Serialization support]) + AC_DEFINE([HAVE_JSON],1 ,[whether to enable JavaScript Object Serialization support]) AC_HEADER_STDC PHP_NEW_EXTENSION(json, json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c, $ext_shared) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/json config.m4
tony2001Thu Jul 20 10:47:37 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/json config.m4 Log: rephrase http://cvs.php.net/viewvc.cgi/php-src/ext/json/config.m4?r1=1.3.2.2r2=1.3.2.3diff_format=u Index: php-src/ext/json/config.m4 diff -u php-src/ext/json/config.m4:1.3.2.2 php-src/ext/json/config.m4:1.3.2.3 --- php-src/ext/json/config.m4:1.3.2.2 Thu Jul 20 10:11:15 2006 +++ php-src/ext/json/config.m4 Thu Jul 20 10:47:37 2006 @@ -1,12 +1,12 @@ dnl -dnl $Id: config.m4,v 1.3.2.2 2006/07/20 10:11:15 sniper Exp $ +dnl $Id: config.m4,v 1.3.2.3 2006/07/20 10:47:37 tony2001 Exp $ dnl PHP_ARG_ENABLE(json, whether to enable JavaScript Object Serialization support, [ --disable-json Disable JavaScript Object Serialization support], yes) if test $PHP_JSON != no; then - AC_DEFINE([HAVE_JSON],1 ,[whether to have JavaScript Object Serialization support]) + AC_DEFINE([HAVE_JSON],1 ,[whether to enable JavaScript Object Serialization support]) AC_HEADER_STDC PHP_NEW_EXTENSION(json, json.c utf8_to_utf16.c utf8_decode.c JSON_parser.c, $ext_shared) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/filter logical_filters.c /ext/filter/tests 034.phpt
pajoye Thu Jul 20 12:58:13 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/filter/tests 034.phpt Modified files: /php-src/ext/filter logical_filters.c Log: - make boolean logical filter works like int/float and php itself - add more tests for boolean input http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/filter/logical_filters.c diff -u php-src/ext/filter/logical_filters.c:1.1.2.1 php-src/ext/filter/logical_filters.c:1.1.2.2 --- php-src/ext/filter/logical_filters.c:1.1.2.1Wed Jul 19 06:57:21 2006 +++ php-src/ext/filter/logical_filters.cThu Jul 20 12:58:12 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: logical_filters.c,v 1.1.2.1 2006/07/19 06:57:21 tony2001 Exp $ */ +/* $Id: logical_filters.c,v 1.1.2.2 2006/07/20 12:58:12 pajoye Exp $ */ #include php_filter.h #include filter_private.h @@ -217,20 +217,29 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ { + char *str = Z_STRVAL_P(value); + + if (str) { + /* fast(er) trim */ + while (*str == ' ') { + str++; + } + } + /* returns true for 1, true, on and yes * returns false for 0, false, off, no, and * null otherwise. */ - if ((strncasecmp(Z_STRVAL_P(value), true, sizeof(true)) == 0) || - (strncasecmp(Z_STRVAL_P(value), yes, sizeof(yes)) == 0) || - (strncasecmp(Z_STRVAL_P(value), on, sizeof(on)) == 0) || - (strncmp(Z_STRVAL_P(value), 1, sizeof(1)) == 0)) + if ((strncasecmp(str, true, sizeof(true)) == 0) || + (strncasecmp(str, yes, sizeof(yes)) == 0) || + (strncasecmp(str, on, sizeof(on)) == 0) || + (strncmp(str, 1, sizeof(1)) == 0)) { zval_dtor(value); ZVAL_BOOL(value, 1); - } else if ((strncasecmp(Z_STRVAL_P(value), false, sizeof(false)) == 0) || - (strncasecmp(Z_STRVAL_P(value), off, sizeof(off)) == 0) || - (strncasecmp(Z_STRVAL_P(value), no, sizeof(no)) == 0) || - (strncmp(Z_STRVAL_P(value), 0, sizeof(0)) == 0) || + } else if ((strncasecmp(str, false, sizeof(false)) == 0) || + (strncasecmp(str, off, sizeof(off)) == 0) || + (strncasecmp(str, no, sizeof(no)) == 0) || + (strncmp(str, 0, sizeof(0)) == 0) || Z_STRLEN_P(value) == 0) { zval_dtor(value); http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/034.phpt?view=markuprev=1.1 Index: php-src/ext/filter/tests/034.phpt +++ php-src/ext/filter/tests/034.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/filter logical_filters.c /ext/filter/tests 034.phpt
pajoye Thu Jul 20 13:03:02 2006 UTC Modified files: /php-src/ext/filter logical_filters.c /php-src/ext/filter/tests 034.phpt Log: - MFB: - make boolean logical filter works like int/float and php itself - add more tests for boolean input http://cvs.php.net/viewvc.cgi/php-src/ext/filter/logical_filters.c?r1=1.2r2=1.3diff_format=u Index: php-src/ext/filter/logical_filters.c diff -u php-src/ext/filter/logical_filters.c:1.2 php-src/ext/filter/logical_filters.c:1.3 --- php-src/ext/filter/logical_filters.c:1.2Wed Jul 19 06:56:28 2006 +++ php-src/ext/filter/logical_filters.cThu Jul 20 13:03:02 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: logical_filters.c,v 1.2 2006/07/19 06:56:28 tony2001 Exp $ */ +/* $Id: logical_filters.c,v 1.3 2006/07/20 13:03:02 pajoye Exp $ */ #include php_filter.h #include filter_private.h @@ -217,20 +217,29 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ { + char *str = Z_STRVAL_P(value); + + if (str) { + /* fast(er) trim */ + while (*str == ' ') { + str++; + } + } + /* returns true for 1, true, on and yes * returns false for 0, false, off, no, and * null otherwise. */ - if ((strncasecmp(Z_STRVAL_P(value), true, sizeof(true)) == 0) || - (strncasecmp(Z_STRVAL_P(value), yes, sizeof(yes)) == 0) || - (strncasecmp(Z_STRVAL_P(value), on, sizeof(on)) == 0) || - (strncmp(Z_STRVAL_P(value), 1, sizeof(1)) == 0)) + if ((strncasecmp(str, true, sizeof(true)) == 0) || + (strncasecmp(str, yes, sizeof(yes)) == 0) || + (strncasecmp(str, on, sizeof(on)) == 0) || + (strncmp(str, 1, sizeof(1)) == 0)) { zval_dtor(value); ZVAL_BOOL(value, 1); - } else if ((strncasecmp(Z_STRVAL_P(value), false, sizeof(false)) == 0) || - (strncasecmp(Z_STRVAL_P(value), off, sizeof(off)) == 0) || - (strncasecmp(Z_STRVAL_P(value), no, sizeof(no)) == 0) || - (strncmp(Z_STRVAL_P(value), 0, sizeof(0)) == 0) || + } else if ((strncasecmp(str, false, sizeof(false)) == 0) || + (strncasecmp(str, off, sizeof(off)) == 0) || + (strncasecmp(str, no, sizeof(no)) == 0) || + (strncmp(str, 0, sizeof(0)) == 0) || Z_STRLEN_P(value) == 0) { zval_dtor(value); http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/034.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/filter/tests/034.phpt diff -u /dev/null php-src/ext/filter/tests/034.phpt:1.2 --- /dev/null Thu Jul 20 13:03:02 2006 +++ php-src/ext/filter/tests/034.phpt Thu Jul 20 13:03:02 2006 @@ -0,0 +1,30 @@ +--TEST-- +Logical filter: boolean +--FILE-- +?php +$booleans = array( +'1' = true, +'On' = true, +'Off' = true, +'True' = true, +'TrUe' = true, +'oN' = true, + +'0' = false, +'Off' = false, +'False' = false, +'faLsE' = false, +'oFf' = false, +'' = false +); + +foreach($booleans as $val=$exp) { +$res =filter_data($val, FILTER_VALIDATE_BOOLEAN); +if ($res !== $exp) { +echo $val failed,'$exp' expect, '$res' received.\n; +} +} +echo Ok.; +? +--EXPECTF-- +Ok. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mbstring/oniguruma/enc gb18030.c
masugataThu Jul 20 15:56:29 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/mbstring/oniguruma/enc gb18030.c Log: Initial commit. Updated bundled oniguruma library (used for multibyte regular expression) to 4.2.0. http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/enc/gb18030.c?view=markuprev=1.1 Index: php-src/ext/mbstring/oniguruma/enc/gb18030.c +++ php-src/ext/mbstring/oniguruma/enc/gb18030.c -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / README.PARAMETER_PARSING_API
andrei Thu Jul 20 15:46:26 2006 UTC Modified files: /php-srcREADME.PARAMETER_PARSING_API Log: Fix void* - zstr http://cvs.php.net/viewvc.cgi/php-src/README.PARAMETER_PARSING_API?r1=1.15r2=1.16diff_format=u Index: php-src/README.PARAMETER_PARSING_API diff -u php-src/README.PARAMETER_PARSING_API:1.15 php-src/README.PARAMETER_PARSING_API:1.16 --- php-src/README.PARAMETER_PARSING_API:1.15 Wed Jul 19 17:51:49 2006 +++ php-src/README.PARAMETER_PARSING_APIThu Jul 20 15:46:26 2006 @@ -51,9 +51,9 @@ r - resource (zval*) s - string (with possible null bytes) and its length (char*, int) S - binary string, does not allow conversion from Unicode strings - t - text (void * (char*/Uchar*), int (length), zend_uchar (IS_STRING/..)) + t - text (zstr (string union), int (length), zend_uchar (IS_STRING/..)) accepts either Unicode or binary string - T - text (void * (char*/Uchar*), int (length), zend_uchar (IS_STRING/..)) + T - text (zstr (string union), int (length), zend_uchar (IS_STRING/..)) coalesces all T parameters to common type (Unicode or binary) u - unicode (UChar*, int) U - Unicode string, does not allow conversion from binary strings -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/date php_date.c /ext/date/tests date_create-1.phpt
derick Thu Jul 20 15:48:36 2006 UTC Modified files: /php-src/ext/date php_date.c /php-src/ext/date/tests date_create-1.phpt Log: - Rename date classes to DateTime and DateTimeZone http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.106r2=1.107diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.106 php-src/ext/date/php_date.c:1.107 --- php-src/ext/date/php_date.c:1.106 Tue Jul 18 12:37:49 2006 +++ php-src/ext/date/php_date.c Thu Jul 20 15:48:36 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_date.c,v 1.106 2006/07/18 12:37:49 derick Exp $ */ +/* $Id: php_date.c,v 1.107 2006/07/20 15:48:36 derick Exp $ */ #include php.h #include php_streams.h @@ -1558,7 +1558,7 @@ { zend_class_entry ce_date, ce_timezone; - INIT_CLASS_ENTRY(ce_date, date, date_funcs_date); + INIT_CLASS_ENTRY(ce_date, DateTime, date_funcs_date); ce_date.create_object = date_object_new_date; date_ce_date = zend_register_internal_class_ex(ce_date, NULL, NULL TSRMLS_CC); memcpy(date_object_handlers_date, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); @@ -1580,7 +1580,7 @@ REGISTER_DATE_CLASS_CONST_STRING(W3C, DATE_FORMAT_RFC3339); - INIT_CLASS_ENTRY(ce_timezone, timezone, date_funcs_timezone); + INIT_CLASS_ENTRY(ce_timezone, DateTimeZone, date_funcs_timezone); ce_timezone.create_object = date_object_new_timezone; date_ce_timezone = zend_register_internal_class_ex(ce_timezone, NULL, NULL TSRMLS_CC); memcpy(date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/date_create-1.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/date/tests/date_create-1.phpt diff -u php-src/ext/date/tests/date_create-1.phpt:1.2 php-src/ext/date/tests/date_create-1.phpt:1.3 --- php-src/ext/date/tests/date_create-1.phpt:1.2 Thu Nov 17 21:07:27 2005 +++ php-src/ext/date/tests/date_create-1.phpt Thu Jul 20 15:48:36 2006 @@ -28,7 +28,7 @@ $d[] = date_create(2005-07-14 22:30:41 America/Los_Angeles, $tz2); foreach($d as $date) { - echo $date-format(date::ISO8601), \n; + echo $date-format(DateTime::ISO8601), \n; } ? --EXPECT-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/date php_date.c /ext/date/tests date_create-1.phpt
derick Thu Jul 20 15:49:02 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/date php_date.c /php-src/ext/date/tests date_create-1.phpt Log: - MFH: Rename date classes to DateTime and DateTimeZone http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.18r2=1.43.2.45.2.19diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.45.2.18 php-src/ext/date/php_date.c:1.43.2.45.2.19 --- php-src/ext/date/php_date.c:1.43.2.45.2.18 Thu Jul 20 07:20:23 2006 +++ php-src/ext/date/php_date.c Thu Jul 20 15:49:02 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_date.c,v 1.43.2.45.2.18 2006/07/20 07:20:23 tony2001 Exp $ */ +/* $Id: php_date.c,v 1.43.2.45.2.19 2006/07/20 15:49:02 derick Exp $ */ #include php.h #include php_streams.h @@ -1430,7 +1430,7 @@ { zend_class_entry ce_date, ce_timezone; - INIT_CLASS_ENTRY(ce_date, date, date_funcs_date); + INIT_CLASS_ENTRY(ce_date, DateTime, date_funcs_date); ce_date.create_object = date_object_new_date; date_ce_date = zend_register_internal_class_ex(ce_date, NULL, NULL TSRMLS_CC); memcpy(date_object_handlers_date, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); @@ -1452,7 +1452,7 @@ REGISTER_DATE_CLASS_CONST_STRING(W3C, DATE_FORMAT_RFC3339); - INIT_CLASS_ENTRY(ce_timezone, timezone, date_funcs_timezone); + INIT_CLASS_ENTRY(ce_timezone, DateTimeZone, date_funcs_timezone); ce_timezone.create_object = date_object_new_timezone; date_ce_timezone = zend_register_internal_class_ex(ce_timezone, NULL, NULL TSRMLS_CC); memcpy(date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); http://cvs.php.net/viewvc.cgi/php-src/ext/date/tests/date_create-1.phpt?r1=1.1.2.1r2=1.1.2.1.2.1diff_format=u Index: php-src/ext/date/tests/date_create-1.phpt diff -u php-src/ext/date/tests/date_create-1.phpt:1.1.2.1 php-src/ext/date/tests/date_create-1.phpt:1.1.2.1.2.1 --- php-src/ext/date/tests/date_create-1.phpt:1.1.2.1 Thu Nov 17 21:05:30 2005 +++ php-src/ext/date/tests/date_create-1.phpt Thu Jul 20 15:49:02 2006 @@ -28,7 +28,7 @@ $d[] = date_create(2005-07-14 22:30:41 America/Los_Angeles, $tz2); foreach($d as $date) { - echo $date-format(date::ISO8601), \n; + echo $date-format(DateTime::ISO8601), \n; } ? --EXPECT-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / unicode-todo.txt
andrei Thu Jul 20 18:14:50 2006 UTC Modified files: /php-srcunicode-todo.txt Log: http://cvs.php.net/viewvc.cgi/php-src/unicode-todo.txt?r1=1.18r2=1.19diff_format=u Index: php-src/unicode-todo.txt diff -u php-src/unicode-todo.txt:1.18 php-src/unicode-todo.txt:1.19 --- php-src/unicode-todo.txt:1.18 Mon Jul 17 19:19:09 2006 +++ php-src/unicode-todo.txtThu Jul 20 18:14:50 2006 @@ -53,3 +53,5 @@ * Make zend_u_str_case_fold() do only case-folding and nothing else. The normalization should be done by zend_normalize_identifier(). + +* Look at performance implications of identifier normalization. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / unicode-progress.txt /ext/standard array.c ZendEngine2 zend_API.h zend_execute_API.c
andrei Thu Jul 20 20:54:23 2006 UTC Modified files: /php-srcunicode-progress.txt /ZendEngine2zend_API.h zend_execute_API.c /php-src/ext/standard array.c Log: Rewrite array_map() to use params API with fci cache and mark it with U. http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.26r2=1.27diff_format=u Index: php-src/unicode-progress.txt diff -u php-src/unicode-progress.txt:1.26 php-src/unicode-progress.txt:1.27 --- php-src/unicode-progress.txt:1.26 Mon Jul 17 22:18:08 2006 +++ php-src/unicode-progress.txtThu Jul 20 20:54:22 2006 @@ -22,9 +22,6 @@ Should work with minor cleanups provided that underlying comparison functions are fixed, FCI cache, test -array_map() -Params API, FCI cache, test - array_multisort() Add SORT_LOCALE_STRING, test @@ -56,6 +53,7 @@ array_flip() array_key_exists() array_keys() +array_map() array_merge() array_merge_recursive() array_product() http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_API.h?r1=1.249r2=1.250diff_format=u Index: ZendEngine2/zend_API.h diff -u ZendEngine2/zend_API.h:1.249 ZendEngine2/zend_API.h:1.250 --- ZendEngine2/zend_API.h:1.249Tue Jul 18 09:08:05 2006 +++ ZendEngine2/zend_API.h Thu Jul 20 20:54:22 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: zend_API.h,v 1.249 2006/07/18 09:08:05 dmitry Exp $ */ +/* $Id: zend_API.h,v 1.250 2006/07/20 20:54:22 andrei Exp $ */ #ifndef ZEND_API_H #define ZEND_API_H @@ -162,6 +162,8 @@ # define CE_STATIC_MEMBERS(ce) ((ce)-static_members) #endif +#define ZEND_FCI_INITIALIZED(fci) ((fci).size != 0) + int zend_next_free_module(void); BEGIN_EXTERN_C() http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute_API.c?r1=1.377r2=1.378diff_format=u Index: ZendEngine2/zend_execute_API.c diff -u ZendEngine2/zend_execute_API.c:1.377 ZendEngine2/zend_execute_API.c:1.378 --- ZendEngine2/zend_execute_API.c:1.377Tue Jul 18 17:52:44 2006 +++ ZendEngine2/zend_execute_API.c Thu Jul 20 20:54:22 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_execute_API.c,v 1.377 2006/07/18 17:52:44 andrei Exp $ */ +/* $Id: zend_execute_API.c,v 1.378 2006/07/20 20:54:22 andrei Exp $ */ #include stdio.h #include signal.h @@ -39,7 +39,7 @@ ZEND_API void (*zend_execute_internal)(zend_execute_data *execute_data_ptr, int return_value_used TSRMLS_DC); /* true globals */ -ZEND_API zend_fcall_info empty_fcall_info = { sizeof(zend_fcall_info), NULL, NULL, NULL, 0, NULL, NULL, 0 }; +ZEND_API zend_fcall_info empty_fcall_info = { 0, NULL, NULL, NULL, 0, NULL, NULL, 0 }; ZEND_API zend_fcall_info_cache empty_fcall_info_cache = { 0, NULL, NULL, NULL }; #ifdef ZEND_WIN32 http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.368r2=1.369diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.368 php-src/ext/standard/array.c:1.369 --- php-src/ext/standard/array.c:1.368 Mon Jul 17 22:18:01 2006 +++ php-src/ext/standard/array.cThu Jul 20 20:54:23 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.368 2006/07/17 22:18:01 andrei Exp $ */ +/* $Id: array.c,v 1.369 2006/07/20 20:54:23 andrei Exp $ */ #include php.h #include php_ini.h @@ -4238,72 +4238,54 @@ /* }}} */ -/* {{{ proto array array_map(mixed callback, array input1 [, array input2 ,...]) +/* {{{ proto array array_map(mixed callback, array input1 [, array input2 ,...]) U Applies the callback to the elements in given arrays. */ PHP_FUNCTION(array_map) { - zval ***pargs = NULL; + zval ***arrays = NULL; + int n_arrays = 0; zval ***params; - zval *callback; zval *result, *null; HashPosition *array_pos; zval **args; - zval callback_name; + zend_fcall_info fci = empty_fcall_info; zend_fcall_info_cache fci_cache = empty_fcall_info_cache; int i, k, maxlen = 0; int *array_len; - if (ZEND_NUM_ARGS() 2) { - WRONG_PARAM_COUNT; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, f!+, fci, fci_cache, arrays, n_arrays) == FAILURE) { + return; } RETVAL_NULL(); - pargs = (zval ***)safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval **), 0); - if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), pargs) == FAILURE) { - efree(pargs); - WRONG_PARAM_COUNT; - } - - callback = *pargs[0]; - - if (Z_TYPE_P(callback) != IS_NULL) { - if (!zend_is_callable(callback, 0, callback_name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, The first argument, '%R', should be either NULL or a valid callback,
[PHP-CVS] cvs: php-src /ext/pcre php_pcre.c php_pcre.h /ext/pcre/tests grep2.phpt match_flags3.phpt preg_replace.phpt preg_replace_callback2.phpt split.phpt
helly Thu Jul 20 21:19:05 2006 UTC Modified files: /php-src/ext/pcre php_pcre.c php_pcre.h /php-src/ext/pcre/tests grep2.phpt match_flags3.phpt preg_replace.phpt preg_replace_callback2.phpt split.phpt Log: - Clean up (after consulting Andrei) . Change the handlers SPL uses to php_pcre_*_impl(pcre_cache_entry*,) . All refactored funcs (match, split, replace, grep) use the above . Change (zend|php)_error() to php_error_docref() . Move from old to new param parsing api . Fix memleaks in unicode mode http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.187r2=1.188diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.187 php-src/ext/pcre/php_pcre.c:1.188 --- php-src/ext/pcre/php_pcre.c:1.187 Sun Jul 16 19:20:05 2006 +++ php-src/ext/pcre/php_pcre.c Thu Jul 20 21:19:05 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.187 2006/07/16 19:20:05 helly Exp $ */ +/* $Id: php_pcre.c,v 1.188 2006/07/20 21:19:05 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -174,19 +174,20 @@ /* {{{ pcre_get_compiled_regex_cache */ -PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC) +PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len TSRMLS_DC) { pcre*re = NULL; - int coptions = 0; - int soptions = 0; - const char *error; - int erroffset; - char delimiter; + pcre_extra *extra; + int coptions = 0; + int soptions = 0; + const char *error; + int erroffset; + char delimiter; char start_delimiter; char end_delimiter; - char*p, *pp; + char*p, *pp; char*pattern; - int do_study = 0; + int do_study = 0; int poptions = 0; unsigned const char *tables = NULL; #if HAVE_SETLOCALE @@ -209,9 +210,6 @@ #if HAVE_SETLOCALE if (!strcmp(pce-locale, locale)) { #endif - *extra = pce-extra; - *preg_options = pce-preg_options; - *compile_options = pce-compile_options; return pce; #if HAVE_SETLOCALE } @@ -285,9 +283,6 @@ /* Move on to the options */ pp++; - /* Clear out preg options */ - *preg_options = 0; - /* Parse through the options, setting appropriate flags. Display a warning if we encounter an unknown modifier. */ while (*pp != 0) { @@ -344,18 +339,17 @@ /* If study option was specified, study the pattern and store the result in extra for passing to pcre_exec. */ if (do_study) { - *extra = pcre_study(re, soptions, error); - if (*extra) { - (*extra)-flags |= PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION; + extra = pcre_study(re, soptions, error); + if (extra) { + extra-flags |= PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION; } if (error != NULL) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, Error while studying pattern); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Error while studying pattern); } + } else { + extra = NULL; } - *preg_options = poptions; - *compile_options = coptions; - efree(pattern); /* @@ -370,7 +364,7 @@ /* Store the compiled pattern and extra info in the cache. */ new_entry.re = re; - new_entry.extra = *extra; + new_entry.extra = extra; new_entry.preg_options = poptions; new_entry.compile_options = coptions; #if HAVE_SETLOCALE @@ -388,8 +382,14 @@ */ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC) { - int compile_options; - pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex), extra, preg_options,
[PHP-CVS] cvs: php-src /ext/spl doxygen.cfg spl_functions.c spl_functions.h spl_iterators.c spl_iterators.h /ext/spl/internal regexiterator.inc /ext/spl/tests iterator_052.phpt iterator_053.phpt
helly Thu Jul 20 21:21:20 2006 UTC Modified files: /php-src/ext/spldoxygen.cfg spl_functions.c spl_functions.h spl_iterators.c spl_iterators.h /php-src/ext/spl/internal regexiterator.inc /php-src/ext/spl/tests iterator_052.phpt iterator_053.phpt Log: - Update RegexIterator http://cvs.php.net/viewvc.cgi/php-src/ext/spl/doxygen.cfg?r1=1.5r2=1.6diff_format=u Index: php-src/ext/spl/doxygen.cfg diff -u php-src/ext/spl/doxygen.cfg:1.5 php-src/ext/spl/doxygen.cfg:1.6 --- php-src/ext/spl/doxygen.cfg:1.5 Mon Feb 20 22:19:04 2006 +++ php-src/ext/spl/doxygen.cfg Thu Jul 20 21:21:19 2006 @@ -194,10 +194,10 @@ #--- CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO +HAVE_DOT = YES CLASS_GRAPH= YES COLLABORATION_GRAPH= YES -UML_LOOK = NO +UML_LOOK = YES TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_functions.c?r1=1.36r2=1.37diff_format=u Index: php-src/ext/spl/spl_functions.c diff -u php-src/ext/spl/spl_functions.c:1.36 php-src/ext/spl/spl_functions.c:1.37 --- php-src/ext/spl/spl_functions.c:1.36Sun Jun 4 10:31:58 2006 +++ php-src/ext/spl/spl_functions.c Thu Jul 20 21:21:19 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_functions.c,v 1.36 2006/06/04 10:31:58 helly Exp $ */ +/* $Id: spl_functions.c,v 1.37 2006/07/20 21:21:19 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -95,14 +95,9 @@ /* }}} */ /* {{{ spl_register_property */ -void spl_register_property( zend_class_entry * class_entry, char *prop_name, zval *prop_val, int prop_flags TSRMLS_DC) +void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC) { - if (!prop_val) { - INIT_PZVAL(prop_val); - prop_val-type = IS_NULL; - } - - zend_declare_property(class_entry, prop_name, strlen(prop_name), prop_val, prop_flags TSRMLS_CC); + zend_declare_property_null(class_entry, prop_name, prop_name_len, prop_flags TSRMLS_CC); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_functions.h?r1=1.23r2=1.24diff_format=u Index: php-src/ext/spl/spl_functions.h diff -u php-src/ext/spl/spl_functions.h:1.23 php-src/ext/spl/spl_functions.h:1.24 --- php-src/ext/spl/spl_functions.h:1.23Sun Jan 1 13:09:54 2006 +++ php-src/ext/spl/spl_functions.h Thu Jul 20 21:21:19 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_functions.h,v 1.23 2006/01/01 13:09:54 sniper Exp $ */ +/* $Id: spl_functions.h,v 1.24 2006/07/20 21:21:19 helly Exp $ */ #ifndef PHP_FUNCTIONS_H #define PHP_FUNCTIONS_H @@ -49,8 +49,8 @@ #define REGISTER_SPL_FUNCTIONS(class_name, function_list) \ spl_register_functions(spl_ce_ ## class_name, function_list TSRMLS_CC); -#define REGISTER_SPL_PROPERTY(class_name, prop_name) \ - spl_register_property(spl_ce_ ## class_name, prop_name, prop_val, prop_flags TSRMLS_CC); +#define REGISTER_SPL_PROPERTY(class_name, prop_name, prop_flags) \ + spl_register_property(spl_ce_ ## class_name, prop_name, sizeof(prop_name)-1, prop_flags TSRMLS_CC); #define REGISTER_SPL_CLASS_CONST_LONG(class_name, const_name, value) \ zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); @@ -64,7 +64,7 @@ void spl_register_parent_ce(zend_class_entry * class_entry, zend_class_entry * parent_class TSRMLS_DC); void spl_register_functions(zend_class_entry * class_entry, zend_function_entry * function_list TSRMLS_DC); -void spl_register_property( zend_class_entry * class_entry, char *prop_name, zval *prop_val, int prop_flags TSRMLS_DC); +void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC); /* sub: whether to allow subclasses/interfaces allow = 0: allow all classes and interfaces http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.141r2=1.142diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.141 php-src/ext/spl/spl_iterators.c:1.142 --- php-src/ext/spl/spl_iterators.c:1.141 Tue Jul 18 22:45:56 2006 +++ php-src/ext/spl/spl_iterators.c Thu Jul 20 21:21:19 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.141 2006/07/18 22:45:56 iliaa Exp $ */ +/* $Id: spl_iterators.c,v 1.142 2006/07/20 21:21:19 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1003,13 +1003,13 @@ case DIT_RegexIterator:
[PHP-CVS] cvs: php-src /ext/pcre php_pcre.c
helly Thu Jul 20 21:52:40 2006 UTC Modified files: /php-src/ext/pcre php_pcre.c Log: - WS http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.188r2=1.189diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.188 php-src/ext/pcre/php_pcre.c:1.189 --- php-src/ext/pcre/php_pcre.c:1.188 Thu Jul 20 21:19:05 2006 +++ php-src/ext/pcre/php_pcre.c Thu Jul 20 21:52:40 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.188 2006/07/20 21:19:05 helly Exp $ */ +/* $Id: php_pcre.c,v 1.189 2006/07/20 21:52:40 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1243,15 +1243,15 @@ **subject, **limit, **subject_entry, - **zcount; + **zcount; char*result; int result_len; int limit_val = -1; zstr string_key; ulongnum_key; zval callback_name; -intreplace_count=0; -int *replace_count_ptr=NULL; + int replace_count=0; + int *replace_count_ptr=NULL; /* Get function parameters and do error-checking. */ if (ZEND_NUM_ARGS() 3 || ZEND_NUM_ARGS() 5 || @@ -1557,7 +1557,7 @@ *p, /* Iterator for input string */ *q, /* Iterator for output string */ delim_char=0, /* Delimiter character to be quoted */ -c; /* Current character */ +c; /* Current character */ zend_bool quote_delim = 0; /* Whether to quote additional delim char */ /* Get the arguments and check for errors */ @@ -1657,12 +1657,12 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, long flags TSRMLS_DC) { - zval **entry; /* An entry in the input array */ + zval **entry; /* An entry in the input array */ pcre_extra *extra = pce-extra;/* Holds results of studying */ pcre_extra extra_data;/* Used locally for exec options */ - int *offsets; /* Array of subpattern offsets */ - int size_offsets; /* Size of the offsets array */ - int count = 0; /* Count of matched subpatterns */ + int *offsets; /* Array of subpattern offsets */ + int size_offsets; /* Size of the offsets array */ + int count = 0; /* Count of matched subpatterns */ zstr string_key; ulongnum_key; zend_boolinvert;/* Whether to return non-matching -- 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_iterators.c
helly Thu Jul 20 21:32:44 2006 UTC Modified files: /php-src/ext/splspl_iterators.c Log: # Sometimes i hate CVS and have no idea what it is doing http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.142r2=1.143diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.142 php-src/ext/spl/spl_iterators.c:1.143 --- php-src/ext/spl/spl_iterators.c:1.142 Thu Jul 20 21:21:19 2006 +++ php-src/ext/spl/spl_iterators.c Thu Jul 20 21:32:44 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.142 2006/07/20 21:21:19 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.143 2006/07/20 21:32:44 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1443,13 +1443,8 @@ } zval_ptr_dtor(intern-current.data); MAKE_STD_ZVAL(intern-current.data); - spl_iterators.c php_pcre_match_impl(intern-u.regex.pce, subject, subject_len, zcount, intern-current.data, intern-u.regex.mode == REGIT_MODE_ALL_MATCHES, intern-u.regex.use_flags, intern-u.regex.preg_flags, 0 TSRMLS_CC); -=== - php_pcre_match(regex, extra, subject, subject_len, zcount, - intern-current.data, intern-u.regex.mode == REGIT_MODE_ALL_MATCHES, 0, 0, 0, 0 TSRMLS_CC); - 1.141 count = zend_hash_num_elements(Z_ARRVAL_P(intern-current.data)); RETVAL_BOOL(count 0); break; @@ -1461,11 +1456,7 @@ } zval_ptr_dtor(intern-current.data); MAKE_STD_ZVAL(intern-current.data); - spl_iterators.c php_pcre_split_impl(intern-u.regex.pce, subject, subject_len, intern-current.data, -1, intern-u.regex.preg_flags TSRMLS_CC); -=== - php_pcre_split(regex, extra, subject, subject_len, intern-current.data, 0, -1, 0, 0, 0 TSRMLS_CC); - 1.141 count = zend_hash_num_elements(Z_ARRVAL_P(intern-current.data)); RETVAL_BOOL(count 1); break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pcre/tests grep2.phpt
helly Thu Jul 20 21:39:48 2006 UTC Modified files: /php-src/ext/pcre/tests grep2.phpt Log: - Fix unicode expectations http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/tests/grep2.phpt?r1=1.3r2=1.4diff_format=u Index: php-src/ext/pcre/tests/grep2.phpt diff -u php-src/ext/pcre/tests/grep2.phpt:1.3 php-src/ext/pcre/tests/grep2.phpt:1.4 --- php-src/ext/pcre/tests/grep2.phpt:1.3 Thu Jul 20 21:19:05 2006 +++ php-src/ext/pcre/tests/grep2.phpt Thu Jul 20 21:39:48 2006 @@ -43,3 +43,28 @@ array(0) { } bool(true) +--UEXPECTF-- +Warning: preg_grep() expects at most 3 parameters, 4 given in %sgrep2.php on line 3 +NULL + +Warning: preg_grep() expects parameter 2 to be array, integer given in %sgrep2.php on line 4 +NULL + +Warning: preg_grep(): Compilation failed: nothing to repeat at offset 0 in %sgrep2.php on line 5 +bool(false) +array(3) { + [5]= + string(1) a + [uxyz]= + string(2) q6 + [6]= + string(3) h20 +} +array(1) { + [ux]= + string(1) 1 +} +bool(true) +array(0) { +} +bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pcre php_pcre.c
helly Thu Jul 20 22:07:09 2006 UTC Modified files: /php-src/ext/pcre php_pcre.c Log: - TSRM fixes http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.189r2=1.190diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.189 php-src/ext/pcre/php_pcre.c:1.190 --- php-src/ext/pcre/php_pcre.c:1.189 Thu Jul 20 21:52:40 2006 +++ php-src/ext/pcre/php_pcre.c Thu Jul 20 22:07:09 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.189 2006/07/20 21:52:40 helly Exp $ */ +/* $Id: php_pcre.c,v 1.190 2006/07/20 22:07:09 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -463,7 +463,7 @@ } PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, - zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_DC) + zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_CC) { zval*result_set,/* Holds a set of subpatterns after a global match */ @@ -926,7 +926,7 @@ } return php_pcre_replace_impl(pce, subject, subject_len, replace_val, - is_callable_replace, result_len, limit, replace_count TSRMLS_DC); + is_callable_replace, result_len, limit, replace_count TSRMLS_CC); } PHPAPI char *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *replace_val, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS
edink Thu Jul 20 22:21:27 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS Log: Lib update http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.134r2=1.2027.2.547.2.135diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.134 php-src/NEWS:1.2027.2.547.2.135 --- php-src/NEWS:1.2027.2.547.2.134 Wed Jul 19 16:20:02 2006 +++ php-src/NEWSThu Jul 20 22:21:27 2006 @@ -1,6 +1,8 @@ PHPNEWS ||| ?? ??? 2006, PHP 5.2.0 +- Updated bundled MySQL client library to version 5.0.22 in the Windows + distribution. (Edin) - Updated timezonedb to version 2006.7. (Derick) - Changed priority of PHPRC environment variable on win32 to be higher then -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl/internal regexiterator.inc
helly Thu Jul 20 22:04:52 2006 UTC Modified files: /php-src/ext/spl/internal regexiterator.inc Log: - Update docu http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/regexiterator.inc?r1=1.4r2=1.5diff_format=u Index: php-src/ext/spl/internal/regexiterator.inc diff -u php-src/ext/spl/internal/regexiterator.inc:1.4 php-src/ext/spl/internal/regexiterator.inc:1.5 --- php-src/ext/spl/internal/regexiterator.inc:1.4 Thu Jul 20 21:21:20 2006 +++ php-src/ext/spl/internal/regexiterator.inc Thu Jul 20 22:04:52 2006 @@ -34,6 +34,7 @@ self::GET_MATCH, self::ALL_MATCHES, self::SPLIT) */ private $preg_flags;/** PREG_* flags, see preg_match(), preg_match_all(), preg_split() */ + private $key; /** the value used for key() */ private $current; /** the value used for current() */ /** @@ -67,9 +68,10 @@ function accept() { $matches = array(); + $this-key = parent::key(); $this-current = parent::current(); /* note that we use $this-current, rather than calling parent::current() */ - $subject = ($this-flags self::USE_KEY) ? parent::key() : $this-current; + $subject = ($this-flags self::USE_KEY) ? $this-key : $this-current; switch($this-mode) { case self::MATCH: @@ -86,9 +88,28 @@ case self::SPLIT: $this-current = array(); preg_split($this-regex, $subject, $this-current, $this-preg_flags) 1; + + case self::REPLACE: + $this-current = array(); + $result = preg_replace($this-regex, $this-replacement, $subject); + if ($this-flags self::USE_KEY) + { + $this-key = $result; + } + else + { + $this-current = $result; + } } } + /** @return the key after accept has been called +*/ + function key() + { + return $this-key; + } + /** @return the current value after accept has been called */ function current() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / unicode-progress.txt /ext/standard array.c
andrei Thu Jul 20 22:51:20 2006 UTC Modified files: /php-srcunicode-progress.txt /php-src/ext/standard array.c Log: Make all array_*diff* functions use params API (along with FCI cache) and mark them with U. # What a mess (before my changes of course) :) http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.27r2=1.28diff_format=u Index: php-src/unicode-progress.txt diff -u php-src/unicode-progress.txt:1.27 php-src/unicode-progress.txt:1.28 --- php-src/unicode-progress.txt:1.27 Thu Jul 20 20:54:22 2006 +++ php-src/unicode-progress.txtThu Jul 20 22:51:20 2006 @@ -10,12 +10,6 @@ Need to fix string_compare_function() to compare Unicode strings directly in code point order -array_diff(), array_udiff() -array_diff_assoc(), array_diff_uassoc(), array_udiff_assoc(), array_udiff_uassoc() -array_diff_key(), array_diff_ukey() -Should work with minor cleanups provided that underlying comparison -functions are fixed, FCI cache, test - array_intersect(), array_uintersect() array_intersect_assoc(), array_uintersect_assoc(), array_intersect_uassoc(), array_uintersect_uassoc() array_intersect_key(), array_intersect_ukey() @@ -83,6 +77,10 @@ ksort(), krsort() usort(), uasort(), uksort() +array_diff(), array_udiff() +array_diff_assoc(), array_diff_uassoc(), +array_udiff_assoc(), array_udiff_uassoc() +array_diff_key(), array_diff_ukey() string.c http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.369r2=1.370diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.369 php-src/ext/standard/array.c:1.370 --- php-src/ext/standard/array.c:1.369 Thu Jul 20 20:54:23 2006 +++ php-src/ext/standard/array.cThu Jul 20 22:51:20 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.369 2006/07/20 20:54:23 andrei Exp $ */ +/* $Id: array.c,v 1.370 2006/07/20 22:51:20 andrei Exp $ */ #include php.h #include php_ini.h @@ -3336,157 +3336,149 @@ { zval ***args = NULL; HashTable *hash; - int argc, arr_argc, i, c; + int arr_argc, i, c; Bucket ***lists, **list, ***ptrs, *p; - zval callback_name; + int req_args; + char *param_spec; + zend_fcall_info fci1, fci2; + zend_fcall_info_cache fci1_cache = empty_fcall_info_cache, fci2_cache = empty_fcall_info_cache; + zend_fcall_info *fci_key, *fci_data; + zend_fcall_info_cache *fci_key_cache, *fci_data_cache; PHP_ARRAY_CMP_FUNC_VARS; int (*diff_key_compare_func)(const void *, const void * TSRMLS_DC); int (*diff_data_compare_func)(const void *, const void * TSRMLS_DC); - - /* Get the argument count */ - argc = ZEND_NUM_ARGS(); - /* Allocate arguments array and get the arguments, checking for errors. */ - args = (zval ***)safe_emalloc(argc, sizeof(zval **), 0); - if (zend_get_parameters_array_ex(argc, args) == FAILURE) { - efree(args); - WRONG_PARAM_COUNT; - } - PHP_ARRAY_CMP_FUNC_BACKUP(); if (behavior == DIFF_NORMAL) { diff_key_compare_func = array_key_compare; + if (data_compare_type == DIFF_COMP_DATA_INTERNAL) { /* array_diff */ - if (argc 2) { - efree(args); - WRONG_PARAM_COUNT; - } - arr_argc = argc; + req_args = 2; + param_spec = +; diff_data_compare_func = php_array_data_compare; } else if (data_compare_type == DIFF_COMP_DATA_USER) { /* array_udiff */ - if (argc 3) { - efree(args); - WRONG_PARAM_COUNT; - } - arr_argc = argc - 1; - diff_data_compare_func = array_user_compare; - if (!zend_is_callable(*args[arr_argc], 0, callback_name)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, Not a valid callback %R, Z_TYPE(callback_name), Z_UNIVAL(callback_name)); - zval_dtor(callback_name); - efree(args); - return; - } - zval_dtor(callback_name); - BG(user_compare_func_name) = args[arr_argc]; + req_args = 3; + param_spec = +f; + diff_data_compare_func = array_user_compare; } else { php_error_docref(NULL TSRMLS_CC, E_WARNING,
[PHP-CVS] cvs: php-src /ext/spl spl_iterators.c
helly Thu Jul 20 22:52:16 2006 UTC Modified files: /php-src/ext/splspl_iterators.c Log: - Need to initialized zvals completley http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.144r2=1.145diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.144 php-src/ext/spl/spl_iterators.c:1.145 --- php-src/ext/spl/spl_iterators.c:1.144 Thu Jul 20 22:35:43 2006 +++ php-src/ext/spl/spl_iterators.c Thu Jul 20 22:52:16 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.144 2006/07/20 22:35:43 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.145 2006/07/20 22:52:16 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1442,7 +1442,7 @@ use_copy = 1; } zval_ptr_dtor(intern-current.data); - MAKE_STD_ZVAL(intern-current.data); + ALLOC_INIT_ZVAL(intern-current.data); php_pcre_match_impl(intern-u.regex.pce, subject, subject_len, zcount, intern-current.data, intern-u.regex.mode == REGIT_MODE_ALL_MATCHES, intern-u.regex.use_flags, intern-u.regex.preg_flags, 0 TSRMLS_CC); count = zend_hash_num_elements(Z_ARRVAL_P(intern-current.data)); @@ -1455,7 +1455,7 @@ use_copy = 1; } zval_ptr_dtor(intern-current.data); - MAKE_STD_ZVAL(intern-current.data); + ALLOC_INIT_ZVAL(intern-current.data); php_pcre_split_impl(intern-u.regex.pce, subject, subject_len, intern-current.data, -1, intern-u.regex.preg_flags TSRMLS_CC); count = zend_hash_num_elements(Z_ARRVAL_P(intern-current.data)); RETVAL_BOOL(count 1); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/pcre php_pcre.c php_pcre.h /ext/pcre/tests grep2.phpt match_flags3.phpt preg_replace.phpt split.phpt
helly Thu Jul 20 22:53:07 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pcre php_pcre.c php_pcre.h /php-src/ext/pcre/tests grep2.phpt match_flags3.phpt preg_replace.phpt split.phpt Log: - MFH Clean up (after consulting Andrei) . Change the handlers SPL uses to php_pcre_*_impl(pcre_cache_entry*,) . All refactored funcs (match, split, replace, grep) use the above . Change (zend|php)_error() to php_error_docref() . Move from old to new param parsing api . Fix memleaks in unicode mode http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.168.2.9.2.8r2=1.168.2.9.2.9diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.168.2.9.2.8 php-src/ext/pcre/php_pcre.c:1.168.2.9.2.9 --- php-src/ext/pcre/php_pcre.c:1.168.2.9.2.8 Sun Jul 16 21:09:30 2006 +++ php-src/ext/pcre/php_pcre.c Thu Jul 20 22:53:07 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.168.2.9.2.8 2006/07/16 21:09:30 helly Exp $ */ +/* $Id: php_pcre.c,v 1.168.2.9.2.9 2006/07/20 22:53:07 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -174,19 +174,20 @@ /* {{{ pcre_get_compiled_regex_cache */ -PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len, pcre_extra **extra, int *preg_options, int *compile_options TSRMLS_DC) +PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(char *regex, int regex_len TSRMLS_DC) { pcre*re = NULL; - int coptions = 0; - int soptions = 0; - const char *error; - int erroffset; - char delimiter; + pcre_extra *extra; + int coptions = 0; + int soptions = 0; + const char *error; + int erroffset; + char delimiter; char start_delimiter; char end_delimiter; - char*p, *pp; + char*p, *pp; char*pattern; - int do_study = 0; + int do_study = 0; int poptions = 0; unsigned const char *tables = NULL; #if HAVE_SETLOCALE @@ -209,9 +210,6 @@ #if HAVE_SETLOCALE if (!strcmp(pce-locale, locale)) { #endif - *extra = pce-extra; - *preg_options = pce-preg_options; - *compile_options = pce-compile_options; return pce; #if HAVE_SETLOCALE } @@ -285,9 +283,6 @@ /* Move on to the options */ pp++; - /* Clear out preg options */ - *preg_options = 0; - /* Parse through the options, setting appropriate flags. Display a warning if we encounter an unknown modifier. */ while (*pp != 0) { @@ -344,18 +339,17 @@ /* If study option was specified, study the pattern and store the result in extra for passing to pcre_exec. */ if (do_study) { - *extra = pcre_study(re, soptions, error); - if (*extra) { - (*extra)-flags |= PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION; + extra = pcre_study(re, soptions, error); + if (extra) { + extra-flags |= PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION; } if (error != NULL) { - php_error_docref(NULL TSRMLS_CC,E_WARNING, Error while studying pattern); + php_error_docref(NULL TSRMLS_CC, E_WARNING, Error while studying pattern); } + } else { + extra = NULL; } - *preg_options = poptions; - *compile_options = coptions; - efree(pattern); /* @@ -370,7 +364,7 @@ /* Store the compiled pattern and extra info in the cache. */ new_entry.re = re; - new_entry.extra = *extra; + new_entry.extra = extra; new_entry.preg_options = poptions; new_entry.compile_options = coptions; #if HAVE_SETLOCALE @@ -388,8 +382,14 @@ */ PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options TSRMLS_DC) { - int compile_options; - pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex), extra,
[PHP-CVS] cvs: php-src /ext/pcre php_pcre.c
rrichards Thu Jul 20 22:40:44 2006 UTC Modified files: /php-src/ext/pcre php_pcre.c Log: tsrmls fix http://cvs.php.net/viewvc.cgi/php-src/ext/pcre/php_pcre.c?r1=1.190r2=1.191diff_format=u Index: php-src/ext/pcre/php_pcre.c diff -u php-src/ext/pcre/php_pcre.c:1.190 php-src/ext/pcre/php_pcre.c:1.191 --- php-src/ext/pcre/php_pcre.c:1.190 Thu Jul 20 22:07:09 2006 +++ php-src/ext/pcre/php_pcre.c Thu Jul 20 22:40:44 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_pcre.c,v 1.190 2006/07/20 22:07:09 helly Exp $ */ +/* $Id: php_pcre.c,v 1.191 2006/07/20 22:40:44 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -463,7 +463,7 @@ } PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value, - zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_CC) + zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_DC) { zval*result_set,/* Holds a set of subpatterns after a global match */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/spl doxygen.cfg spl_functions.c spl_functions.h spl_iterators.c spl_iterators.h /ext/spl/internal regexiterator.inc /ext/spl/tests iterator_050.phpt iterator_051
helly Thu Jul 20 22:54:22 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/spldoxygen.cfg spl_functions.c spl_functions.h spl_iterators.c spl_iterators.h /php-src/ext/spl/internal regexiterator.inc /php-src/ext/spl/tests iterator_050.phpt iterator_051.phpt iterator_052.phpt iterator_053.phpt iterator_054.phpt iterator_055.phpt Log: - Synch RegexIterator with HEAD http://cvs.php.net/viewvc.cgi/php-src/ext/spl/doxygen.cfg?r1=1.4.2.1r2=1.4.2.1.2.1diff_format=u Index: php-src/ext/spl/doxygen.cfg diff -u php-src/ext/spl/doxygen.cfg:1.4.2.1 php-src/ext/spl/doxygen.cfg:1.4.2.1.2.1 --- php-src/ext/spl/doxygen.cfg:1.4.2.1 Mon Feb 20 22:21:54 2006 +++ php-src/ext/spl/doxygen.cfg Thu Jul 20 22:54:21 2006 @@ -194,10 +194,10 @@ #--- CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO +HAVE_DOT = YES CLASS_GRAPH= YES COLLABORATION_GRAPH= YES -UML_LOOK = NO +UML_LOOK = YES TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_functions.c?r1=1.28.2.3.2.1r2=1.28.2.3.2.2diff_format=u Index: php-src/ext/spl/spl_functions.c diff -u php-src/ext/spl/spl_functions.c:1.28.2.3.2.1 php-src/ext/spl/spl_functions.c:1.28.2.3.2.2 --- php-src/ext/spl/spl_functions.c:1.28.2.3.2.1Sun Jun 4 10:34:22 2006 +++ php-src/ext/spl/spl_functions.c Thu Jul 20 22:54:21 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_functions.c,v 1.28.2.3.2.1 2006/06/04 10:34:22 helly Exp $ */ +/* $Id: spl_functions.c,v 1.28.2.3.2.2 2006/07/20 22:54:21 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -36,7 +36,7 @@ /* }}} */ /* {{{ spl_register_interface */ -void spl_register_interface(zend_class_entry ** ppce, char * class_name, zend_function_entry *functions TSRMLS_DC) +void spl_register_interface(zend_class_entry ** ppce, char * class_name, zend_function_entry * functions TSRMLS_DC) { zend_class_entry ce; @@ -95,14 +95,9 @@ /* }}} */ /* {{{ spl_register_property */ -void spl_register_property( zend_class_entry * class_entry, char *prop_name, zval *prop_val, int prop_flags TSRMLS_DC) +void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC) { - if (!prop_val) { - INIT_PZVAL(prop_val); - prop_val-type = IS_NULL; - } - - zend_declare_property(class_entry, prop_name, strlen(prop_name), prop_val, prop_flags TSRMLS_CC); + zend_declare_property_null(class_entry, prop_name, prop_name_len, prop_flags TSRMLS_CC); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_functions.h?r1=1.19.2.3r2=1.19.2.3.2.1diff_format=u Index: php-src/ext/spl/spl_functions.h diff -u php-src/ext/spl/spl_functions.h:1.19.2.3 php-src/ext/spl/spl_functions.h:1.19.2.3.2.1 --- php-src/ext/spl/spl_functions.h:1.19.2.3Sun Jan 1 12:50:13 2006 +++ php-src/ext/spl/spl_functions.h Thu Jul 20 22:54:21 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_functions.h,v 1.19.2.3 2006/01/01 12:50:13 sniper Exp $ */ +/* $Id: spl_functions.h,v 1.19.2.3.2.1 2006/07/20 22:54:21 helly Exp $ */ #ifndef PHP_FUNCTIONS_H #define PHP_FUNCTIONS_H @@ -49,8 +49,8 @@ #define REGISTER_SPL_FUNCTIONS(class_name, function_list) \ spl_register_functions(spl_ce_ ## class_name, function_list TSRMLS_CC); -#define REGISTER_SPL_PROPERTY(class_name, prop_name) \ - spl_register_property(spl_ce_ ## class_name, prop_name, prop_val, prop_flags TSRMLS_CC); +#define REGISTER_SPL_PROPERTY(class_name, prop_name, prop_flags) \ + spl_register_property(spl_ce_ ## class_name, prop_name, sizeof(prop_name)-1, prop_flags TSRMLS_CC); #define REGISTER_SPL_CLASS_CONST_LONG(class_name, const_name, value) \ zend_declare_class_constant_long(spl_ce_ ## class_name, const_name, sizeof(const_name)-1, (long)value TSRMLS_CC); @@ -64,7 +64,7 @@ void spl_register_parent_ce(zend_class_entry * class_entry, zend_class_entry * parent_class TSRMLS_DC); void spl_register_functions(zend_class_entry * class_entry, zend_function_entry * function_list TSRMLS_DC); -void spl_register_property( zend_class_entry * class_entry, char *prop_name, zval *prop_val, int prop_flags TSRMLS_DC); +void spl_register_property( zend_class_entry * class_entry, char *prop_name, int prop_name_len, int prop_flags TSRMLS_DC); /* sub: whether to allow subclasses/interfaces allow = 0: allow all classes and interfaces
[PHP-CVS] cvs: php-src /ext/spl spl_iterators.c /ext/spl/internal regexiterator.inc /ext/spl/tests iterator_050.phpt iterator_051.phpt iterator_052.phpt iterator_053.phpt iterator_054.phpt iterator_
helly Thu Jul 20 22:35:44 2006 UTC Modified files: /php-src/ext/splspl_iterators.c /php-src/ext/spl/internal regexiterator.inc /php-src/ext/spl/tests iterator_050.phpt iterator_051.phpt iterator_052.phpt iterator_053.phpt iterator_054.phpt iterator_055.phpt Log: - Change order of ctor args # Do it before the child falls in the brunnel - aka prior to first release. http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_iterators.c?r1=1.143r2=1.144diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.143 php-src/ext/spl/spl_iterators.c:1.144 --- php-src/ext/spl/spl_iterators.c:1.143 Thu Jul 20 21:32:44 2006 +++ php-src/ext/spl/spl_iterators.c Thu Jul 20 22:35:43 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.143 2006/07/20 21:32:44 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.144 2006/07/20 22:35:43 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1009,7 +1009,7 @@ intern-u.regex.use_flags = ZEND_NUM_ARGS() = 5; intern-u.regex.flags = 0; intern-u.regex.preg_flags = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Os|lll, zobject, ce_inner, regex, regex_len, intern-u.regex.flags, mode, intern-u.regex.preg_flags) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Os|lll, zobject, ce_inner, regex, regex_len, mode, intern-u.regex.flags, intern-u.regex.preg_flags) == FAILURE) { php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC); return NULL; } @@ -1376,7 +1376,7 @@ } /* }}} */ #if HAVE_PCRE || HAVE_BUNDLED_PCRE -/* {{{ proto void RegexIterator::__construct(Iterator it, string regex [, int flags [, int mode [, int preg_flags]]]) +/* {{{ proto void RegexIterator::__construct(Iterator it, string regex [, int mode [, int flags [, int preg_flags]]]) Create an RegexIterator from another iterator and a regular expression */ SPL_METHOD(RegexIterator, __construct) { @@ -1484,7 +1484,7 @@ } } /* }}} */ -/* {{{ proto void RecursiveRegexIterator::__construct(RecursiveIterator it, string regex [, int flags [, int mode [, int preg_flags]]]) +/* {{{ proto void RecursiveRegexIterator::__construct(RecursiveIterator it, string regex [, int mode [, int flags [, int preg_flags]]]) Create an RecursiveRegexIterator from another recursive iterator and a regular expression */ SPL_METHOD(RecursiveRegexIterator, __construct) { @@ -1624,8 +1624,8 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_regex_it___construct, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) ZEND_ARG_INFO(0, regex) - ZEND_ARG_INFO(0, flags) ZEND_ARG_INFO(0, mode) + ZEND_ARG_INFO(0, flags) ZEND_ARG_INFO(0, preg_flags) ZEND_END_ARG_INFO(); http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/regexiterator.inc?r1=1.5r2=1.6diff_format=u Index: php-src/ext/spl/internal/regexiterator.inc diff -u php-src/ext/spl/internal/regexiterator.inc:1.5 php-src/ext/spl/internal/regexiterator.inc:1.6 --- php-src/ext/spl/internal/regexiterator.inc:1.5 Thu Jul 20 22:04:52 2006 +++ php-src/ext/spl/internal/regexiterator.inc Thu Jul 20 22:35:44 2006 @@ -43,13 +43,13 @@ * * @param it inner iterator * @param regex the regular expression to match -* @param flags special flags (self::USE_KEY) * @param modeoperation mode (one of self::MATCH, self::GET_MATCH, *self::ALL_MATCHES, self::SPLIT) +* @param flags special flags (self::USE_KEY) * @param preg_flags global PREG_* flags, see preg_match(), *preg_match_all(), preg_split() */ - function __construct(Iterator $it, $regex, $flags = 0, $mode = 0, $preg_flags = 0) { + function __construct(Iterator $it, $regex, $mode = 0, $flags = 0, $preg_flags = 0) { parent::__construct($it); $this-regex = $regex; $this-flags = $flags; http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/iterator_050.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/spl/tests/iterator_050.phpt diff -u php-src/ext/spl/tests/iterator_050.phpt:1.1 php-src/ext/spl/tests/iterator_050.phpt:1.2 --- php-src/ext/spl/tests/iterator_050.phpt:1.1 Sun Jul 16 20:52:20 2006 +++ php-src/ext/spl/tests/iterator_050.phpt Thu Jul 20 22:35:44 2006 @@ -18,10 +18,10 @@ } $ar = new ArrayIterator(array('1','1,2','1,2,3','',NULL,array(),'FooBar',',',',,')); -$it = new MyRegexIterator($ar, '/(\d),(\d)/', 0, RegexIterator::GET_MATCH); +$it = new MyRegexIterator($ar, '/(\d),(\d)/',
[PHP-CVS] cvs: php-src / unicode-progress.txt /ext/standard array.c basic_functions.c basic_functions.h
andrei Thu Jul 20 23:21:33 2006 UTC Modified files: /php-srcunicode-progress.txt /php-src/ext/standard array.c basic_functions.c basic_functions.h Log: Make array_walk(_recursive) use params API with FCI cache and mark them with U. http://cvs.php.net/viewvc.cgi/php-src/unicode-progress.txt?r1=1.28r2=1.29diff_format=u Index: php-src/unicode-progress.txt diff -u php-src/unicode-progress.txt:1.28 php-src/unicode-progress.txt:1.29 --- php-src/unicode-progress.txt:1.28 Thu Jul 20 22:51:20 2006 +++ php-src/unicode-progress.txtThu Jul 20 23:21:32 2006 @@ -11,7 +11,8 @@ directly in code point order array_intersect(), array_uintersect() -array_intersect_assoc(), array_uintersect_assoc(), array_intersect_uassoc(), array_uintersect_uassoc() +array_intersect_assoc(), array_uintersect_assoc() +array_intersect_uassoc(), array_uintersect_uassoc() array_intersect_key(), array_intersect_ukey() Should work with minor cleanups provided that underlying comparison functions are fixed, FCI cache, test @@ -19,12 +20,6 @@ array_multisort() Add SORT_LOCALE_STRING, test -array_walk() -Params API, is_callable check, FCI cache, test - -array_walk_recursive() -Params API, is_callable check, FCI cache, test - extract() Params API, fix php_valid_var_name(), test @@ -62,6 +57,8 @@ array_sum() array_values() array_unique() +array_walk() +array_walk_recursive() compact() count() in_array() http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.370r2=1.371diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.370 php-src/ext/standard/array.c:1.371 --- php-src/ext/standard/array.c:1.370 Thu Jul 20 22:51:20 2006 +++ php-src/ext/standard/array.cThu Jul 20 23:21:32 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.370 2006/07/20 22:51:20 andrei Exp $ */ +/* $Id: array.c,v 1.371 2006/07/20 23:21:32 andrei Exp $ */ #include php.h #include php_ini.h @@ -1025,13 +1025,12 @@ static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive TSRMLS_DC) { zval **args[3], /* Arguments to userland function */ - *retval_ptr, /* Return value - unused */ - *key=NULL;/* Entry key */ + *retval_ptr, /* Return value - unused */ + *key=NULL;/* Entry key */ zstr string_key; uint string_key_len; ulong num_key; HashPosition pos; - zend_fcall_info_cache array_walk_fci_cache = empty_fcall_info_cache; /* Set up known arguments */ args[1] = key; @@ -1039,10 +1038,17 @@ zend_hash_internal_pointer_reset_ex(target_hash, pos); + BG(array_walk_fci).retval_ptr_ptr = retval_ptr; + BG(array_walk_fci).param_count = userdata ? 3 : 2; + BG(array_walk_fci).params = args; + BG(array_walk_fci).no_separation = 0; + /* Iterate through hash */ while (!EG(exception) zend_hash_get_current_data_ex(target_hash, (void **)args[0], pos) == SUCCESS) { if (recursive Z_TYPE_PP(args[0]) == IS_ARRAY) { HashTable *thash; + zend_fcall_info orig_array_walk_fci; + zend_fcall_info_cache orig_array_walk_fci_cache; SEPARATE_ZVAL_TO_MAKE_IS_REF(args[0]); thash = HASH_OF(*(args[0])); @@ -1050,10 +1056,17 @@ php_error_docref(NULL TSRMLS_CC, E_WARNING, recursion detected); return 0; } + + /* backup the fcall info and cache */ + orig_array_walk_fci = BG(array_walk_fci); + orig_array_walk_fci_cache = BG(array_walk_fci_cache); + php_array_walk(thash, userdata, recursive TSRMLS_CC); - } else { - zend_fcall_info fci; + /* restore the fcall info and cache */ + BG(array_walk_fci) = orig_array_walk_fci; + BG(array_walk_fci_cache) = orig_array_walk_fci_cache; + } else { /* Allocate space for key */ MAKE_STD_ZVAL(key); @@ -1071,29 +1084,14 @@ break; } - fci.size = sizeof(fci); - fci.function_table = EG(function_table); - fci.function_name = *BG(array_walk_func_name); - fci.symbol_table = NULL; - fci.object_pp = NULL; -
[PHP-CVS] cvs: php-src /ext/xmlreader php_xmlreader.c
rrichards Fri Jul 21 00:57:14 2006 UTC Modified files: /php-src/ext/xmlreader php_xmlreader.c Log: unicode support for handling filenames http://cvs.php.net/viewvc.cgi/php-src/ext/xmlreader/php_xmlreader.c?r1=1.34r2=1.35diff_format=u Index: php-src/ext/xmlreader/php_xmlreader.c diff -u php-src/ext/xmlreader/php_xmlreader.c:1.34 php-src/ext/xmlreader/php_xmlreader.c:1.35 --- php-src/ext/xmlreader/php_xmlreader.c:1.34 Wed Jul 19 18:32:19 2006 +++ php-src/ext/xmlreader/php_xmlreader.c Fri Jul 21 00:57:14 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xmlreader.c,v 1.34 2006/07/19 18:32:19 rrichards Exp $ */ +/* $Id: php_xmlreader.c,v 1.35 2006/07/21 00:57:14 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -505,9 +505,16 @@ xmlreader_object *intern; xmlRelaxNGPtr schema = NULL; char *source; + zend_uchar source_type = IS_STRING; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s!, source, source_len) == FAILURE) { - return; + if (type == XMLREADER_LOAD_FILE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t!, source, source_len, source_type) == FAILURE) { + return; + } + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s!, source, source_len) == FAILURE) { + return; + } } if (source != NULL !source_len) { @@ -520,10 +527,18 @@ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern intern-ptr) { if (source) { + if (source_type == IS_UNICODE) { + if (php_stream_path_encode(NULL, source, source_len, (UChar*)source, source_len, REPORT_ERRORS, NULL) == FAILURE) { + RETURN_FALSE; + } + } schema = _xmlreader_get_relaxNG(source, source_len, type, NULL, NULL TSRMLS_CC); if (schema) { retval = xmlTextReaderRelaxNGSetSchema(intern-ptr, schema); } + if (source_type == IS_UNICODE) { + efree(source); + } } else { /* unset the associated relaxNG context and schema if one exists */ retval = xmlTextReaderRelaxNGSetSchema(intern-ptr, NULL); @@ -902,6 +917,7 @@ { zval *id; int source_len = 0, encoding_len = 0; + zend_uchar source_type; long options = 0; xmlreader_object *intern = NULL; char *source, *valid_file = NULL; @@ -913,7 +929,7 @@ orig_runtime_conv = ZEND_U_CONVERTER(UG(runtime_encoding_conv)); UG(runtime_encoding_conv) = UG(utf8_conv); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|s!l, source, source_len, encoding, encoding_len, options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t|s!l, source, source_len, source_type, encoding, encoding_len, options) == FAILURE) { UG(runtime_encoding_conv) = orig_runtime_conv; return; } @@ -935,12 +951,22 @@ RETURN_FALSE; } + if (source_type == IS_UNICODE) { + if (php_stream_path_encode(NULL, source, source_len, (UChar*)source, source_len, REPORT_ERRORS, NULL) == FAILURE) { + RETURN_FALSE; + } + } + valid_file = _xmlreader_get_valid_file_path(source, resolved_path, MAXPATHLEN TSRMLS_CC); if (valid_file) { reader = xmlReaderForFile(valid_file, encoding, options); } + if (source_type == IS_UNICODE) { + efree(source); + } + if (reader == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to open source data); RETURN_FALSE; @@ -1001,8 +1027,9 @@ int source_len = 0, retval = -1; xmlreader_object *intern; char *source; + zend_uchar source_type; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s!, source, source_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t!, source, source_len, source_type) == FAILURE) { return; } @@ -1015,8 +1042,17 @@ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern intern-ptr) { + if (source_type == IS_UNICODE) { + if (php_stream_path_encode(NULL, source, source_len, (UChar*)source, source_len, REPORT_ERRORS, NULL) == FAILURE) { + RETURN_FALSE; + } + }
Re: [PHP-CVS] cvs: php-src /ext/xmlreader php_xmlreader.c
So you're encoding the source even when type is XMLREADER_LOAD_STRING? -Andrei On Jul 20, 2006, at 5:57 PM, Rob Richards wrote: + if (type == XMLREADER_LOAD_FILE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t!, source, source_len, source_type) == FAILURE) { + return; + } + } else { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s!, source, source_len) == FAILURE) { + return; + } } if (source != NULL !source_len) { @@ -520,10 +527,18 @@ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern intern-ptr) { if (source) { + if (source_type == IS_UNICODE) { +if (php_stream_path_encode(NULL, source, source_len, (UChar*) source, source_len, REPORT_ERRORS, NULL) == FAILURE) { + RETURN_FALSE; + } + } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/xmlreader php_xmlreader.c
When type is XMLREADER_LOAD_STRING, it uses the s parameter, so wouldn't the source_type be IS_STRING (from the initial variable declaration) causing it to never be encoded? Rob Andrei Zmievski wrote: So you're encoding the source even when type is XMLREADER_LOAD_STRING? -Andrei On Jul 20, 2006, at 5:57 PM, Rob Richards wrote: +if (type == XMLREADER_LOAD_FILE) { +if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t!, source, source_len, source_type) == FAILURE) { +return; +} +} else { +if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s!, source, source_len) == FAILURE) { +return; +} } if (source != NULL !source_len) { @@ -520,10 +527,18 @@ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern intern-ptr) { if (source) { +if (source_type == IS_UNICODE) { +if (php_stream_path_encode(NULL, source, source_len, (UChar*)source, source_len, REPORT_ERRORS, NULL) == FAILURE) { +RETURN_FALSE; +} +} --PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/xmlreader php_xmlreader.c
You're right. I guess it was just a bit too subtle for me after the day of staring at the code. :) -Andrei On Jul 20, 2006, at 6:20 PM, Rob Richards wrote: When type is XMLREADER_LOAD_STRING, it uses the s parameter, so wouldn't the source_type be IS_STRING (from the initial variable declaration) causing it to never be encoded? Rob Andrei Zmievski wrote: So you're encoding the source even when type is XMLREADER_LOAD_STRING? -Andrei On Jul 20, 2006, at 5:57 PM, Rob Richards wrote: +if (type == XMLREADER_LOAD_FILE) { +if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, t!, source, source_len, source_type) == FAILURE) { +return; +} +} else { +if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s!, source, source_len) == FAILURE) { +return; +} } if (source != NULL !source_len) { @@ -520,10 +527,18 @@ intern = (xmlreader_object *)zend_object_store_get_object(id TSRMLS_CC); if (intern intern-ptr) { if (source) { +if (source_type == IS_UNICODE) { +if (php_stream_path_encode(NULL, source, source_len, (UChar*)source, source_len, REPORT_ERRORS, NULL) == FAILURE) { +RETURN_FALSE; +} +} --PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- 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
rrichards Fri Jul 21 02:09:29 2006 UTC Modified files: /php-src/ext/xmlreader php_xmlreader.c Log: return EMPTY_TEXT here http://cvs.php.net/viewvc.cgi/php-src/ext/xmlreader/php_xmlreader.c?r1=1.35r2=1.36diff_format=u Index: php-src/ext/xmlreader/php_xmlreader.c diff -u php-src/ext/xmlreader/php_xmlreader.c:1.35 php-src/ext/xmlreader/php_xmlreader.c:1.36 --- php-src/ext/xmlreader/php_xmlreader.c:1.35 Fri Jul 21 00:57:14 2006 +++ php-src/ext/xmlreader/php_xmlreader.c Fri Jul 21 02:09:28 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_xmlreader.c,v 1.35 2006/07/21 00:57:14 rrichards Exp $ */ +/* $Id: php_xmlreader.c,v 1.36 2006/07/21 02:09:28 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -492,7 +492,7 @@ xmlFree(retchar); return; } else { - RETVAL_EMPTY_STRING(); + RETURN_EMPTY_TEXT(); } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php