[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard array.c /ext/standard/tests/array array_fill_keys.phpt
helly Sat Jul 15 12:14:07 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS /php-src/ext/standard array.c /php-src/ext/standard/tests/array array_fill_keys.phpt Log: - MFH array_fill_keys, better unicode support, use new param parsing API http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.121r2=1.2027.2.547.2.122diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.121 php-src/NEWS:1.2027.2.547.2.122 --- php-src/NEWS:1.2027.2.547.2.121 Sat Jul 15 10:21:09 2006 +++ php-src/NEWSSat Jul 15 12:14:07 2006 @@ -55,7 +55,7 @@ . Added readInnerXML(), readOuterXML(), readString(), setSchema(). (2.6.20+) . Changed to passing libxml options when loading reader. -- Added array_fill_keys(). (Marcus, Mathew W) +- Added array_fill_keys(). (Marcus, Matthew Wilmas) - Added posix_initgroups() function. (Ilia) - Added an optional parameter to parse_url() to allow retrieval of distinct URL components. (Ilia) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.308.2.21.2.3r2=1.308.2.21.2.4diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.308.2.21.2.3 php-src/ext/standard/array.c:1.308.2.21.2.4 --- php-src/ext/standard/array.c:1.308.2.21.2.3 Sat Jul 15 10:21:09 2006 +++ php-src/ext/standard/array.cSat Jul 15 12:14:07 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.308.2.21.2.3 2006/07/15 10:21:09 helly Exp $ */ +/* $Id: array.c,v 1.308.2.21.2.4 2006/07/15 12:14:07 helly Exp $ */ #include php.h #include php_ini.h @@ -1579,6 +1579,49 @@ } /* }}} */ +/* {{{ proto array array_fill_keys(array keys, mixed val) + Create an array using the elements of the first parameter as keys each initialized to val */ +PHP_FUNCTION(array_fill_keys) +{ + zval *keys, *val, **entry; + HashPosition pos; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, az, keys, val) == FAILURE) { + return; + } + + /* Initialize return array */ + array_init(return_value); + + zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(keys), pos); + while (zend_hash_get_current_data_ex(Z_ARRVAL_P(keys), (void **)entry, pos) == SUCCESS) { + + if (Z_TYPE_PP(entry) == IS_LONG) { + zval_add_ref(val); + zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(entry), val, sizeof(zval *), NULL); + } else { + zval key, *key_ptr = *entry; + + if (Z_TYPE_PP(entry) != IS_STRING) { + key = **entry; + zval_copy_ctor(key); + convert_to_string(key); + key_ptr = key; + } + + zval_add_ref(val); + zend_symtable_update(Z_ARRVAL_P(return_value), Z_STRVAL_P(key_ptr), Z_STRLEN_P(key_ptr) + 1, val, sizeof(zval *), NULL); + + if (key_ptr != *entry) { + zval_dtor(key); + } + } + + zend_hash_move_forward_ex(Z_ARRVAL_P(keys), pos); + } +} +/* }}} */ + /* {{{ proto array range(mixed low, mixed high[, int step]) Create an array containing the range of integers or characters from low to high (inclusive) */ PHP_FUNCTION(range) @@ -1720,57 +1763,6 @@ } /* }}} */ -/* {{{ proto array array_fill_keys(array keys, mixed val) - Create an array using the elements of the first parameter as keys each initialized to val */ -PHP_FUNCTION(array_fill_keys) -{ - zval **keys, **val, **entry; - HashPosition pos; - - if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, keys, val) == FAILURE) { - WRONG_PARAM_COUNT; - } - - if (Z_TYPE_PP(keys) != IS_ARRAY) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, First parameter must be an array); - RETURN_FALSE; - } - - /* Initialize return array */ - array_init(return_value); - - if (!zend_hash_num_elements(Z_ARRVAL_PP(keys))) { - return; - } - - if (PZVAL_IS_REF(*val)) { - SEPARATE_ZVAL(val); - } - - zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(keys), pos); - while (zend_hash_get_current_data_ex(Z_ARRVAL_PP(keys), (void **)entry, pos) == SUCCESS) { - zval_add_ref(val); - - if (Z_TYPE_PP(entry) == IS_STRING) { - zend_symtable_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(entry), Z_STRLEN_PP(entry) + 1, val, sizeof(zval *), NULL); - } else if (Z_TYPE_PP(entry) == IS_LONG) { - zend_hash_index_update(Z_ARRVAL_P(return_value), Z_LVAL_PP(entry), val, sizeof(zval *), NULL); - } else { -
[PHP-CVS] cvs: php-src /ext/standard array.c
helly Sat Jul 15 12:09:13 2006 UTC Modified files: /php-src/ext/standard array.c Log: - Readd proto http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.364r2=1.365diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.364 php-src/ext/standard/array.c:1.365 --- php-src/ext/standard/array.c:1.364 Sat Jul 15 12:06:10 2006 +++ php-src/ext/standard/array.cSat Jul 15 12:09:13 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.364 2006/07/15 12:06:10 helly Exp $ */ +/* $Id: array.c,v 1.365 2006/07/15 12:09:13 helly Exp $ */ #include php.h #include php_ini.h @@ -1646,6 +1646,8 @@ /* }}} */ +/* {{{ proto array array_fill_keys(array keys, mixed val) U + Create an array using the elements of the first parameter as keys each initialized to val */ PHP_FUNCTION(array_fill_keys) { zval *keys, *val, **entry; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl_directory.c /ext/spl/tests fileobject_003.phpt
helly Sat Jul 15 13:01:44 2006 UTC Modified files: /php-src/ext/splspl_directory.c /php-src/ext/spl/tests fileobject_003.phpt Log: - Fix issue with SplFileObject and directories http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.92r2=1.93diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.92 php-src/ext/spl/spl_directory.c:1.93 --- php-src/ext/spl/spl_directory.c:1.92Mon Jul 10 15:48:09 2006 +++ php-src/ext/spl/spl_directory.c Sat Jul 15 13:01:44 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.92 2006/07/10 15:48:09 dmitry Exp $ */ +/* $Id: spl_directory.c,v 1.93 2006/07/15 13:01:44 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -205,9 +205,9 @@ intern-u.file.context = php_stream_context_from_zval(intern-u.file.zcontext, 0); intern-u.file.stream = php_stream_open_wrapper_ex(intern-file_name, intern-u.file.open_mode, (use_include_path ? USE_PATH : 0) | REPORT_ERRORS, NULL, intern-u.file.context); - if (intern-u.file.stream == NULL) { + if (!intern-file_name_len || !intern-u.file.stream) { if (!EG(exception)) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, Cannot open file %s, intern-file_name); + zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, Cannot open file '%s', intern-file_name); } intern-file_name = NULL; /* until here it is not a copy */ intern-u.file.open_mode = NULL; @@ -218,6 +218,14 @@ zend_list_addref(Z_RESVAL_P(intern-u.file.zcontext)); } + if (intern-file_name[intern-file_name_len-1] == '/' +#if defined(PHP_WIN32) || defined(NETWARE) + ||intern-file_name[intern-file_name_len-1] == '\\' +#endif + ) { + intern-file_name_len--; + } + intern-file_name = estrndup(intern-file_name, intern-file_name_len); intern-u.file.open_mode = estrndup(intern-u.file.open_mode, intern-u.file.open_mode_len); http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_003.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/spl/tests/fileobject_003.phpt diff -u php-src/ext/spl/tests/fileobject_003.phpt:1.1 php-src/ext/spl/tests/fileobject_003.phpt:1.2 --- php-src/ext/spl/tests/fileobject_003.phpt:1.1 Sat Jul 8 11:43:07 2006 +++ php-src/ext/spl/tests/fileobject_003.phpt Sat Jul 15 13:01:44 2006 @@ -5,7 +5,7 @@ --FILE-- ?php -function test($name) +function test($name, $lc, $lp) { static $i = 0; echo ===$i===\n; @@ -19,10 +19,23 @@ var_dump($o === $c); var_dump($o == $c); var_dump($o-getPathname() == $c-getPathname()); + + $f = new SplFileObject($name); + var_dump($name); + var_dump($f-getPathName()); + $l = substr($f-getPathName(), -1); + var_dump($l != '/' $l != '\\' $l == $lc); + var_dump($f-getFileName()); + $l = substr($f-getFileName(), -1); + var_dump($l != '/' $l != '\\' $l == $lc); + var_dump($f-getPath()); + $l = substr($f-getPath(), -1); + var_dump($l != '/' $l != '\\' $l == $lp); } -test(dirname(__FILE__) . '/' . 'fileobject_001a.txt'); -test(dirname(__FILE__) . '/'); +test(dirname(__FILE__) . '/' . 'fileobject_001a.txt', 't', substr(dirname(__FILE__),-1)); +test(dirname(__FILE__) . '/', substr(dirname(__FILE__),-1), 'l'); +test(dirname(__FILE__), substr(dirname(__FILE__),-1), 'l'); ? ===DONE=== @@ -36,6 +49,13 @@ bool(false) bool(true) bool(true) +%s(%d) %sfileobject_001a.txt +string(%d) %sfileobject_001a.txt +bool(true) +string(%d) %sfileobject_001a.txt +bool(true) +string(%d) %stests +bool(true) ===1=== object(SplFileInfo)#%d (0) { } @@ -44,4 +64,26 @@ bool(false) bool(true) bool(true) +%s(%d) %stests/ +string(%d) %stests +bool(true) +string(%d) %stests +bool(true) +string(%d) %sspl +bool(true) +===2=== +object(SplFileInfo)#1 (0) { +} +object(SplFileInfo)#2 (0) { +} +bool(false) +bool(true) +bool(true) +%s(%d) %stests +string(%d) %stests +bool(true) +string(%d) %stests +bool(true) +string(%d) %sspl +bool(true) ===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/spl spl_directory.c /ext/spl/tests fileobject_003.phpt
helly Sat Jul 15 13:01:59 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/splspl_directory.c /php-src/ext/spl/tests fileobject_003.phpt Log: - MFH Fix issue with SplFileObject and directories http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.45.2.27.2.2r2=1.45.2.27.2.3diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.45.2.27.2.2 php-src/ext/spl/spl_directory.c:1.45.2.27.2.3 --- php-src/ext/spl/spl_directory.c:1.45.2.27.2.2 Mon Jul 10 15:47:58 2006 +++ php-src/ext/spl/spl_directory.c Sat Jul 15 13:01:59 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.45.2.27.2.2 2006/07/10 15:47:58 dmitry Exp $ */ +/* $Id: spl_directory.c,v 1.45.2.27.2.3 2006/07/15 13:01:59 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -205,9 +205,9 @@ intern-u.file.context = php_stream_context_from_zval(intern-u.file.zcontext, 0); intern-u.file.stream = php_stream_open_wrapper_ex(intern-file_name, intern-u.file.open_mode, (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL, intern-u.file.context); - if (intern-u.file.stream == NULL) { + if (!intern-file_name_len || !intern-u.file.stream) { if (!EG(exception)) { - zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, Cannot open file %s, intern-file_name); + zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, Cannot open file '%s', intern-file_name_len ? intern-file_name : ); } intern-file_name = NULL; /* until here it is not a copy */ intern-u.file.open_mode = NULL; @@ -218,6 +218,14 @@ zend_list_addref(Z_RESVAL_P(intern-u.file.zcontext)); } + if (intern-file_name[intern-file_name_len-1] == '/' +#if defined(PHP_WIN32) || defined(NETWARE) + ||intern-file_name[intern-file_name_len-1] == '\\' +#endif + ) { + intern-file_name_len--; + } + intern-file_name = estrndup(intern-file_name, intern-file_name_len); intern-u.file.open_mode = estrndup(intern-u.file.open_mode, intern-u.file.open_mode_len); http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_003.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/spl/tests/fileobject_003.phpt diff -u php-src/ext/spl/tests/fileobject_003.phpt:1.1.2.2 php-src/ext/spl/tests/fileobject_003.phpt:1.1.2.3 --- php-src/ext/spl/tests/fileobject_003.phpt:1.1.2.2 Sat Jul 8 12:25:57 2006 +++ php-src/ext/spl/tests/fileobject_003.phpt Sat Jul 15 13:01:59 2006 @@ -5,7 +5,7 @@ --FILE-- ?php -function test($name) +function test($name, $lc, $lp) { static $i = 0; echo ===$i===\n; @@ -19,10 +19,23 @@ var_dump($o === $c); var_dump($o == $c); var_dump($o-getPathname() == $c-getPathname()); + + $f = new SplFileObject($name); + var_dump($name); + var_dump($f-getPathName()); + $l = substr($f-getPathName(), -1); + var_dump($l != '/' $l != '\\' $l == $lc); + var_dump($f-getFileName()); + $l = substr($f-getFileName(), -1); + var_dump($l != '/' $l != '\\' $l == $lc); + var_dump($f-getPath()); + $l = substr($f-getPath(), -1); + var_dump($l != '/' $l != '\\' $l == $lp); } -test(dirname(__FILE__) . '/' . 'fileobject_001a.txt'); -test(dirname(__FILE__) . '/'); +test(dirname(__FILE__) . '/' . 'fileobject_001a.txt', 't', substr(dirname(__FILE__),-1)); +test(dirname(__FILE__) . '/', substr(dirname(__FILE__),-1), 'l'); +test(dirname(__FILE__), substr(dirname(__FILE__),-1), 'l'); ? ===DONE=== @@ -36,6 +49,13 @@ bool(false) bool(true) bool(true) +string(%d) %sfileobject_001a.txt +string(%d) %sfileobject_001a.txt +bool(true) +string(%d) %sfileobject_001a.txt +bool(true) +string(%d) %stests +bool(true) ===1=== object(SplFileInfo)#%d (0) { } @@ -44,4 +64,26 @@ bool(false) bool(true) bool(true) +string(%d) %stests/ +string(%d) %stests +bool(true) +string(%d) %stests +bool(true) +string(%d) %sspl +bool(true) +===2=== +object(SplFileInfo)#1 (0) { +} +object(SplFileInfo)#2 (0) { +} +bool(false) +bool(true) +bool(true) +string(%d) %stests +string(%d) %stests +bool(true) +string(%d) %stests +bool(true) +string(%d) %sspl +bool(true) ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl_directory.c
helly Sat Jul 15 14:50:38 2006 UTC Modified files: /php-src/ext/splspl_directory.c Log: - Implement todo: SplFileObject: ability to set the CSV separator per object, part 2 http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.94r2=1.95diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.94 php-src/ext/spl/spl_directory.c:1.95 --- php-src/ext/spl/spl_directory.c:1.94Sat Jul 15 14:31:51 2006 +++ php-src/ext/spl/spl_directory.c Sat Jul 15 14:50:38 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.94 2006/07/15 14:31:51 helly Exp $ */ +/* $Id: spl_directory.c,v 1.95 2006/07/15 14:50:38 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1826,6 +1826,60 @@ } /* }}} */ +/* {{{ proto void SplFileObject::setCsvControl([string delimiter = ',' [, string enclosure = '']]) + Set the delimiter and enclosure character used in fgetcsv */ +SPL_METHOD(SplFileObject, setCsvControl) +{ + spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + char delimiter = ',', enclosure = ''; + char *delim, *enclo; + int d_len, e_len; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, |ss, delim, d_len, enclo, e_len) == SUCCESS) { + switch(ZEND_NUM_ARGS()) + { + case 2: + if (e_len != 1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, enclosure must be a character); + RETURN_FALSE; + } + enclosure = enclo[0]; + /* no break */ + case 1: + if (d_len != 1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, delimiter must be a character); + RETURN_FALSE; + } + delimiter = delim[0]; + /* no break */ + case 0: + break; + } + intern-u.file.delimiter = delimiter; + intern-u.file.enclosure = enclosure; + } +} +/* }}} */ + +/* {{{ proto array SplFileObject::getCsvControl() + Get the delimiter and enclosure character used in fgetcsv */ +SPL_METHOD(SplFileObject, getCsvControl) +{ + spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + char delimiter[2], enclosure[2]; + + array_init(return_value); + + delimiter[0] = intern-u.file.delimiter; + delimiter[1] = '\0'; + enclosure[0] = intern-u.file.enclosure; + enclosure[1] = '\0'; + + add_next_index_ascii_string(return_value, delimiter, ZSTR_DUPLICATE); + add_next_index_ascii_string(return_value, enclosure, ZSTR_DUPLICATE); +} +/* }}} */ + /* {{{ proto bool SplFileObject::flock(int operation [, int wouldblock]) Portable file locking */ FileFunction(flock) @@ -2074,6 +2128,8 @@ SPL_ME(SplFileObject, valid, NULL, ZEND_ACC_PUBLIC) SPL_ME(SplFileObject, fgets, NULL, ZEND_ACC_PUBLIC) SPL_ME(SplFileObject, fgetcsv,arginfo_file_object_fgetcsv, ZEND_ACC_PUBLIC) + SPL_ME(SplFileObject, setCsvControl, arginfo_file_object_fgetcsv, ZEND_ACC_PUBLIC) + SPL_ME(SplFileObject, getCsvControl, NULL, ZEND_ACC_PUBLIC) SPL_ME(SplFileObject, flock, arginfo_file_object_flock, ZEND_ACC_PUBLIC) SPL_ME(SplFileObject, fflush, NULL, ZEND_ACC_PUBLIC) SPL_ME(SplFileObject, ftell, NULL, ZEND_ACC_PUBLIC) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl_directory.c
helly Sat Jul 15 14:54:57 2006 UTC Modified files: /php-src/ext/splspl_directory.c Log: - Be on the safe side http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_directory.c?r1=1.95r2=1.96diff_format=u Index: php-src/ext/spl/spl_directory.c diff -u php-src/ext/spl/spl_directory.c:1.95 php-src/ext/spl/spl_directory.c:1.96 --- php-src/ext/spl/spl_directory.c:1.95Sat Jul 15 14:50:38 2006 +++ php-src/ext/spl/spl_directory.c Sat Jul 15 14:54:57 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_directory.c,v 1.95 2006/07/15 14:50:38 helly Exp $ */ +/* $Id: spl_directory.c,v 1.96 2006/07/15 14:54:57 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1450,6 +1450,10 @@ size_t buf_len = intern-u.file.current_line_len; char *buf = estrndup(intern-u.file.current_line, buf_len); + if (Z_TYPE_P(return_value) != IS_NULL) { + zval_dtor(return_value); + ZVAL_NULL(return_value); + } php_fgetcsv(intern-u.file.stream, delimiter, enclosure, buf_len, buf, return_value TSRMLS_CC); } return ret; -- 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 splfileobject.inc
helly Sat Jul 15 15:04:52 2006 UTC Modified files: /php-src/ext/spl/internal splfileobject.inc Log: - Update docu http://cvs.php.net/viewvc.cgi/php-src/ext/spl/internal/splfileobject.inc?r1=1.3r2=1.4diff_format=u Index: php-src/ext/spl/internal/splfileobject.inc diff -u php-src/ext/spl/internal/splfileobject.inc:1.3 php-src/ext/spl/internal/splfileobject.inc:1.4 --- php-src/ext/spl/internal/splfileobject.inc:1.3 Tue Feb 21 23:21:53 2006 +++ php-src/ext/spl/internal/splfileobject.inc Sat Jul 15 15:04:52 2006 @@ -12,7 +12,7 @@ /** @ingroup SPL * @brief Object representation for any stream * @author Marcus Boerger - * @version 1.0 + * @version 1.1 * @since PHP 5.1 */ class SplFileObject extends SplFileInfo implements RecursiveIterator, SeekableIterator @@ -26,6 +26,8 @@ private $lnum = 0; private $max_len = 0; private $flags= 0; + private $delimiter= ','; + private $enclosure= ''; /** * Constructs a new file object @@ -80,14 +82,44 @@ * @param enclosure end of * @return array containing read data */ - function fgetcsv($delimiter = ';', $enclosure = '') + function fgetcsv($delimiter = NULL, $enclosure = NULL) { $this-freeLine(); $this-lnum++; + switch(fun_num_args()) + { + case 0: + $delimiter = $this-delimiter; + case 1: + $enclosure = $this-enclosure; + default: + case 2: + break; + } return fgetcsv($this-fp, $this-max_len, $delimiter, $enclosure); } /** +* Set the delimiter and enclosure character used in fgetcsv +* +* @param delimiter new delimiter, defaults to ',' +* @param enclosure new enclosure, defaults to '' +*/ + function setCsvControl($delimiter = ';', $enclosure = '') + { + $this-delimiter = $delimiter; + $this-enclosure = $enclosure; + } + + /** +* @return array(delimiter, enclosure) as used in fgetcsv +*/ + function getCsvControl($delimiter = ',', $enclosure = '') + { + return array($this-delimiter, $this-enclosure); + } + + /** * @param operation lock operation (LOCK_SH, LOCK_EX, LOCK_UN, LOCK_NB) * @retval $wouldblock whether the operation would block */ -- 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) / README.PARAMETER_PARSING_API
helly Wed Jul 12 07:34:28 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcREADME.PARAMETER_PARSING_API Log: - Reorder and add missing http://cvs.php.net/viewvc.cgi/php-src/README.PARAMETER_PARSING_API?r1=1.7r2=1.7.6.1diff_format=u Index: php-src/README.PARAMETER_PARSING_API diff -u php-src/README.PARAMETER_PARSING_API:1.7 php-src/README.PARAMETER_PARSING_API:1.7.6.1 --- php-src/README.PARAMETER_PARSING_API:1.7Fri Jan 3 10:39:22 2003 +++ php-src/README.PARAMETER_PARSING_APIWed Jul 12 07:34:28 2006 @@ -31,14 +31,17 @@ Type specifiers --- - l - long - d - double - s - string (with possible null bytes) and its length - b - boolean, stored in zend_bool - r - resource (stored in zval) a - array + b - boolean, stored in zend_bool + d - double + f - function or array containing php method call info (returned as + zend_fcall_info* and zend_fcall_info_cache*) + h - array (returned as HashTable*) + l - long o - object (of any type) O - object (of specific type, specified by class entry) + r - resource (stored in zval) + s - string (with possible null bytes) and its length z - the actual zval The following characters also have a meaning in the specifier string: -- 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
helly Wed Jul 12 07:31:56 2006 UTC Modified files: /php-srcREADME.PARAMETER_PARSING_API Log: - Reorder and add missing http://cvs.php.net/viewvc.cgi/php-src/README.PARAMETER_PARSING_API?r1=1.11r2=1.12diff_format=u Index: php-src/README.PARAMETER_PARSING_API diff -u php-src/README.PARAMETER_PARSING_API:1.11 php-src/README.PARAMETER_PARSING_API:1.12 --- php-src/README.PARAMETER_PARSING_API:1.11 Tue Jul 11 23:05:47 2006 +++ php-src/README.PARAMETER_PARSING_APIWed Jul 12 07:31:56 2006 @@ -38,23 +38,25 @@ has to be provided on input and is used to verify the PHP parameter is an instance of that class. - l - long (long) + a - array (zval*) + b - boolean (zend_bool) + C - class (zend_class_entry*) d - double (double) + f - function or array containing php method call info (returned as + zend_fcall_info* and zend_fcall_info_cache*) + h - array (returned as HashTable*) + l - long (long) + o - object of any type (zval*) + O - object of specific type given by class entry (zval*, zend_class_entry) + r - resource (zval*) s - string (with possible null bytes) and its length (char*, int) - u - Unicode (UChar*, int) + S - binary string, does not allow conversion from Unicode strings t - text (void * (char*/Uchar*), int (length), zend_uchar (IS_STRING/..)) accepts either Unicode or binary string T - text (void * (char*/Uchar*), int (length), zend_uchar (IS_STRING/..)) coalesces all T parameters to common type (Unicode or binary) - U - Unicode string, does not allow conversion from binary strings - S - binary string, does not allow conversion from Unicode strings - b - boolean (zend_bool) - r - resource (zval*) - a - array (zval*) - h - array (returned as HashTable*) - o - object of any type (zval*) - O - object of specific type given by class entry (zval*, zend_class_entry) - C - class (zend_class_entry*) + u - unicode (UChar*, int) + U - Unicode string, does not allow conversion from binary strings z - the actual zval (zval*) Z - the actual zval (zval**) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: CVSROOT / avail
helly Tue Jul 11 20:27:11 2006 UTC Modified files: /CVSROOTavail Log: - pecl/aspect will become pear/aspect (if agreed) http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1158r2=1.1159diff_format=u Index: CVSROOT/avail diff -u CVSROOT/avail:1.1158 CVSROOT/avail:1.1159 --- CVSROOT/avail:1.1158Mon Jul 10 19:45:51 2006 +++ CVSROOT/avail Tue Jul 11 20:27:11 2006 @@ -335,7 +335,7 @@ avail|lukasfeiler|peardoc,pear/XML_Query2XML avail|nrf|pear/MDB2,peardoc avail|bmuskalla|pear/XML_DB_eXist,peardoc -avail|wcandillon|pecl/aspect,pecl/parse_tree +avail|wcandillon|pecl/parse_tree avail|akalend|pecl/xmlsec avail|mb|pecl/stime avail|hugoki|peardoc,pear/Structures_BibTex -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl php_spl.c /ext/spl/tests spl_005.phpt
helly Sun Jul 9 10:22:03 2006 UTC Added files: /php-src/ext/spl/tests spl_005.phpt Modified files: /php-src/ext/splphp_spl.c Log: - Add spl_object_hash() http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.94r2=1.95diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.94 php-src/ext/spl/php_spl.c:1.95 --- php-src/ext/spl/php_spl.c:1.94 Tue Jun 13 13:12:19 2006 +++ php-src/ext/spl/php_spl.c Sun Jul 9 10:22:03 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.94 2006/06/13 13:12:19 dmitry Exp $ */ +/* $Id: php_spl.c,v 1.95 2006/07/09 10:22:03 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -36,6 +36,7 @@ #include spl_observer.h #include zend_exceptions.h #include zend_interfaces.h +#include ext/standard/md5.h #ifdef COMPILE_DL_SPL ZEND_GET_MODULE(spl) @@ -577,6 +578,32 @@ add_next_index_text(return_value, EG(autoload_func)-common.function_name, 1); } /* }}} */ +/* {{{ proto string spl_object_hash(object obj) + Return hash id for given object */ +PHP_FUNCTION(spl_object_hash) +{ + zval *obj; + int len; + char *hash; + char md5str[33]; + PHP_MD5_CTX context; + unsigned char digest[16]; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o, obj) == FAILURE) { + return; + } + + len = spprintf(hash, 0, %p:%d, Z_OBJ_HT_P(obj), Z_OBJ_HANDLE_P(obj)); + + md5str[0] = '\0'; + PHP_MD5Init(context); + PHP_MD5Update(context, (unsigned char*)hash, len); + PHP_MD5Final(digest, context); + make_digest(md5str, digest); + RETVAL_STRING(md5str, 1); + efree(hash); +} + int spl_build_class_list_string(zval **entry, char **list TSRMLS_DC) /* {{{ */ { char *res; @@ -643,6 +670,7 @@ PHP_FE(spl_autoload_call, NULL) PHP_FE(class_parents, NULL) PHP_FE(class_implements,NULL) + PHP_FE(spl_object_hash, NULL) #ifdef SPL_ITERATORS_H PHP_FE(iterator_to_array, arginfo_iterator) PHP_FE(iterator_count, arginfo_iterator) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_005.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/spl_005.phpt +++ php-src/ext/spl/tests/spl_005.phpt --TEST-- SPL: spl_object_hash() --SKIPIF-- ?php if (!extension_loaded(spl)) print skip; ? --FILE-- ?php var_dump(spl_object_hash(new stdClass)); var_dump(spl_object_hash(42)); var_dump(spl_object_hash()); ? ===DONE=== ?php exit(0); ? --EXPECTF-- string(32) %s Warning: spl_object_hash() expects parameter 1 to be object, integer given in %sspl_005.php on line %d NULL Warning: spl_object_hash() expects exactly 1 parameter, 0 given in %sspl_005.php on line %d 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/spl php_spl.c /ext/spl/tests spl_005.phpt
helly Sun Jul 9 10:22:27 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/spl/tests spl_005.phpt Modified files: /php-src/ext/splphp_spl.c Log: - MFH Add spl_object_hash() http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.3r2=1.52.2.28.2.4diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.3 php-src/ext/spl/php_spl.c:1.52.2.28.2.4 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.3 Thu Jun 15 18:33:08 2006 +++ php-src/ext/spl/php_spl.c Sun Jul 9 10:22:27 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.3 2006/06/15 18:33:08 dmitry Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.4 2006/07/09 10:22:27 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -36,6 +36,7 @@ #include spl_observer.h #include zend_exceptions.h #include zend_interfaces.h +#include ext/standard/md5.h #ifdef COMPILE_DL_SPL ZEND_GET_MODULE(spl) @@ -566,6 +567,32 @@ add_next_index_string(return_value, EG(autoload_func)-common.function_name, 1); } /* }}} */ +/* {{{ proto string spl_object_hash(object obj) + Return hash id for given object */ +PHP_FUNCTION(spl_object_hash) +{ + zval *obj; + int len; + char *hash; + char md5str[33]; + PHP_MD5_CTX context; + unsigned char digest[16]; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o, obj) == FAILURE) { + return; + } + + len = spprintf(hash, 0, %p:%d, Z_OBJ_HT_P(obj), Z_OBJ_HANDLE_P(obj)); + + md5str[0] = '\0'; + PHP_MD5Init(context); + PHP_MD5Update(context, (unsigned char*)hash, len); + PHP_MD5Final(digest, context); + make_digest(md5str, digest); + RETVAL_STRING(md5str, 1); + efree(hash); +} + int spl_build_class_list_string(zval **entry, char **list TSRMLS_DC) /* {{{ */ { char *res; @@ -632,6 +659,7 @@ PHP_FE(spl_autoload_call, NULL) PHP_FE(class_parents, NULL) PHP_FE(class_implements,NULL) + PHP_FE(spl_object_hash, NULL) #ifdef SPL_ITERATORS_H PHP_FE(iterator_to_array, arginfo_iterator) PHP_FE(iterator_count, arginfo_iterator) http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/spl_005.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/spl_005.phpt +++ php-src/ext/spl/tests/spl_005.phpt --TEST-- SPL: spl_object_hash() --SKIPIF-- ?php if (!extension_loaded(spl)) print skip; ? --FILE-- ?php var_dump(spl_object_hash(new stdClass)); var_dump(spl_object_hash(42)); var_dump(spl_object_hash()); ? ===DONE=== ?php exit(0); ? --EXPECTF-- string(32) %s Warning: spl_object_hash() expects parameter 1 to be object, integer given in %sspl_005.php on line %d NULL Warning: spl_object_hash() expects exactly 1 parameter, 0 given in %sspl_005.php on line %d 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/spl/examples dualiterator.inc recursivedualiterator.inc /ext/spl/examples/tests dualiterator_001.phpt
helly Sun Jul 9 10:24:32 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/spl/examples dualiterator.inc recursivedualiterator.inc /php-src/ext/spl/examples/tests dualiterator_001.phpt Log: - MFH DualIterator http://cvs.php.net/viewvc.cgi/php-src/ext/spl/examples/dualiterator.inc?view=markuprev=1.1 Index: php-src/ext/spl/examples/dualiterator.inc +++ php-src/ext/spl/examples/dualiterator.inc ?php /** @file DualIterator.inc * @ingroup Examples * @brief class DualIterator * @author Marcus Boerger * @date2003 - 2006 * * SPL - Standard PHP Library */ /** @ingroup Examples * @brief Synchronous iteration over two iterators * @author Marcus Boerger * @version 1.1 */ class DualIterator implements Iterator { const CURRENT_LHS = 0x01; const CURRENT_RHS = 0x02; const CURRENT_ARRAY = 0x03; const CURRENT_0 = 0x00; const KEY_LHS = 0x10; const KEY_RHS = 0x20; const KEY_ARRAY = 0x30; const KEY_0 = 0x00; const DEFAULT_FLAGS = 0x33; private $lhs; private $rhs; private $flags; /** construct iterator from two iterators * * @param lhs Left Hand Side Iterator * @param rhs Right Hand Side Iterator * @param flags iteration flags */ function __construct(Iterator $lhs, Iterator $rhs, $flags = 0x33 /*DualIterator::DEFAULT_FLAGS*/) { $this-lhs = $lhs; $this-rhs = $rhs; $this-flags = $flags; } /** @return Left Hand Side Iterator */ function getLHS() { return $this-lhs; } /** @return Right Hand Side Iterator */ function getRHS() { return $this-rhs; } /** @param flags new flags */ function setFlags($flags) { $this-flags = $flags; } /** @return current flags */ function getFlags() { return $this-flags; } /** rewind both inner iterators */ function rewind() { $this-lhs-rewind(); $this-rhs-rewind(); } /** @return whether both inner iterators are valid */ function valid() { return $this-lhs-valid() $this-rhs-valid(); } /** @return current value depending on CURRENT_* flags */ function current() { switch($this-flags 0x0F) { default: case self::CURRENT_ARRAY: return array($this-lhs-current(), $this-rhs-current()); case self::CURRENT_LHS: return $this-lhs-current(); case self::CURRENT_RHS: return $this-rhs-current(); case self::CURRENT_0: return NULL; } } /** @return current value depending on KEY_* flags */ function key() { switch($this-flags 0xF0) { default: case self::CURRENT_ARRAY: return array($this-lhs-key(), $this-rhs-key()); case self::CURRENT_LHS: return $this-lhs-key(); case self::CURRENT_RHS: return $this-rhs-key(); case self::CURRENT_0: return NULL; } } /** move both inner iterators forward */ function next() { $this-lhs-next(); $this-rhs-next(); } /** @return whether both inner iterators are valid and have identical * current and key values or both are non valid. */ function areIdentical() { return $this-valid() ? $this-lhs-current() === $this-rhs-current() $this-lhs-key() === $this-rhs-key() : $this-lhs-valid() == $this-rhs-valid(); } /** @return whether both inner iterators are valid and have equal current * and key values or both are non valid. */ function areEqual() { return $this-valid() ? $this-lhs-current() == $this-rhs-current() $this-lhs-key() == $this-rhs-key() : $this-lhs-valid() == $this-rhs-valid(); } /** Compare two iterators * * @param lhs Left Hand Side Iterator * @param rhs Right Hand
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS
helly Sun Jul 9 17:53:55 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS Log: - BFN http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.107r2=1.2027.2.547.2.108diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.107 php-src/NEWS:1.2027.2.547.2.108 --- php-src/NEWS:1.2027.2.547.2.107 Wed Jul 5 11:49:37 2006 +++ php-src/NEWSSun Jul 9 17:53:55 2006 @@ -92,6 +92,7 @@ - Fixed bug #37862 (Integer pointer comparison to numeric value). (bugs-php at thewrittenword dot com) - Fixed bug #37807 (segmentation fault during SOAP schema import). (Tony) +- Fixed bug #37806 (weird behavior of object type and comparison). (Marcus) - Fixed bug #37780 (memory leak trying to execute a non existing file (CLI)). (Mike) - Fixed bug #37747 (strtotime segfaults when given nextyear). (Derick) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS
helly Sun Jul 9 17:58:39 2006 UTC Modified files: /php-srcNEWS Log: - Entry doesn't belong here, fixed in 5.2 http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2120r2=1.2121diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2120 php-src/NEWS:1.2121 --- php-src/NEWS:1.2120 Sun Jun 25 23:21:24 2006 +++ php-src/NEWSSun Jul 9 17:58:39 2006 @@ -6,8 +6,6 @@ - Changed dl() to be disabled by default. Enabled only when explicitly registered by the SAPI layer. Enabled only with CLI, CGI and EMBED. (Dmitry) - Changed return new by reference to throw an E_STRICT error. (Dmitry) -- Changed __toString() behavior to call it in all necessary places - (Marcus, Dmitry) - Changed instanceof and catch operators, is_a() and is_subclass_of() functions to not call __autoload(). (Dmitry) -- 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
helly Sun Jul 9 22:45:32 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS Log: - BFN http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.108r2=1.2027.2.547.2.109diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.108 php-src/NEWS:1.2027.2.547.2.109 --- php-src/NEWS:1.2027.2.547.2.108 Sun Jul 9 17:53:55 2006 +++ php-src/NEWSSun Jul 9 22:45:32 2006 @@ -91,6 +91,7 @@ - Fixed bug #37864 (file_get_contents() leaks on empty file). (Hannes) - Fixed bug #37862 (Integer pointer comparison to numeric value). (bugs-php at thewrittenword dot com) +- Fixed bug #37811 (define not using toString on objects). (Marcus) - Fixed bug #37807 (segmentation fault during SOAP schema import). (Tony) - Fixed bug #37806 (weird behavior of object type and comparison). (Marcus) - Fixed bug #37780 (memory leak trying to execute a non existing file (CLI)). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / EXTENSIONS
helly Sun Jul 9 22:48:23 2006 UTC Modified files: /php-srcEXTENSIONS Log: - It appears i am the maintainer http://cvs.php.net/viewvc.cgi/php-src/EXTENSIONS?r1=1.74r2=1.75diff_format=u Index: php-src/EXTENSIONS diff -u php-src/EXTENSIONS:1.74 php-src/EXTENSIONS:1.75 --- php-src/EXTENSIONS:1.74 Mon Jan 23 18:08:05 2006 +++ php-src/EXTENSIONS Sun Jul 9 22:48:22 2006 @@ -229,7 +229,7 @@ SINCE: 5.0 --- EXTENSION: simplexml -PRIMARY MAINTAINER: Sterling Hughes [EMAIL PROTECTED] +PRIMARY MAINTAINER: Marcus Boerger [EMAIL PROTECTED] MAINTENANCE: Maintained STATUS: Working SINCE: 5.0 -- 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) / EXTENSIONS
helly Sun Jul 9 22:49:16 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcEXTENSIONS Log: - MFH It appears i am the maintainer http://cvs.php.net/viewvc.cgi/php-src/EXTENSIONS?r1=1.72.2.4r2=1.72.2.4.2.1diff_format=u Index: php-src/EXTENSIONS diff -u php-src/EXTENSIONS:1.72.2.4 php-src/EXTENSIONS:1.72.2.4.2.1 --- php-src/EXTENSIONS:1.72.2.4 Mon Jan 23 18:07:40 2006 +++ php-src/EXTENSIONS Sun Jul 9 22:49:16 2006 @@ -229,7 +229,7 @@ SINCE: 5.0 --- EXTENSION: simplexml -PRIMARY MAINTAINER: Sterling Hughes [EMAIL PROTECTED] +PRIMARY MAINTAINER: Marcus Boerger [EMAIL PROTECTED] MAINTENANCE: Maintained STATUS: Working SINCE: 5.0 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / EXTENSIONS
helly Sun Jul 9 22:57:54 2006 UTC Modified files: /php-srcEXTENSIONS Log: - Add missing entry http://cvs.php.net/viewvc.cgi/php-src/EXTENSIONS?r1=1.75r2=1.76diff_format=u Index: php-src/EXTENSIONS diff -u php-src/EXTENSIONS:1.75 php-src/EXTENSIONS:1.76 --- php-src/EXTENSIONS:1.75 Sun Jul 9 22:48:22 2006 +++ php-src/EXTENSIONS Sun Jul 9 22:57:54 2006 @@ -464,6 +464,11 @@ MAINTENANCE: Maintained STATUS: Working --- +EXTENSION: reflection +PRIMARY MAINTAINER: Marcus Börger [EMAIL PROTECTED], Johannes Schlüter [EMAIL PROTECTED] +MAINTENANCE: Maintained +STATUS: Working +--- EXTENSION: session PRIMARY MAINTAINER: Sascha Schumann [EMAIL PROTECTED], Ilia Alshanetsky [EMAIL PROTECTED] MAINTENANCE: Maintained -- 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) / EXTENSIONS
helly Sun Jul 9 22:58:36 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcEXTENSIONS Log: - Add new entry http://cvs.php.net/viewvc.cgi/php-src/EXTENSIONS?r1=1.72.2.4.2.1r2=1.72.2.4.2.2diff_format=u Index: php-src/EXTENSIONS diff -u php-src/EXTENSIONS:1.72.2.4.2.1 php-src/EXTENSIONS:1.72.2.4.2.2 --- php-src/EXTENSIONS:1.72.2.4.2.1 Sun Jul 9 22:49:16 2006 +++ php-src/EXTENSIONS Sun Jul 9 22:58:36 2006 @@ -464,6 +464,11 @@ MAINTENANCE: Maintained STATUS: Working --- +EXTENSION: reflection +PRIMARY MAINTAINER: Marcus Börger [EMAIL PROTECTED], Johannes Schlüter [EMAIL PROTECTED] +MAINTENANCE: Maintained +STATUS: Working +--- EXTENSION: session PRIMARY MAINTAINER: Sascha Schumann [EMAIL PROTECTED], Ilia Alshanetsky [EMAIL PROTECTED] MAINTENANCE: Maintained -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c
helly Sun Jul 9 23:28:59 2006 UTC Modified files: /php-src/ext/reflection php_reflection.c Log: - Fix logic http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.240r2=1.241diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.240 php-src/ext/reflection/php_reflection.c:1.241 --- php-src/ext/reflection/php_reflection.c:1.240 Fri Jul 7 11:53:54 2006 +++ php-src/ext/reflection/php_reflection.c Sun Jul 9 23:28:59 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.240 2006/07/07 11:53:54 bjori Exp $ */ +/* $Id: php_reflection.c,v 1.241 2006/07/09 23:28:59 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3960,7 +3960,7 @@ METHOD_NOTSTATIC(reflection_property_ptr); GET_REFLECTION_OBJECT_PTR(ref); - if (ref-prop-flags ~(ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)) { + if (!(ref-prop-flags ZEND_ACC_PUBLIC)) { _DO_THROW(Cannot access non-public member); /* Returns from this function */ } @@ -4832,7 +4832,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.240 2006/07/07 11:53:54 bjori Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.241 2006/07/09 23:28:59 helly Exp $); php_info_print_table_end(); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/reflection php_reflection.c
helly Sun Jul 9 23:30:19 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/reflection php_reflection.c Log: - MFH Fix logic http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.11r2=1.164.2.33.2.12diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.11 php-src/ext/reflection/php_reflection.c:1.164.2.33.2.12 --- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.11 Fri Jul 7 11:55:23 2006 +++ php-src/ext/reflection/php_reflection.c Sun Jul 9 23:30:19 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.164.2.33.2.11 2006/07/07 11:55:23 bjori Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.33.2.12 2006/07/09 23:30:19 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3889,7 +3889,7 @@ METHOD_NOTSTATIC(reflection_property_ptr); GET_REFLECTION_OBJECT_PTR(ref); - if (ref-prop-flags ~(ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)) { + if (!(ref-prop-flags ZEND_ACC_PUBLIC)) { _DO_THROW(Cannot access non-public member); /* Returns from this function */ } @@ -4764,7 +4764,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.164.2.33.2.11 2006/07/07 11:55:23 bjori Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.164.2.33.2.12 2006/07/09 23:30:19 helly Exp $); php_info_print_table_end(); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/reflection php_reflection.c /ext/reflection/tests bug37816.phpt
helly Mon Jul 10 00:18:53 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/reflection/tests bug37816.phpt Modified files: /php-srcNEWS /php-src/ext/reflection php_reflection.c Log: - MFH Fixed bug #37816 (ReflectionProperty does not throw exception when accessing protected attribute) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.109r2=1.2027.2.547.2.110diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.109 php-src/NEWS:1.2027.2.547.2.110 --- php-src/NEWS:1.2027.2.547.2.109 Sun Jul 9 22:45:32 2006 +++ php-src/NEWSMon Jul 10 00:18:53 2006 @@ -91,6 +91,8 @@ - Fixed bug #37864 (file_get_contents() leaks on empty file). (Hannes) - Fixed bug #37862 (Integer pointer comparison to numeric value). (bugs-php at thewrittenword dot com) +- Fixed bug #37816 (ReflectionProperty does not throw exception when accessing + protected attribute). (Marcus) - Fixed bug #37811 (define not using toString on objects). (Marcus) - Fixed bug #37807 (segmentation fault during SOAP schema import). (Tony) - Fixed bug #37806 (weird behavior of object type and comparison). (Marcus) http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.12r2=1.164.2.33.2.13diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.12 php-src/ext/reflection/php_reflection.c:1.164.2.33.2.13 --- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.12 Sun Jul 9 23:30:19 2006 +++ php-src/ext/reflection/php_reflection.c Mon Jul 10 00:18:53 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.164.2.33.2.12 2006/07/09 23:30:19 helly Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.33.2.13 2006/07/10 00:18:53 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3838,23 +3838,24 @@ { reflection_object *intern; property_reference *ref; - zval *object; + zval *object, name; zval **member= NULL; METHOD_NOTSTATIC(reflection_property_ptr); GET_REFLECTION_OBJECT_PTR(ref); -#if MBO_0 if (!(ref-prop-flags ZEND_ACC_PUBLIC)) { - _DO_THROW(Cannot access non-public member); - /* Returns from this function */ + _default_get_entry(getThis(), name, sizeof(name), name TSRMLS_CC); + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, + Cannot access non-public member %s::%s, intern-ce-name, Z_STRVAL(name)); + zval_dtor(name); + return; } -#endif if ((ref-prop-flags ZEND_ACC_STATIC)) { zend_update_class_constants(intern-ce TSRMLS_CC); if (zend_hash_quick_find(CE_STATIC_MEMBERS(intern-ce), ref-prop-name, ref-prop-name_length + 1, ref-prop-h, (void **) member) == FAILURE) { - zend_error(E_ERROR, Internal error: Could not find the property %s, ref-prop-name); + zend_error(E_ERROR, Internal error: Could not find the property %s::%s, intern-ce-name, ref-prop-name); /* Bails out */ } } else { @@ -3862,7 +3863,7 @@ return; } if (zend_hash_quick_find(Z_OBJPROP_P(object), ref-prop-name, ref-prop-name_length + 1, ref-prop-h, (void **) member) == FAILURE) { - zend_error(E_ERROR, Internal error: Could not find the property %s, ref-prop-name); + zend_error(E_ERROR, Internal error: Could not find the property %s::%s, intern-ce-name, ref-prop-name); /* Bails out */ } } @@ -3880,7 +3881,7 @@ reflection_object *intern; property_reference *ref; zval **variable_ptr; - zval *object; + zval *object, name; zval *value; int setter_done = 0; zval *tmp; @@ -3890,8 +3891,11 @@ GET_REFLECTION_OBJECT_PTR(ref); if (!(ref-prop-flags ZEND_ACC_PUBLIC)) { - _DO_THROW(Cannot access non-public member); - /* Returns from this function */ + _default_get_entry(getThis(), name, sizeof(name), name TSRMLS_CC); + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, + Cannot access non-public member %s::%s, intern-ce-name, Z_STRVAL(name)); + zval_dtor(name); + return; } if ((ref-prop-flags ZEND_ACC_STATIC)) { @@ -3910,7 +3914,7 @@ } if (zend_hash_quick_find(prop_table, ref-prop-name, ref-prop-name_length + 1, ref-prop-h, (void **) variable_ptr) == FAILURE) { - zend_error(E_ERROR, Internal error: Could not find the property %s, ref-prop-name); +
[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c /ext/reflection/tests bug37816.phpt
helly Mon Jul 10 00:13:50 2006 UTC Added files: /php-src/ext/reflection/tests bug37816.phpt Modified files: /php-src/ext/reflection php_reflection.c Log: - Fix bug #37816 ReflectionProperty does not throw exception when accessing protected attribute http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.241r2=1.242diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.241 php-src/ext/reflection/php_reflection.c:1.242 --- php-src/ext/reflection/php_reflection.c:1.241 Sun Jul 9 23:28:59 2006 +++ php-src/ext/reflection/php_reflection.c Mon Jul 10 00:13:50 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.241 2006/07/09 23:28:59 helly Exp $ */ +/* $Id: php_reflection.c,v 1.242 2006/07/10 00:13:50 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3907,24 +3907,25 @@ { reflection_object *intern; property_reference *ref; - zval *object; + zval *object, name; zval **member= NULL; zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING; METHOD_NOTSTATIC(reflection_property_ptr); GET_REFLECTION_OBJECT_PTR(ref); -#if MBO_0 if (!(ref-prop-flags ZEND_ACC_PUBLIC)) { - _DO_THROW(Cannot access non-public member); - /* Returns from this function */ + _default_get_entry(getThis(), name, sizeof(name), name TSRMLS_CC); + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, + Cannot access non-public member %v::%v, intern-ce-name, Z_UNIVAL(name)); + zval_dtor(name); + return; } -#endif if ((ref-prop-flags ZEND_ACC_STATIC)) { zend_update_class_constants(intern-ce TSRMLS_CC); if (zend_u_hash_quick_find(CE_STATIC_MEMBERS(intern-ce), utype, ref-prop-name, ref-prop-name_length + 1, ref-prop-h, (void **) member) == FAILURE) { - zend_error(E_ERROR, Internal error: Could not find the property %v, ref-prop-name); + zend_error(E_ERROR, Internal error: Could not find the property %v::%v, intern-ce-name, ref-prop-name); /* Bails out */ } } else { @@ -3932,7 +3933,7 @@ return; } if (zend_u_hash_quick_find(Z_OBJPROP_P(object), utype, ref-prop-name, ref-prop-name_length + 1, ref-prop-h, (void **) member) == FAILURE) { - zend_error(E_ERROR, Internal error: Could not find the property %v, ref-prop-name); + zend_error(E_ERROR, Internal error: Could not find the property %v::%v, intern-ce-name, ref-prop-name); /* Bails out */ } } @@ -3950,7 +3951,7 @@ reflection_object *intern; property_reference *ref; zval **variable_ptr; - zval *object; + zval *object, name; zval *value; int setter_done = 0; zval *tmp; @@ -3961,8 +3962,11 @@ GET_REFLECTION_OBJECT_PTR(ref); if (!(ref-prop-flags ZEND_ACC_PUBLIC)) { - _DO_THROW(Cannot access non-public member); - /* Returns from this function */ + _default_get_entry(getThis(), name, sizeof(name), name TSRMLS_CC); + zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, + Cannot access non-public member %v::%v, intern-ce-name, Z_UNIVAL(name)); + zval_dtor(name); + return; } if ((ref-prop-flags ZEND_ACC_STATIC)) { @@ -3981,7 +3985,7 @@ } if (zend_u_hash_quick_find(prop_table, utype, ref-prop-name, ref-prop-name_length + 1, ref-prop-h, (void **) variable_ptr) == FAILURE) { - zend_error(E_ERROR, Internal error: Could not find the property %v, ref-prop-name); + zend_error(E_ERROR, Internal error: Could not find the property %v::%v, intern-ce-name, ref-prop-name); /* Bails out */ } if (*variable_ptr == value) { @@ -4832,7 +4836,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.241 2006/07/09 23:28:59 helly Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.242 2006/07/10 00:13:50 helly Exp $); php_info_print_table_end(); } /* }}} */ http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/tests/bug37816.phpt?view=markuprev=1.1 Index: php-src/ext/reflection/tests/bug37816.phpt +++ php-src/ext/reflection/tests/bug37816.phpt --TEST-- Bug #37816 (ReflectionProperty does not throw exception when accessing protected attribute) --FILE--
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS
helly Mon Jul 10 00:36:47 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS Log: - BFN http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.110r2=1.2027.2.547.2.111diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.110 php-src/NEWS:1.2027.2.547.2.111 --- php-src/NEWS:1.2027.2.547.2.110 Mon Jul 10 00:18:53 2006 +++ php-src/NEWSMon Jul 10 00:36:47 2006 @@ -105,6 +105,7 @@ - Fixed bug #37707 (clone without assigning leaks memory). (Ilia, Nuno, Dmitri) - Fixed bug #37705 (Semaphore constants not available). (Ilia) - Fixed bug #37671 (MySQLi extension fails to recognize BIT column). (Ilia) +- Fixed bug #37667 (Object is not added into array returned by __get). (Marcus) - Fixed bug #37635 (parameter of pcntl signal handler is trashed). (Mike) - Fixed bug #37632 (Protected method access problem). (Marcus) - Fixed bug #37630 (MySQL extensions should link against thread safe client -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl/tests fileobject_003.phpt
helly Sat Jul 8 11:43:07 2006 UTC Added files: /php-src/ext/spl/tests fileobject_003.phpt Log: - Add new test http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/fileobject_003.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/fileobject_003.phpt +++ php-src/ext/spl/tests/fileobject_003.phpt --TEST-- SPL: SplFileInfo cloning --SKIPIF-- ?php if (!extension_loaded(spl)) print skip; ? --FILE-- ?php function test($name) { static $i = 0; echo ===$i===\n; $i++; $o = new SplFileInfo($name); var_dump($o); $c = clone $o; var_dump($c); var_dump($o === $c); var_dump($o == $c); var_dump($o-getPathname() == $c-getPathname()); } test(dirname(__FILE__) . '/' . 'fileobject_001a.txt'); test(dirname(__FILE__) . '/'); ? ===DONE=== ?php exit(0); ? --EXPECTF-- ===0=== object(SplFileInfo)#%d (0) { } object(SplFileInfo)#%d (0) { } bool(false) bool(true) bool(true) ===1=== object(SplFileInfo)#%d (0) { } object(SplFileInfo)#%d (0) { } bool(false) bool(true) bool(true) ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c
helly Sat Jun 24 18:53:51 2006 UTC Modified files: /php-src/ext/reflection php_reflection.c Log: - Fix ReflectionObject::getProperties() + dyn properties http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.236r2=1.237diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.236 php-src/ext/reflection/php_reflection.c:1.237 --- php-src/ext/reflection/php_reflection.c:1.236 Sun Jun 11 23:46:53 2006 +++ php-src/ext/reflection/php_reflection.c Sat Jun 24 18:53:51 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.236 2006/06/11 23:46:53 bjori Exp $ */ +/* $Id: php_reflection.c,v 1.237 2006/06/24 18:53:51 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3106,6 +3106,34 @@ } /* }}} */ +/* {{{ _adddynproperty */ +static int _adddynproperty(zval **pptr, int num_args, va_list args, zend_hash_key *hash_key) +{ + zval *property; + zend_class_entry *ce = *va_arg(args, zend_class_entry**); + zval *retval = va_arg(args, zval*), member; + TSRMLS_FETCH(); + + if (hash_key-type == IS_UNICODE) { + if (hash_key-arKey.u[0] == 0) { + return 0; /* non public cannot be dynamic */ + } + ZVAL_UNICODEL(member, hash_key-arKey.u, hash_key-nKeyLength-1, 0); + } else { + if (hash_key-arKey.s[0] == '\0') { + return 0; /* non public cannot be dynamic */ + } + ZVAL_STRINGL(member, hash_key-arKey.s, hash_key-nKeyLength-1, 0); + } + if (zend_get_property_info(ce, member, 1 TSRMLS_CC) == EG(std_property_info)) { + ALLOC_ZVAL(property); + reflection_property_factory(ce, EG(std_property_info), property TSRMLS_CC); + add_next_index_zval(retval, property); + } + return 0; +} +/* }}} */ + /* {{{ proto public ReflectionProperty[] ReflectionClass::getProperties() Returns an array of this class' properties */ ZEND_METHOD(reflection_class, getProperties) @@ -3129,6 +3157,11 @@ array_init(return_value); zend_hash_apply_with_arguments(ce-properties_info, (apply_func_args_t) _addproperty, 3, ce, return_value, filter); + + if (intern-obj (filter ZEND_ACC_PUBLIC) != 0 Z_OBJ_HT_P(intern-obj)-get_properties) { + HashTable *properties = Z_OBJ_HT_P(intern-obj)-get_properties(intern-obj TSRMLS_CC); + zend_hash_apply_with_arguments(properties, (apply_func_args_t) _adddynproperty, 2, ce, return_value); + } } /* }}} */ @@ -4775,7 +4808,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.236 2006/06/11 23:46:53 bjori Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.237 2006/06/24 18:53:51 helly Exp $); php_info_print_table_end(); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/reflection php_reflection.c
helly Sat Jun 24 18:55:15 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/reflection php_reflection.c Log: - MFH Fix ReflectionObject::getProperties() + dyn properties http://cvs.php.net/viewvc.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.7r2=1.164.2.33.2.8diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.7 php-src/ext/reflection/php_reflection.c:1.164.2.33.2.8 --- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.7 Sat Jun 10 00:40:56 2006 +++ php-src/ext/reflection/php_reflection.c Sat Jun 24 18:55:15 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.164.2.33.2.7 2006/06/10 00:40:56 bjori Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.33.2.8 2006/06/24 18:55:15 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3078,6 +3078,28 @@ } /* }}} */ +/* {{{ _adddynproperty */ +static int _adddynproperty(zval **pptr, int num_args, va_list args, zend_hash_key *hash_key) +{ + zval *property; + zend_class_entry *ce = *va_arg(args, zend_class_entry**); + zval *retval = va_arg(args, zval*), member; + TSRMLS_FETCH(); + + if (hash_key-arKey[0] == '\0') { + return 0; /* non public cannot be dynamic */ + } + + ZVAL_STRINGL(member, hash_key-arKey, hash_key-nKeyLength-1, 0); + if (zend_get_property_info(ce, member, 1 TSRMLS_CC) == EG(std_property_info)) { + ALLOC_ZVAL(property); + reflection_property_factory(ce, EG(std_property_info), property TSRMLS_CC); + add_next_index_zval(retval, property); + } + return 0; +} +/* }}} */ + /* {{{ proto public ReflectionProperty[] ReflectionClass::getProperties() Returns an array of this class' properties */ ZEND_METHOD(reflection_class, getProperties) @@ -3101,6 +3123,11 @@ array_init(return_value); zend_hash_apply_with_arguments(ce-properties_info, (apply_func_args_t) _addproperty, 3, ce, return_value, filter); + + if (intern-obj (filter ZEND_ACC_PUBLIC) != 0 Z_OBJ_HT_P(intern-obj)-get_properties) { + HashTable *properties = Z_OBJ_HT_P(intern-obj)-get_properties(intern-obj TSRMLS_CC); + zend_hash_apply_with_arguments(properties, (apply_func_args_t) _adddynproperty, 2, ce, return_value); + } } /* }}} */ @@ -4713,7 +4740,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.164.2.33.2.7 2006/06/10 00:40:56 bjori Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.164.2.33.2.8 2006/06/24 18:55:15 helly Exp $); php_info_print_table_end(); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/file bug37864.phpt
Hello Nuno, would an empty data stream result in the same effect? If so use that rather than working on a real file. best regards marcus Tuesday, June 20, 2006, 11:49:16 PM, you wrote: nlopess Tue Jun 20 21:49:16 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/filebug37864.phpt Log: make sure the test outputs what we want http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug37864.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/standard/tests/file/bug37864.phpt diff -u php-src/ext/standard/tests/file/bug37864.phpt:1.1.2.2 php-src/ext/standard/tests/file/bug37864.phpt:1.1.2.3 --- php-src/ext/standard/tests/file/bug37864.phpt:1.1.2.2 Tue Jun 20 19:32:59 2006 +++ php-src/ext/standard/tests/file/bug37864.phpt Tue Jun 20 21:49:16 2006 @@ -3,8 +3,10 @@ --FILE-- ?php $tmpfname = tempnam(/tmp, emptyfile); - echo file_get_contents($tmpfname), done.; + var_dump(file_get_contents($tmpfname)); + echo done.\n; unlink($tmpfname); ? --EXPECT-- +string(0) done. Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /win32 crypt_win32.c crypt_win32.h
Hello Dmitry, this is impossible. We have discussed many times that nothing else besides PHP license stuff goes into core. please revert. marcus Friday, June 16, 2006, 7:57:18 AM, you wrote: http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.86r2=1.2027.2.547.2.87diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.86 php-src/NEWS:1.2027.2.547.2.87 --- php-src/NEWS:1.2027.2.547.2.86 Thu Jun 15 14:06:35 2006 +++ php-src/NEWSFri Jun 16 05:57:18 2006 @@ -6,6 +6,8 @@ - Changed realpath cache to be disabled when open_basedir or safe_mode are enabled on per-request basis. (Ilia) +- New crypt() implementation for win32 which is about 10 times faster and has + more friendly license. (Frank, Dmitry) - Improved performance of the implode() function on associated arrays. (Ilia) - Improved performance of str_replace() when doing 1 char to 1 char or 1 char to many chars replacement. (Ilia) http://cvs.php.net/viewcvs.cgi/php-src/win32/crypt_win32.c?r1=1.8.2.1r2=1.8.2.1.2.1diff_format=u Index: php-src/win32/crypt_win32.c diff -u php-src/win32/crypt_win32.c:1.8.2.1 php-src/win32/crypt_win32.c:1.8.2.1.2.1 --- php-src/win32/crypt_win32.c:1.8.2.1 Sun Jan 1 12:50:19 2006 +++ php-src/win32/crypt_win32.c Fri Jun 16 05:57:18 2006 @@ -1,350 +1,557 @@ /* - +--+ - | PHP Version 5| - +--+ - | Copyright (c) 1997-2006 The PHP Group| - +--+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is| - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | [EMAIL PROTECTED] so we can mail you a copy immediately. | - +--+ - | Author: | - +--+ + * UFC-crypt: ultra fast crypt(3) implementation + * + * Copyright (C) 1991, Michael Glad, email: [EMAIL PROTECTED] + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * @(#)crypt.c 2.2 10/04/91 + * + * Semiportable C version + * */ -/* $Id: crypt_win32.c,v 1.8.2.1 2006/01/01 12:50:19 sniper Exp $ */ - -/* This code is distributed under the PHP license with permission from - the author Jochen Obalek [EMAIL PROTECTED] */ - -/* encrypt.c - providing 56 bit DES encryption - Copyright (C) 1991 Jochen Obalek - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -#include time.h #include string.h -#include stdlib.h -#include md5crypt.h - -#define BS 64 -#define BS2 32 -#define KS 48 -#define KS2 24 -#define IS 56 -#define IS2 28 - -static char schluessel[16][KS]; - - -static char PC1[] = -{ - 56, 48, 40, 32, 24, 16, 8, 0, - 57, 49, 41, 33, 25, 17, 9, 1, - 58, 50, 42, 34, 26, 18, 10, 2, - 59, 51, 43, 35, - 62, 54, 46, 38, 30, 22, 14, 6, - 61, 53, 45, 37, 29, 21, 13, 5, - 60, 52, 44, 36, 28, 20, 12, 4, - 27, 19, 11, 3 -}; -
Re: [PHP-CVS] cvs: php-src /ext/sqlite sqlite.c
Hello Ilia, why change this to a recoveranle here? This messages states that you are doing somethign worng syntax wise. That should be a fatal error and is a fatal error in all other iterator implementations. best regards marcus Wednesday, June 14, 2006, 6:04:47 PM, you wrote: iliaa Wed Jun 14 16:04:47 2006 UTC Modified files: /php-src/ext/sqlite sqlite.c Log: MFB: E_ERROR - E_RECOVERABLE_ERROR http://cvs.php.net/viewcvs.cgi/php-src/ext/sqlite/sqlite.c?r1=1.193r2=1.194diff_format=u Index: php-src/ext/sqlite/sqlite.c diff -u php-src/ext/sqlite/sqlite.c:1.193 php-src/ext/sqlite/sqlite.c:1.194 --- php-src/ext/sqlite/sqlite.c:1.193 Tue Jun 13 13:12:19 2006 +++ php-src/ext/sqlite/sqlite.c Wed Jun 14 16:04:47 2006 @@ -17,7 +17,7 @@ | Marcus Boerger [EMAIL PROTECTED] | +--+ - $Id: sqlite.c,v 1.193 2006/06/13 13:12:19 dmitry Exp $ + $Id: sqlite.c,v 1.194 2006/06/14 16:04:47 iliaa Exp $ */ #ifdef HAVE_CONFIG_H @@ -1007,7 +1007,7 @@ sqlite_object *obj = (sqlite_object*) zend_object_store_get_object(object TSRMLS_CC); if (by_ref) { - zend_error(E_ERROR, An iterator cannot be used with foreach by reference); + zend_error(E_RECOVERABLE_ERROR, An iterator cannot be used with foreach by reference); } iterator = emalloc(sizeof(sqlite_object_iterator)); @@ -1129,7 +1129,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, SQLite support, enabled); - php_info_print_table_row(2, PECL Module version, PHP_SQLITE_MODULE_VERSION $Id: sqlite.c,v 1.193 2006/06/13 13:12:19 dmitry Exp $); + php_info_print_table_row(2, PECL Module version, PHP_SQLITE_MODULE_VERSION $Id: sqlite.c,v 1.194 2006/06/14 16:04:47 iliaa Exp $); php_info_print_table_row(2, SQLite Library, sqlite_libversion()); php_info_print_table_row(2, SQLite Encoding, sqlite_libencoding()); php_info_print_table_end(); Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/sqlite sqlite.c
Hello Derick, i know but this is mixture between syntax and semantics error. To be precise we are detecting a syntax useage that isnt allowed in the given semantic context. And we are not able to detect that during compile time. So maybe E_COMPILE_ERROR is also wrong. best regards marcus Wednesday, June 14, 2006, 7:38:15 PM, you wrote: On Wed, 14 Jun 2006, Marcus Boerger wrote: why change this to a recoveranle here? This messages states that you are doing somethign worng syntax wise. That should be a fatal error and is a fatal error in all other iterator implementations. the idea is that e_fatal is only used for stuff that leaves the engine in an unstable state. If that is not the case - e_recoverable_error. Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: CVSROOT / avail
helly Tue Jun 13 21:46:42 2006 UTC Modified files: /CVSROOTavail Log: - Upgrade nuno http://cvs.php.net/viewcvs.cgi/CVSROOT/avail?r1=1.1144r2=1.1145diff_format=u Index: CVSROOT/avail diff -u CVSROOT/avail:1.1144 CVSROOT/avail:1.1145 --- CVSROOT/avail:1.1144Wed Jun 7 22:43:40 2006 +++ CVSROOT/avail Tue Jun 13 21:46:42 2006 @@ -17,7 +17,7 @@ # The PHP Developers have full access to the full source trees for # PHP and PEAR, as well as the documentation. -avail|mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,gopalv,bjori|phpfi,php3,php-src,pecl,non-pecl,pear,peardoc,s! pl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa_IR,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca +avail|mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,gopalv,bjori,nlopess|phpfi,php3,php-src,pecl,non-pecl,pear,p! eardoc,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa_IR,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca # fastcgi implementation for IIS avail|shane,wez,edink|fastcgi-isapi @@ -331,7 +331,6 @@ avail|ehlersd|pear/Net_Geo avail|lyaish|pear/HTML_AJAX avail|amir|pear/XML_XUL -avail|nlopess|pecl/tidy,php-src/ext/tidy avail|wittend|pear/File_DICOM,peardoc avail|ccollie|ext/unicode avail|lukasfeiler|peardoc,pear/XML_Query2XML -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c
helly Wed Jun 7 09:11:58 2006 UTC Modified files: /php-src/ext/reflection php_reflection.c Log: - Add ReflectionClass::getInterfaceNames() http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.232r2=1.233diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.232 php-src/ext/reflection/php_reflection.c:1.233 --- php-src/ext/reflection/php_reflection.c:1.232 Sun Jun 4 10:11:48 2006 +++ php-src/ext/reflection/php_reflection.c Wed Jun 7 09:11:58 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.232 2006/06/04 10:11:48 helly Exp $ */ +/* $Id: php_reflection.c,v 1.233 2006/06/07 09:11:58 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3441,6 +3441,26 @@ } /* }}} */ +/* {{{ proto public String[] ReflectionClass::getInterfaceNames() + Returns an array of names of interfaces this class implements */ +ZEND_METHOD(reflection_class, getInterfaceNames) +{ + reflection_object *intern; + zend_class_entry *ce; + zend_uint i; + + METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + GET_REFLECTION_OBJECT_PTR(ce); + + /* Return an empty array if this class implements no interfaces */ + array_init(return_value); + + for (i=0; i ce-num_interfaces; i++) { + add_next_index_textl(return_value, ce-interfaces[i]-name, ce-interfaces[i]-name_length, 1); + } +} +/* }}} */ + /* {{{ proto public ReflectionClass ReflectionClass::getParentClass() Returns the class' parent class, or, if none exists, FALSE */ ZEND_METHOD(reflection_class, getParentClass) @@ -4176,8 +4196,7 @@ /* FIXME: Unicode support??? */ add_assoc_zval_ex(class_array, (*pce)-name.s, (*pce)-name_length + 1, zclass); } else { - /* FIXME: Unicode support??? */ - add_next_index_stringl(class_array, (*pce)-name.s, (*pce)-name_length, 1); + add_next_index_textl(class_array, (*pce)-name, (*pce)-name_length, 1); } } return ZEND_HASH_APPLY_KEEP; @@ -4352,6 +4371,7 @@ ZEND_ME(reflection_class, getConstants, NULL, 0) ZEND_ME(reflection_class, getConstant, NULL, 0) ZEND_ME(reflection_class, getInterfaces, NULL, 0) + ZEND_ME(reflection_class, getInterfaceNames, NULL, 0) ZEND_ME(reflection_class, isInterface, NULL, 0) ZEND_ME(reflection_class, isAbstract, NULL, 0) ZEND_ME(reflection_class, isFinal, NULL, 0) @@ -4543,7 +4563,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.232 2006/06/04 10:11:48 helly Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.233 2006/06/07 09:11:58 helly Exp $); php_info_print_table_end(); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/reflection php_reflection.c
helly Wed Jun 7 09:26:11 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/reflection php_reflection.c Log: - MFH Add ReflectionClass::getInterfaceNames() http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.4r2=1.164.2.33.2.5diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.4 php-src/ext/reflection/php_reflection.c:1.164.2.33.2.5 --- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.4 Sun Jun 4 10:26:55 2006 +++ php-src/ext/reflection/php_reflection.c Wed Jun 7 09:26:11 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.164.2.33.2.4 2006/06/04 10:26:55 helly Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.33.2.5 2006/06/07 09:26:11 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3416,6 +3416,26 @@ } /* }}} */ +/* {{{ proto public String[] ReflectionClass::getInterfaceNames() + Returns an array of names of interfaces this class implements */ +ZEND_METHOD(reflection_class, getInterfaceNames) +{ + reflection_object *intern; + zend_class_entry *ce; + zend_uint i; + + METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + GET_REFLECTION_OBJECT_PTR(ce); + + /* Return an empty array if this class implements no interfaces */ + array_init(return_value); + + for (i=0; i ce-num_interfaces; i++) { + add_next_index_stringl(return_value, ce-interfaces[i]-name, ce-interfaces[i]-name_length, 1); + } +} +/* }}} */ + /* {{{ proto public ReflectionClass ReflectionClass::getParentClass() Returns the class' parent class, or, if none exists, FALSE */ ZEND_METHOD(reflection_class, getParentClass) @@ -4290,6 +4310,7 @@ ZEND_ME(reflection_class, getConstants, NULL, 0) ZEND_ME(reflection_class, getConstant, NULL, 0) ZEND_ME(reflection_class, getInterfaces, NULL, 0) + ZEND_ME(reflection_class, getInterfaceNames, NULL, 0) ZEND_ME(reflection_class, isInterface, NULL, 0) ZEND_ME(reflection_class, isAbstract, NULL, 0) ZEND_ME(reflection_class, isFinal, NULL, 0) @@ -4484,7 +4505,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.164.2.33.2.4 2006/06/04 10:26:55 helly Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.164.2.33.2.5 2006/06/07 09:26:11 helly Exp $); php_info_print_table_end(); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/spl php_spl.c spl_iterators.c spl_iterators.h /ext/spl/tests spl_004.phpt
helly Wed Jun 7 09:44:42 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/spl/tests spl_004.phpt Modified files: /php-src/ext/splphp_spl.c spl_iterators.c spl_iterators.h Log: - MFH iterator_apply() http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28.2.1r2=1.52.2.28.2.2diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28.2.1 php-src/ext/spl/php_spl.c:1.52.2.28.2.2 --- php-src/ext/spl/php_spl.c:1.52.2.28.2.1 Sun Jun 4 10:47:22 2006 +++ php-src/ext/spl/php_spl.c Wed Jun 7 09:44:41 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28.2.1 2006/06/04 10:47:22 helly Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.2 2006/06/07 09:44:41 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -610,7 +610,14 @@ static ZEND_BEGIN_ARG_INFO(arginfo_iterator, 0) - ZEND_ARG_INFO(0, iterator) + ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) +ZEND_END_ARG_INFO(); + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_iterator_apply, 0, 0, 2) + ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) + ZEND_ARG_INFO(0, function) + ZEND_ARG_ARRAY_INFO(0, args, 1) ZEND_END_ARG_INFO(); /* {{{ spl_functions @@ -628,6 +635,7 @@ #ifdef SPL_ITERATORS_H PHP_FE(iterator_to_array, arginfo_iterator) PHP_FE(iterator_count, arginfo_iterator) + PHP_FE(iterator_apply, arginfo_iterator_apply) #endif /* SPL_ITERATORS_H */ {NULL, NULL, NULL} }; http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.30.2.10r2=1.73.2.30.2.11diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.73.2.30.2.10 php-src/ext/spl/spl_iterators.c:1.73.2.30.2.11 --- php-src/ext/spl/spl_iterators.c:1.73.2.30.2.10 Tue Jun 6 20:11:35 2006 +++ php-src/ext/spl/spl_iterators.c Wed Jun 7 09:44:41 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.73.2.30.2.10 2006/06/06 20:11:35 tony2001 Exp $ */ +/* $Id: spl_iterators.c,v 1.73.2.30.2.11 2006/06/07 09:44:41 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -2575,7 +2575,7 @@ Copy the iterator into an array */ PHP_FUNCTION(iterator_to_array) { - zval *obj; + zval *obj; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, O, obj, zend_ce_traversable) == FAILURE) { RETURN_FALSE; @@ -2600,8 +2600,8 @@ Count the elements in an iterator */ PHP_FUNCTION(iterator_count) { - zval *obj; - longcount = 0; + zval *obj; + long count = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, O, obj, zend_ce_traversable) == FAILURE) { RETURN_FALSE; @@ -2613,6 +2613,54 @@ } /* }}} */ +typedef struct { + zval *obj; + zval *args; + long count; + zend_fcall_infofci; + zend_fcall_info_cache fcc; +} spl_iterator_apply_info; + +static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */ +{ + zval *retval; + spl_iterator_apply_info *apply_info = (spl_iterator_apply_info*)puser; + int result; + + apply_info-count++; + zend_fcall_info_call(apply_info-fci, apply_info-fcc, retval, NULL TSRMLS_CC); + if (retval) { + result = zend_is_true(retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP; + zval_ptr_dtor(retval); + } else { + result = ZEND_HASH_APPLY_STOP; + } + return result; +} +/* }}} */ + +/* {{{ proto int iterator_apply(Traversable it, mixed function [, mixed params]) + Calls a function for every element in an iterator */ +PHP_FUNCTION(iterator_apply) +{ + spl_iterator_apply_info apply_info; + + apply_info.args = NULL; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Of|a!, apply_info.obj, zend_ce_traversable, apply_info.fci, apply_info.fcc, apply_info.args) == FAILURE) { + return; + } + + apply_info.count = 0; + zend_fcall_info_args(apply_info.fci, apply_info.args TSRMLS_CC); + if (spl_iterator_apply(apply_info.obj, spl_iterator_func_apply, (void*)apply_info TSRMLS_CC) == SUCCESS) { + RETVAL_LONG(apply_info.count); + } else { + RETVAL_FALSE; + } + zend_fcall_info_args(apply_info.fci, NULL TSRMLS_CC); +} +/* }}} */ + static zend_function_entry spl_funcs_OuterIterator[] = { SPL_ABSTRACT_ME(OuterIterator, getInnerIterator, NULL) {NULL, NULL, NULL} http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.h?r1=1.18.2.7.2.5r2=1.18.2.7.2.6diff_format=u Index:
[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c
helly Wed Jun 7 22:39:00 2006 UTC Modified files: /php-src/ext/reflection php_reflection.c Log: - Add arginfo (hannes) http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.233r2=1.234diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.233 php-src/ext/reflection/php_reflection.c:1.234 --- php-src/ext/reflection/php_reflection.c:1.233 Wed Jun 7 09:11:58 2006 +++ php-src/ext/reflection/php_reflection.c Wed Jun 7 22:39:00 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.233 2006/06/07 09:11:58 helly Exp $ */ +/* $Id: php_reflection.c,v 1.234 2006/06/07 22:39:00 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3978,6 +3978,7 @@ zend_reflection_class_factory(ce, return_value TSRMLS_CC); } +/* }}} */ /* {{{ proto public string ReflectionProperty::getDocComment() Returns the doc comment for this property */ @@ -3994,6 +3995,7 @@ RETURN_FALSE; } /* }}} */ + /* {{{ proto public static mixed ReflectionExtension::export(string name [, bool return]) throws ReflectionException Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ ZEND_METHOD(reflection_extension, export) @@ -4290,9 +4292,21 @@ {NULL, NULL, NULL} }; + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_getModifierNames, 0) + ZEND_ARG_INFO(0, modifiers) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_export, 0, 0, 1) + ZEND_ARG_OBJ_INFO(0, reflector, Reflector, 0) + ZEND_ARG_INFO(0, return) +ZEND_END_ARG_INFO() + static zend_function_entry reflection_functions[] = { - ZEND_ME(reflection, getModifierNames, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(reflection, export, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(reflection, getModifierNames, arginfo_reflection_getModifierNames, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(reflection, export, arginfo_reflection_export, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) {NULL, NULL, NULL} }; @@ -4302,10 +4316,31 @@ {NULL, NULL, NULL} }; +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_function_export, 0, 0, 1) + ZEND_ARG_INFO(0, name) + ZEND_ARG_INFO(0, return) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_function___construct, 0) + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_function_invoke, 0) + ZEND_ARG_INFO(0, args) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_function_invokeArgs, 0) + ZEND_ARG_ARRAY_INFO(0, args, 0) +ZEND_END_ARG_INFO() + static zend_function_entry reflection_function_functions[] = { ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_function, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_function, __construct, NULL, 0) + ZEND_ME(reflection_function, export, arginfo_reflection_function_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + ZEND_ME(reflection_function, __construct, arginfo_reflection_function___construct, 0) ZEND_ME(reflection_function, __toString, NULL, 0) ZEND_ME(reflection_function, isInternal, NULL, 0) ZEND_ME(reflection_function, isUserDefined, NULL, 0) @@ -4315,8 +4350,8 @@ ZEND_ME(reflection_function, getEndLine, NULL, 0) ZEND_ME(reflection_function, getDocComment, NULL, 0) ZEND_ME(reflection_function, getStaticVariables, NULL, 0) - ZEND_ME(reflection_function, invoke, NULL, 0) - ZEND_ME(reflection_function, invokeArgs, NULL, 0) + ZEND_ME(reflection_function, invoke, arginfo_reflection_function_invoke, 0) + ZEND_ME(reflection_function, invokeArgs, arginfo_reflection_function_invokeArgs, 0) ZEND_ME(reflection_function, returnsReference, NULL, 0) ZEND_ME(reflection_function, getParameters, NULL, 0) ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0) @@ -4327,9 +4362,34 @@ {NULL, NULL, NULL} }; +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_method_export, 0, 0, 2) + ZEND_ARG_INFO(0, class) + ZEND_ARG_INFO(0, name) + ZEND_ARG_INFO(0, return) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_method___construct, 0, 0, 1) + ZEND_ARG_INFO(0, class_or_method) + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_invoke, 0) + ZEND_ARG_INFO(0, object) + ZEND_ARG_INFO(0, args) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_invokeArgs, 0) + ZEND_ARG_INFO(0, object) + ZEND_ARG_ARRAY_INFO(0, args, 0) +ZEND_END_ARG_INFO() + static zend_function_entry reflection_method_functions[]
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/reflection php_reflection.c
helly Wed Jun 7 22:39:22 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/reflection php_reflection.c Log: - MFH Add arginfo (hannes) http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.5r2=1.164.2.33.2.6diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.5 php-src/ext/reflection/php_reflection.c:1.164.2.33.2.6 --- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.5 Wed Jun 7 09:26:11 2006 +++ php-src/ext/reflection/php_reflection.c Wed Jun 7 22:39:22 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.164.2.33.2.5 2006/06/07 09:26:11 helly Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.33.2.6 2006/06/07 22:39:22 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -3917,6 +3917,7 @@ zend_reflection_class_factory(ce, return_value TSRMLS_CC); } +/* }}} */ /* {{{ proto public string ReflectionProperty::getDocComment() Returns the doc comment for this property */ @@ -3933,6 +3934,7 @@ RETURN_FALSE; } /* }}} */ + /* {{{ proto public static mixed ReflectionExtension::export(string name [, bool return]) throws ReflectionException Exports a reflection object. Returns the output if TRUE is specified for return, printing it otherwise. */ ZEND_METHOD(reflection_extension, export) @@ -4227,9 +4229,21 @@ {NULL, NULL, NULL} }; + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_getModifierNames, 0) + ZEND_ARG_INFO(0, modifiers) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_export, 0, 0, 1) + ZEND_ARG_OBJ_INFO(0, reflector, Reflector, 0) + ZEND_ARG_INFO(0, return) +ZEND_END_ARG_INFO() + static zend_function_entry reflection_functions[] = { - ZEND_ME(reflection, getModifierNames, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - ZEND_ME(reflection, export, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(reflection, getModifierNames, arginfo_reflection_getModifierNames, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + ZEND_ME(reflection, export, arginfo_reflection_export, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) {NULL, NULL, NULL} }; @@ -4239,10 +4253,31 @@ {NULL, NULL, NULL} }; +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_function_export, 0, 0, 1) + ZEND_ARG_INFO(0, name) + ZEND_ARG_INFO(0, return) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_function___construct, 0) + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_function_invoke, 0) + ZEND_ARG_INFO(0, args) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_function_invokeArgs, 0) + ZEND_ARG_ARRAY_INFO(0, args, 0) +ZEND_END_ARG_INFO() + static zend_function_entry reflection_function_functions[] = { ZEND_ME(reflection, __clone, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL) - ZEND_ME(reflection_function, export, NULL, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) - ZEND_ME(reflection_function, __construct, NULL, 0) + ZEND_ME(reflection_function, export, arginfo_reflection_function_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC) + ZEND_ME(reflection_function, __construct, arginfo_reflection_function___construct, 0) ZEND_ME(reflection_function, __toString, NULL, 0) ZEND_ME(reflection_function, isInternal, NULL, 0) ZEND_ME(reflection_function, isUserDefined, NULL, 0) @@ -4252,8 +4287,8 @@ ZEND_ME(reflection_function, getEndLine, NULL, 0) ZEND_ME(reflection_function, getDocComment, NULL, 0) ZEND_ME(reflection_function, getStaticVariables, NULL, 0) - ZEND_ME(reflection_function, invoke, NULL, 0) - ZEND_ME(reflection_function, invokeArgs, NULL, 0) + ZEND_ME(reflection_function, invoke, arginfo_reflection_function_invoke, 0) + ZEND_ME(reflection_function, invokeArgs, arginfo_reflection_function_invokeArgs, 0) ZEND_ME(reflection_function, returnsReference, NULL, 0) ZEND_ME(reflection_function, getParameters, NULL, 0) ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0) @@ -4266,9 +4301,34 @@ {NULL, NULL, NULL} }; +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_method_export, 0, 0, 2) + ZEND_ARG_INFO(0, class) + ZEND_ARG_INFO(0, name) + ZEND_ARG_INFO(0, return) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_reflection_method___construct, 0, 0, 1) + ZEND_ARG_INFO(0, class_or_method) + ZEND_ARG_INFO(0, name) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_invoke, 0) + ZEND_ARG_INFO(0, object) + ZEND_ARG_INFO(0, args) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_invokeArgs, 0) + ZEND_ARG_INFO(0, object) + ZEND_ARG_ARRAY_INFO(0, args,
[PHP-CVS] cvs: php-src /ext/reflection php_reflection.c
helly Sun Jun 4 10:11:49 2006 UTC Modified files: /php-src/ext/reflection php_reflection.c Log: - Use engine call to register interfaces (steph) http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.231r2=1.232diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.231 php-src/ext/reflection/php_reflection.c:1.232 --- php-src/ext/reflection/php_reflection.c:1.231 Thu Jun 1 14:31:02 2006 +++ php-src/ext/reflection/php_reflection.c Sun Jun 4 10:11:48 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.231 2006/06/01 14:31:02 tony2001 Exp $ */ +/* $Id: php_reflection.c,v 1.232 2006/06/04 10:11:48 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -4474,8 +4474,7 @@ reflection_ptr = zend_register_internal_class(_reflection_entry TSRMLS_CC); INIT_CLASS_ENTRY(_reflection_entry, Reflector, reflector_functions); - reflector_ptr = zend_register_internal_class(_reflection_entry TSRMLS_CC); - reflector_ptr-ce_flags = ZEND_ACC_ABSTRACT | ZEND_ACC_INTERFACE; + reflector_ptr = zend_register_internal_interface(_reflection_entry TSRMLS_CC); INIT_CLASS_ENTRY(_reflection_entry, ReflectionFunction, reflection_function_functions); _reflection_entry.create_object = reflection_objects_new; @@ -4544,7 +4543,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.231 2006/06/01 14:31:02 tony2001 Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.232 2006/06/04 10:11:48 helly Exp $); php_info_print_table_end(); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/reflection php_reflection.c
helly Sun Jun 4 10:26:56 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/reflection php_reflection.c Log: - Use engine call to register interfaces (steph) http://cvs.php.net/viewcvs.cgi/php-src/ext/reflection/php_reflection.c?r1=1.164.2.33.2.3r2=1.164.2.33.2.4diff_format=u Index: php-src/ext/reflection/php_reflection.c diff -u php-src/ext/reflection/php_reflection.c:1.164.2.33.2.3 php-src/ext/reflection/php_reflection.c:1.164.2.33.2.4 --- php-src/ext/reflection/php_reflection.c:1.164.2.33.2.3 Thu Jun 1 14:31:22 2006 +++ php-src/ext/reflection/php_reflection.c Sun Jun 4 10:26:55 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: php_reflection.c,v 1.164.2.33.2.3 2006/06/01 14:31:22 tony2001 Exp $ */ +/* $Id: php_reflection.c,v 1.164.2.33.2.4 2006/06/04 10:26:55 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -4415,8 +4415,7 @@ reflection_ptr = zend_register_internal_class(_reflection_entry TSRMLS_CC); INIT_CLASS_ENTRY(_reflection_entry, Reflector, reflector_functions); - reflector_ptr = zend_register_internal_class(_reflection_entry TSRMLS_CC); - reflector_ptr-ce_flags = ZEND_ACC_ABSTRACT | ZEND_ACC_INTERFACE; + reflector_ptr = zend_register_internal_interface(_reflection_entry TSRMLS_CC); INIT_CLASS_ENTRY(_reflection_entry, ReflectionFunction, reflection_function_functions); _reflection_entry.create_object = reflection_objects_new; @@ -4485,7 +4484,7 @@ php_info_print_table_start(); php_info_print_table_header(2, Reflection, enabled); - php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.164.2.33.2.3 2006/06/01 14:31:22 tony2001 Exp $); + php_info_print_table_row(2, Version, $Id: php_reflection.c,v 1.164.2.33.2.4 2006/06/04 10:26:55 helly Exp $); php_info_print_table_end(); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl_functions.c
helly Sun Jun 4 10:31:58 2006 UTC Modified files: /php-src/ext/splspl_functions.c Log: - Use engine call to register interfaces (steph) http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_functions.c?r1=1.35r2=1.36diff_format=u Index: php-src/ext/spl/spl_functions.c diff -u php-src/ext/spl/spl_functions.c:1.35 php-src/ext/spl/spl_functions.c:1.36 --- php-src/ext/spl/spl_functions.c:1.35Thu Mar 9 11:44:05 2006 +++ php-src/ext/spl/spl_functions.c Sun Jun 4 10:31:58 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_functions.c,v 1.35 2006/03/09 11:44:05 sebastian Exp $ */ +/* $Id: spl_functions.c,v 1.36 2006/06/04 10:31:58 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -42,10 +42,7 @@ INIT_CLASS_ENTRY(ce, class_name, functions); ce.name_length = strlen(class_name); - *ppce = zend_register_internal_class(ce TSRMLS_CC); - - /* entries changed by initialize */ - (*ppce)-ce_flags = ZEND_ACC_INTERFACE; + *ppce = zend_register_internal_interface(ce TSRMLS_CC); } /* }}} */ -- 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 spl_functions.c
helly Sun Jun 4 10:34:22 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/splspl_functions.c Log: - MFH Use engine call to register interfaces (steph) http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_functions.c?r1=1.28.2.3r2=1.28.2.3.2.1diff_format=u Index: php-src/ext/spl/spl_functions.c diff -u php-src/ext/spl/spl_functions.c:1.28.2.3 php-src/ext/spl/spl_functions.c:1.28.2.3.2.1 --- php-src/ext/spl/spl_functions.c:1.28.2.3Thu Mar 9 11:43:45 2006 +++ php-src/ext/spl/spl_functions.c Sun Jun 4 10:34:22 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_functions.c,v 1.28.2.3 2006/03/09 11:43:45 sebastian Exp $ */ +/* $Id: spl_functions.c,v 1.28.2.3.2.1 2006/06/04 10:34:22 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -42,10 +42,7 @@ INIT_CLASS_ENTRY(ce, class_name, functions); ce.name_length = strlen(class_name); - *ppce = zend_register_internal_class(ce TSRMLS_CC); - - /* entries changed by initialize */ - (*ppce)-ce_flags = ZEND_ACC_INTERFACE; + *ppce = zend_register_internal_interface(ce TSRMLS_CC); } /* }}} */ -- 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 php_spl.c
helly Sun Jun 4 10:47:22 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/splphp_spl.c Log: - Add missing classes http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/php_spl.c?r1=1.52.2.28r2=1.52.2.28.2.1diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.52.2.28 php-src/ext/spl/php_spl.c:1.52.2.28.2.1 --- php-src/ext/spl/php_spl.c:1.52.2.28 Thu Mar 23 19:55:16 2006 +++ php-src/ext/spl/php_spl.c Sun Jun 4 10:47:22 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.52.2.28 2006/03/23 19:55:16 helly Exp $ */ +/* $Id: php_spl.c,v 1.52.2.28.2.1 2006/06/04 10:47:22 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -180,6 +180,8 @@ SPL_ADD_CLASS(RecursiveFilterIterator, z_list, sub, allow, ce_flags); \ SPL_ADD_CLASS(RecursiveIterator, z_list, sub, allow, ce_flags); \ SPL_ADD_CLASS(RecursiveIteratorIterator, z_list, sub, allow, ce_flags); \ + SPL_ADD_CLASS(RecursiveRegexIterator, z_list, sub, allow, ce_flags); \ + SPL_ADD_CLASS(RegexIterator, z_list, sub, allow, ce_flags); \ SPL_ADD_CLASS(RuntimeException, z_list, sub, allow, ce_flags); \ SPL_ADD_CLASS(SeekableIterator, z_list, sub, allow, ce_flags); \ SPL_ADD_CLASS(SimpleXMLIterator, z_list, sub, allow, ce_flags); \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src / README.NEW-OUTPUT-API /ext/pgsql pgsql.c /ext/session session.c /ext/soap soap.c /ext/standard basic_functions.c head.c info.c url_scanner_ex.c url_scanner_ex.re var.c
Hello Michael, in streams api they at least make sense because the yuse the same technology using in a bunch of zend functions to pass a bit more information about the callee :-) - but here that is not done so i also see no reason for that. best regards marcus Friday, June 2, 2006, 11:08:53 PM, you wrote: On 03.06.2006 00:56, Andi Gutmans wrote: Btw, any reason why we need all those redefinition of functions? If it's just to save having to write TSRMLS_C then I'd prefer to remove those macros. They just make debugging harder I have to second that - those macros basically add even more confusion during debugging. I bet you should know how annoying are similar macros in streams API. , there's no real benefit and we've tried to be explicit in other places. The patch looks nice though although I haven't finished reading through the whole thing (I also just found some of the explanations :)Thanks. +#define php_output_clean() _php_output_clean(TSRMLS_C) +PHPAPI int _php_output_clean(TSRMLS_D); + +#define php_output_clean_all() _php_output_clean_all(TSRMLS_C) +PHPAPI void _php_output_clean_all(TSRMLS_D); + +#define php_output_end() _php_output_end(TSRMLS_C) +PHPAPI int _php_output_end(TSRMLS_D); + +#define php_output_end_all() _php_output_end_all(TSRMLS_C) +PHPAPI void _php_output_end_all(TSRMLS_D); + +#define php_output_discard() _php_output_discard(TSRMLS_C) +PHPAPI int _php_output_discard(TSRMLS_D); + +#define php_output_discard_all() _php_output_discard_all(TSRMLS_C) +PHPAPI void _php_output_discard_all(TSRMLS_D); -- Wbr, Antony Dovgal Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/classes inheritance_003.phpt inheritance_004.phpt
helly Tue May 30 23:11:14 2006 UTC Added files: /php-src/tests/classes inheritance_003.phpt inheritance_004.phpt Log: - Add new tests http://cvs.php.net/viewcvs.cgi/php-src/tests/classes/inheritance_003.phpt?view=markuprev=1.1 Index: php-src/tests/classes/inheritance_003.phpt +++ php-src/tests/classes/inheritance_003.phpt --TEST-- ZE2 method inheritance without interfaces --FILE-- ?php class A { function f($x) {} } class B extends A { function f() {} } ? ===DONE=== --EXPECTF-- Fatal error: Declaration of B::f() must be compatible with that of A::f() in %sinheritance_003.php on line %d http://cvs.php.net/viewcvs.cgi/php-src/tests/classes/inheritance_004.phpt?view=markuprev=1.1 Index: php-src/tests/classes/inheritance_004.phpt +++ php-src/tests/classes/inheritance_004.phpt --TEST-- ZE2 method inheritance without interfaces --FILE-- ?php class A { function f() {} } class B extends A { function f($x) {} } ? ===DONE=== --EXPECTF-- Fatal error: Declaration of B::f() must be compatible with that of A::f() in %sinheritance_004.php 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) /tests/classes inheritance_003.phpt inheritance_004.phpt
helly Tue May 30 23:11:34 2006 UTC Added files: (Branch: PHP_5_2) /php-src/tests/classes inheritance_003.phpt inheritance_004.phpt Log: - Add new tests http://cvs.php.net/viewcvs.cgi/php-src/tests/classes/inheritance_003.phpt?view=markuprev=1.1 Index: php-src/tests/classes/inheritance_003.phpt +++ php-src/tests/classes/inheritance_003.phpt --TEST-- ZE2 method inheritance without interfaces --FILE-- ?php class A { function f($x) {} } class B extends A { function f() {} } ? ===DONE=== --EXPECTF-- Fatal error: Declaration of B::f() must be compatible with that of A::f() in %sinheritance_003.php on line %d http://cvs.php.net/viewcvs.cgi/php-src/tests/classes/inheritance_004.phpt?view=markuprev=1.1 Index: php-src/tests/classes/inheritance_004.phpt +++ php-src/tests/classes/inheritance_004.phpt --TEST-- ZE2 method inheritance without interfaces --FILE-- ?php class A { function f() {} } class B extends A { function f($x) {} } ? ===DONE=== --EXPECTF-- Fatal error: Declaration of B::f() must be compatible with that of A::f() in %sinheritance_004.php on line %d -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/file file_put_contents.phpt
Hello Antony, i have a different set of scripts based on Ken Coar's that work perfectly at my office. But Rasmus had problems setting them up. So i am not sure it is a good idea to install them and try a bit until the issues are solved. For example we should block access to all but a test repository/module during that time. best regards marcus Monday, May 29, 2006, 12:50:19 PM, you wrote: Could someone fix this damned CVS log script ? Currently it shows data from HEAD when a different data has been actually committed to a branch, which is kinda confusing. And those infamous empty log mails when somebody adds a file only to a branch.. On 29.05.2006 14:42, Antony Dovgal wrote: tony2001 Mon May 29 10:42:54 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/file file_put_contents.phpt Log: add test http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/file/file_put_contents.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/file/file_put_contents.phpt +++ php-src/ext/standard/tests/file/file_put_contents.phpt --TEST-- file_put_contents() and invalid parameters --FILE-- ?php $file = dirname(__FILE__)./file_put_contents.txt; $context = stream_context_create(); var_dump(file_put_contents($file, $context)); var_dump(file_put_contents($file, new stdClass)); $fp = fopen($file, r); var_dump(file_put_contents($file, string, 0, $fp)); @unlink($file); echo Done\n; ? --EXPECTF-- Warning: file_put_contents(): supplied resource is not a valid stream resource in %s on line %d bool(false) Warning: file_put_contents(): 2nd parameter must be non-object (for now) in %s on line %d bool(false) Warning: file_put_contents(): supplied resource is not a valid Stream-Context resource in %s on line %d int(6) Done --UEXPECTF-- Warning: file_put_contents(): supplied resource is not a valid stream resource in %s on line %d bool(false) Warning: file_put_contents(): 2nd parameter must be non-object (for now) in %s on line %d bool(false) Warning: file_put_contents(): supplied resource is not a valid Stream-Context resource in %s on line %d Notice: file_put_contents(): 6 character unicode buffer downcoded for binary stream runtime_encoding in %s on line %d int(6) 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) / NEWS
helly Mon May 29 20:07:40 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS Log: - BFN http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.62r2=1.2027.2.547.2.63diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.62 php-src/NEWS:1.2027.2.547.2.63 --- php-src/NEWS:1.2027.2.547.2.62 Mon May 29 16:53:56 2006 +++ php-src/NEWSMon May 29 20:07:39 2006 @@ -47,6 +47,7 @@ - Added RFC2397 (data: stream) support. (Marcus) - Fixed memory leaks in openssl streams context options (Pierre) - Fixed handling of extremely long paths inside tempnam() function. (Ilia) +- Fixed bug #37632 (Protected method access problem). (Marcus) - Fixed bug #37620 (mysqli_ssl_set validation is innappropriate). (Georg) - Fixed bug #37614 (Class name lowercased in error message). (Johannes) - Fixed bug #37587 (var without attribute causes segfault). (Marcus) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/prephp EXPERIMENTAL
helly Sat May 27 18:18:58 2006 UTC Added files: /php-src/ext/prephp EXPERIMENTAL Log: Initial Release -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/prephp EXPERIMENTAL
Hello internals, hmmm it ignored my -d... Saturday, May 27, 2006, 8:18:58 PM, you wrote: helly Sat May 27 18:18:58 2006 UTC Added files: /php-src/ext/prephp EXPERIMENTAL Log: Initial Release Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/prephp EXPERIMENTAL
Hello Antony, i can't neither, i just did something wrong. And unfortunatley now i have to wait until someone moves this directory to the right place to not get something into more trouble. soryy, sorry, sorry but i was so annoyed and had to listen to so many accusations that i deided to do something. Unfortunatly i did it with a bit of a haste. Can i repeat saying sorry for the mistake or do i need to bow before anybody? Saturday, May 27, 2006, 8:26:47 PM, you wrote: On 27.05.2006 22:18, Marcus Boerger wrote: helly Sat May 27 18:18:58 2006 UTC Added files: /php-src/ext/prephp EXPERIMENTAL Log: Initial Release Wow. So I can freely commit pecl/memcache, pecl/archive and pecl/rar to the core? I'd really like to get them included into the core, but I don't remember anyone agreed on that. -- Wbr, Antony Dovgal Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/prephp EXPERIMENTAL
Hello Antony, phew, luckily Derick was around and able to correct my mistake regards marcus Saturday, May 27, 2006, 8:26:47 PM, you wrote: On 27.05.2006 22:18, Marcus Boerger wrote: helly Sat May 27 18:18:58 2006 UTC Added files: /php-src/ext/prephp EXPERIMENTAL Log: Initial Release Wow. So I can freely commit pecl/memcache, pecl/archive and pecl/rar to the core? I'd really like to get them included into the core, but I don't remember anyone agreed on that. Best regards, Marcus -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/wddx wddx.c /ext/wddx/tests bug37587.phpt
helly Thu May 25 09:51:58 2006 UTC Added files: /php-src/ext/wddx/tests bug37587.phpt Modified files: /php-src/ext/wddx wddx.c Log: - Bugfix 37587 http://cvs.php.net/viewcvs.cgi/php-src/ext/wddx/wddx.c?r1=1.132r2=1.133diff_format=u Index: php-src/ext/wddx/wddx.c diff -u php-src/ext/wddx/wddx.c:1.132 php-src/ext/wddx/wddx.c:1.133 --- php-src/ext/wddx/wddx.c:1.132 Sun Apr 23 16:02:51 2006 +++ php-src/ext/wddx/wddx.c Thu May 25 09:51:58 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: wddx.c,v 1.132 2006/04/23 16:02:51 iliaa Exp $ */ +/* $Id: wddx.c,v 1.133 2006/05/25 09:51:58 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -752,7 +752,7 @@ } else if (!strcmp(name, EL_CHAR)) { int i; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_CHAR_CODE) atts[++i] atts[i][0]) { char tmp_buf[2]; @@ -772,7 +772,7 @@ } else if (!strcmp(name, EL_BOOLEAN)) { int i; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_VALUE) atts[++i] atts[i][0]) { ent.type = ST_BOOLEAN; SET_STACK_VARNAME; @@ -813,7 +813,7 @@ } else if (!strcmp(name, EL_VAR)) { int i; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_NAME) atts[++i] atts[i][0]) { char *decoded; int decoded_len; @@ -830,7 +830,7 @@ MAKE_STD_ZVAL(ent.data); array_init(ent.data); - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], fieldNames) atts[++i] atts[i][0]) { zval *tmp; char *key; @@ -870,7 +870,7 @@ ent.varname = NULL; ent.data = NULL; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_NAME) atts[++i] atts[i][0]) { char *decoded; int decoded_len; http://cvs.php.net/viewcvs.cgi/php-src/ext/wddx/tests/bug37587.phpt?view=markuprev=1.1 Index: php-src/ext/wddx/tests/bug37587.phpt +++ php-src/ext/wddx/tests/bug37587.phpt --TEST-- Bug #37587 (var without attribute causes segfault) --FILE-- ?php var_dump(wddx_deserialize(file_get_contents(EOF data:,wddxPacket version='1.0' header/ data array length='1' var struct var name='test'stringHello World/string/var /struct /var /array /data /wddxPacket EOF ))); ? ===DONE=== --EXPECT-- array(1) { [0]= array(1) { [test]= string(11) Hello World } } ===DONE=== --UEXPECT-- array(1) { [0]= array(1) { [utest]= string(11) Hello World } } ===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) / NEWS /ext/wddx wddx.c /ext/wddx/tests bug37587.phpt
helly Thu May 25 09:59:25 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/wddx/tests bug37587.phpt Modified files: /php-srcNEWS /php-src/ext/wddx wddx.c Log: - MFH Bugfix 37587 http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.50r2=1.2027.2.547.2.51diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.50 php-src/NEWS:1.2027.2.547.2.51 --- php-src/NEWS:1.2027.2.547.2.50 Thu May 25 08:14:28 2006 +++ php-src/NEWSThu May 25 09:59:25 2006 @@ -44,6 +44,7 @@ - Added implementation of curl_multi_info_read(). (Brian) - Added RFC2397 (data: stream) support. (Marcus) - Fixed handling of extremely long paths inside tempnam() function. (Ilia) +- Fixed bug #37587 (var without attribute causes segfault). (Marcus) - Fixed bug #37565 (Using reflection::export with simplexml causing a crash). (Marcus) - Fixed bug #37563 (array_key_exists performance is poor for $array). (Ilia) http://cvs.php.net/viewcvs.cgi/php-src/ext/wddx/wddx.c?r1=1.119.2.10r2=1.119.2.10.2.1diff_format=u Index: php-src/ext/wddx/wddx.c diff -u php-src/ext/wddx/wddx.c:1.119.2.10 php-src/ext/wddx/wddx.c:1.119.2.10.2.1 --- php-src/ext/wddx/wddx.c:1.119.2.10 Sun Apr 23 16:02:05 2006 +++ php-src/ext/wddx/wddx.c Thu May 25 09:59:25 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: wddx.c,v 1.119.2.10 2006/04/23 16:02:05 iliaa Exp $ */ +/* $Id: wddx.c,v 1.119.2.10.2.1 2006/05/25 09:59:25 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -723,7 +723,7 @@ if (!strcmp(name, EL_PACKET)) { int i; - for (i=0; atts[i]; i++) { + if (atts) for (i=0; atts[i]; i++) { if (!strcmp(atts[i], EL_VERSION)) { /* nothing for now */ } @@ -751,7 +751,7 @@ } else if (!strcmp(name, EL_CHAR)) { int i; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_CHAR_CODE) atts[++i] atts[i][0]) { char tmp_buf[2]; @@ -771,7 +771,7 @@ } else if (!strcmp(name, EL_BOOLEAN)) { int i; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_VALUE) atts[++i] atts[i][0]) { ent.type = ST_BOOLEAN; SET_STACK_VARNAME; @@ -812,7 +812,7 @@ } else if (!strcmp(name, EL_VAR)) { int i; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_NAME) atts[++i] atts[i][0]) { char *decoded; int decoded_len; @@ -829,7 +829,7 @@ MAKE_STD_ZVAL(ent.data); array_init(ent.data); - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], fieldNames) atts[++i] atts[i][0]) { zval *tmp; char *key; @@ -869,7 +869,7 @@ ent.varname = NULL; ent.data = NULL; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_NAME) atts[++i] atts[i][0]) { char *decoded; int decoded_len; http://cvs.php.net/viewcvs.cgi/php-src/ext/wddx/tests/bug37587.phpt?view=markuprev=1.1 Index: php-src/ext/wddx/tests/bug37587.phpt +++ php-src/ext/wddx/tests/bug37587.phpt --TEST-- Bug #37587 (var without attribute causes segfault) --FILE-- ?php var_dump(wddx_deserialize(file_get_contents(EOF data:,wddxPacket version='1.0' header/ data array length='1' var struct var name='test'stringHello World/string/var /struct /var /array /data /wddxPacket EOF ))); ? ===DONE=== --EXPECT-- array(1) { [0]= array(1) { [test]= string(11) Hello World } } ===DONE=== --UEXPECT-- array(1) { [0]= array(1) { [utest]= string(11) Hello World } } ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) / NEWS /ext/wddx wddx.c
helly Thu May 25 10:01:30 2006 UTC Modified files: (Branch: PHP_5_1) /php-srcNEWS /php-src/ext/wddx wddx.c Log: - MFH Fixed bug #37587 (var without attribute causes segfault http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.559r2=1.2027.2.560diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.559 php-src/NEWS:1.2027.2.560 --- php-src/NEWS:1.2027.2.559 Thu May 25 08:14:50 2006 +++ php-src/NEWSThu May 25 10:01:30 2006 @@ -1,6 +1,7 @@ PHPNEWS ||| -?? ??? 2006, PHP 5.?.? +?? ??? 2006, PHP 5.1.5 +- Fixed bug #37587 (var without attribute causes segfault). (Marcus) - Fixed bug #37576 (FastCGI env (cgi vars) table overflow). (Piotr) - Fixed bug #37496 (FastCGI output buffer overrun). (Piotr, Dmitry) - Fixed bug #37487 (oci_fetch_array() array-type should always default to http://cvs.php.net/viewcvs.cgi/php-src/ext/wddx/wddx.c?r1=1.119.2.10r2=1.119.2.11diff_format=u Index: php-src/ext/wddx/wddx.c diff -u php-src/ext/wddx/wddx.c:1.119.2.10 php-src/ext/wddx/wddx.c:1.119.2.11 --- php-src/ext/wddx/wddx.c:1.119.2.10 Sun Apr 23 16:02:05 2006 +++ php-src/ext/wddx/wddx.c Thu May 25 10:01:30 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: wddx.c,v 1.119.2.10 2006/04/23 16:02:05 iliaa Exp $ */ +/* $Id: wddx.c,v 1.119.2.11 2006/05/25 10:01:30 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -751,7 +751,7 @@ } else if (!strcmp(name, EL_CHAR)) { int i; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_CHAR_CODE) atts[++i] atts[i][0]) { char tmp_buf[2]; @@ -771,7 +771,7 @@ } else if (!strcmp(name, EL_BOOLEAN)) { int i; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_VALUE) atts[++i] atts[i][0]) { ent.type = ST_BOOLEAN; SET_STACK_VARNAME; @@ -812,7 +812,7 @@ } else if (!strcmp(name, EL_VAR)) { int i; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_NAME) atts[++i] atts[i][0]) { char *decoded; int decoded_len; @@ -829,7 +829,7 @@ MAKE_STD_ZVAL(ent.data); array_init(ent.data); - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], fieldNames) atts[++i] atts[i][0]) { zval *tmp; char *key; @@ -869,7 +869,7 @@ ent.varname = NULL; ent.data = NULL; - for (i = 0; atts[i]; i++) { + if (atts) for (i = 0; atts[i]; i++) { if (!strcmp(atts[i], EL_NAME) atts[++i] atts[i][0]) { char *decoded; int decoded_len; -- 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 README.UPDATE_5_2
helly Thu May 25 10:20:56 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS README.UPDATE_5_2 Log: - Update update news and sync with NEWS http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.51r2=1.2027.2.547.2.52diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.51 php-src/NEWS:1.2027.2.547.2.52 --- php-src/NEWS:1.2027.2.547.2.51 Thu May 25 09:59:25 2006 +++ php-src/NEWSThu May 25 10:20:56 2006 @@ -1,6 +1,7 @@ PHPNEWS ||| ?? ??? 2006, PHP 5.2.0 +- Changed E_ALL error reporting mode to includes E_RECOVERABLE_ERROR. (Marcus) - Added control character checks for cURL extension's open_basedir/safe_mode checks. (Ilia) - Disable realpath cache when open_basedir or safe_mode are enabled on a http://cvs.php.net/viewcvs.cgi/php-src/README.UPDATE_5_2?r1=1.1.2.4r2=1.1.2.5diff_format=u Index: php-src/README.UPDATE_5_2 diff -u php-src/README.UPDATE_5_2:1.1.2.4 php-src/README.UPDATE_5_2:1.1.2.5 --- php-src/README.UPDATE_5_2:1.1.2.4 Sun May 21 15:50:31 2006 +++ php-src/README.UPDATE_5_2 Thu May 25 10:20:56 2006 @@ -1,6 +1,6 @@ PHP 5.2 Update info or NEWS explained -- As of PHP 5.2 the E_ALL error reporting mode includes the E_RECOVERABLE_ERROR. +- Changed E_ALL error reporting mode to includes E_RECOVERABLE_ERROR. (Marcus) This changes means that the value of the E_ALL constant had changed to 6143 from its previous value of 2047. If you are setting your error reporting mode -- 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/tests/strings bug22224.phpt
helly Thu May 25 10:46:53 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings bug4.phpt Log: - Update test http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/strings/bug4.phpt?r1=1.2r2=1.2.6.1diff_format=u Index: php-src/ext/standard/tests/strings/bug4.phpt diff -u php-src/ext/standard/tests/strings/bug4.phpt:1.2 php-src/ext/standard/tests/strings/bug4.phpt:1.2.6.1 --- php-src/ext/standard/tests/strings/bug4.phpt:1.2Mon Mar 10 20:42:33 2003 +++ php-src/ext/standard/tests/strings/bug4.phptThu May 25 10:46:53 2006 @@ -4,7 +4,12 @@ error_reporting=0 --FILE-- ?php -class foo { +class foo +{ + function __toString() + { + return Object; + } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard/tests/strings bug22224.phpt
helly Thu May 25 10:50:53 2006 UTC Modified files: /php-src/ext/standard/tests/strings bug4.phpt Log: - MFB http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/strings/bug4.phpt?r1=1.4r2=1.5diff_format=u Index: php-src/ext/standard/tests/strings/bug4.phpt diff -u php-src/ext/standard/tests/strings/bug4.phpt:1.4 php-src/ext/standard/tests/strings/bug4.phpt:1.5 --- php-src/ext/standard/tests/strings/bug4.phpt:1.4Thu Jan 19 21:22:33 2006 +++ php-src/ext/standard/tests/strings/bug4.phptThu May 25 10:50:53 2006 @@ -4,14 +4,14 @@ error_reporting=0 --FILE-- ?php -function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { - //ignore all errors +class foo +{ + function __toString() + { + return Object; + } } -set_error_handler('test_error_handler'); - -class foo { -} $a = new foo(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl/examples dualiterator.inc recursivedualiterator.inc /ext/spl/examples/tests dualiterator_001.phpt
helly Thu May 25 17:44:59 2006 UTC Added files: /php-src/ext/spl/examples dualiterator.inc recursivedualiterator.inc /php-src/ext/spl/examples/tests dualiterator_001.phpt Log: - Add DualIterator and RecursiveDualIterator to examples including a test http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/examples/dualiterator.inc?view=markuprev=1.1 Index: php-src/ext/spl/examples/dualiterator.inc +++ php-src/ext/spl/examples/dualiterator.inc ?php /** @file DualIterator.inc * @ingroup Examples * @brief class DualIterator * @author Marcus Boerger * @date2003 - 2006 * * SPL - Standard PHP Library */ /** @ingroup Examples * @brief Synchronous iteration over two iterators * @author Marcus Boerger * @version 1.1 */ class DualIterator implements Iterator { const CURRENT_LHS = 0x01; const CURRENT_RHS = 0x02; const CURRENT_ARRAY = 0x03; const CURRENT_0 = 0x00; const KEY_LHS = 0x10; const KEY_RHS = 0x20; const KEY_ARRAY = 0x30; const KEY_0 = 0x00; const DEFAULT_FLAGS = 0x33; private $lhs; private $rhs; private $flags; /** construct iterator from two iterators * * @param lhs Left Hand Side Iterator * @param rhs Right Hand Side Iterator * @param flags iteration flags */ function __construct(Iterator $lhs, Iterator $rhs, $flags = 0x33 /*DualIterator::DEFAULT_FLAGS*/) { $this-lhs = $lhs; $this-rhs = $rhs; $this-flags = $flags; } /** @return Left Hand Side Iterator */ function getLHS() { return $this-lhs; } /** @return Right Hand Side Iterator */ function getRHS() { return $this-rhs; } /** @param flags new flags */ function setFlags($flags) { $this-flags = $flags; } /** @return current flags */ function getFlags() { return $this-flags; } /** rewind both inner iterators */ function rewind() { $this-lhs-rewind(); $this-rhs-rewind(); } /** @return whether both inner iterators are valid */ function valid() { return $this-lhs-valid() $this-rhs-valid(); } /** @return current value depending on CURRENT_* flags */ function current() { switch($this-flags 0x0F) { default: case self::CURRENT_ARRAY: return array($this-lhs-current(), $this-rhs-current()); case self::CURRENT_LHS: return $this-lhs-current(); case self::CURRENT_RHS: return $this-rhs-current(); case self::CURRENT_0: return NULL; } } /** @return current value depending on KEY_* flags */ function key() { switch($this-flags 0xF0) { default: case self::CURRENT_ARRAY: return array($this-lhs-key(), $this-rhs-key()); case self::CURRENT_LHS: return $this-lhs-key(); case self::CURRENT_RHS: return $this-rhs-key(); case self::CURRENT_0: return NULL; } } /** move both inner iterators forward */ function next() { $this-lhs-next(); $this-rhs-next(); } /** @return whether both inner iterators are valid and have identical * current and key values or both are non valid. */ function areIdentical() { return $this-valid() ? $this-lhs-current() === $this-rhs-current() $this-lhs-key() === $this-rhs-key() : $this-lhs-valid() == $this-rhs-valid(); } /** @return whether both inner iterators are valid and have equal current * and key values or both are non valid. */ function areEqual() { return $this-valid() ? $this-lhs-current() == $this-rhs-current() $this-lhs-key() == $this-rhs-key() : $this-lhs-valid() == $this-rhs-valid(); } /** Compare two iterators * * @param lhs Left Hand Side
[PHP-CVS] cvs: php-src /ext/spl/examples recursivedualiterator.inc /ext/spl/examples/tests dualiterator_001.phpt
helly Thu May 25 18:15:04 2006 UTC Modified files: /php-src/ext/spl/examples recursivedualiterator.inc /php-src/ext/spl/examples/tests dualiterator_001.phpt Log: - Make recursive part and identical part work correct http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/examples/recursivedualiterator.inc?r1=1.1r2=1.2diff_format=u Index: php-src/ext/spl/examples/recursivedualiterator.inc diff -u php-src/ext/spl/examples/recursivedualiterator.inc:1.1 php-src/ext/spl/examples/recursivedualiterator.inc:1.2 --- php-src/ext/spl/examples/recursivedualiterator.inc:1.1 Thu May 25 17:44:59 2006 +++ php-src/ext/spl/examples/recursivedualiterator.inc Thu May 25 18:15:03 2006 @@ -47,7 +47,7 @@ $this-ref = new ReflectionClass($this); } return $this-ref-newInstance( - $this-getLHS()-current(), $this-getRHS()-current(), $this-flags); + $this-getLHS()-getChildren(), $this-getRHS()-getChildren(), $this-getFlags()); } /** @return whether both inner iterators are valid, have same hasChildren() http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/examples/tests/dualiterator_001.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/spl/examples/tests/dualiterator_001.phpt diff -u php-src/ext/spl/examples/tests/dualiterator_001.phpt:1.1 php-src/ext/spl/examples/tests/dualiterator_001.phpt:1.2 --- php-src/ext/spl/examples/tests/dualiterator_001.phpt:1.1Thu May 25 17:44:59 2006 +++ php-src/ext/spl/examples/tests/dualiterator_001.phptThu May 25 18:15:04 2006 @@ -26,6 +26,10 @@ test(array(1,array(21,22),3), array(1,array(21,22,23),3)); test(array(1,array(21,22),3), array(1,array(21,22,3))); test(array(1,array(21,22),3), array(1,array(21),array(22),3)); +test(array(1,2,3), array(1,2,3), false); +test(array(1,2,3), array(1,2,3), true); +test(array(1,array(21,22),3), array(1,array(21,22),3), false); +test(array(1,array(21,22),3), array(1,array(21,22),3), true); ? ===DONE=== @@ -36,4 +40,8 @@ bool(false) bool(false) bool(false) +bool(true) +bool(false) +bool(true) +bool(false) ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/classes interfaces_003.phpt ZendEngine2 zend_execute.c ZendEngine2/tests bug33996.phpt
helly Fri May 26 00:26:45 2006 UTC Modified files: /ZendEngine2zend_execute.c /ZendEngine2/tests bug33996.phpt /php-src/tests/classes interfaces_003.phpt Log: - Sync error messages and simplify error message generation code http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.c?r1=1.744r2=1.745diff_format=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.744 ZendEngine2/zend_execute.c:1.745 --- ZendEngine2/zend_execute.c:1.744Sun May 21 12:38:28 2006 +++ ZendEngine2/zend_execute.c Fri May 26 00:26:44 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_execute.c,v 1.744 2006/05/21 12:38:28 helly Exp $ */ +/* $Id: zend_execute.c,v 1.745 2006/05/26 00:26:44 helly Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -473,12 +473,44 @@ } } +static inline char * zend_verify_arg_class_kind(zend_arg_info *cur_arg_info, zend_class_entry **pce TSRMLS_DC) +{ + *pce = zend_u_fetch_class(UG(unicode) ? IS_UNICODE : IS_STRING, cur_arg_info-class_name, cur_arg_info-class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + + if ((*pce)-ce_flags ZEND_ACC_INTERFACE) { + return implement interface ; + } else { + return be an instance of ; + } +} + +static inline int zend_verify_arg_error(zend_function *zf, zend_uint arg_num, zend_arg_info *cur_arg_info, char *need_msg, zstr need_kind, char *given_msg, zstr given_kind TSRMLS_DC) +{ + zend_execute_data *ptr = EG(current_execute_data)-prev_execute_data; + zstr fname = zf-common.function_name; + char *fsep; + zstr fclass; + + if (zf-common.scope) { + fsep = ::; + fclass = zf-common.scope-name; + } else { + fsep = ; + fclass = EMPTY_ZSTR; + } + + if (ptr ptr-op_array) { + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must %s%v, %s%v given, called in %s on line %d and defined, arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind, ptr-op_array-filename, ptr-opline-lineno); + } else { + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must %s%v, %s%v given, arg_num, fclass, fsep, fname, need_msg, need_kind, given_msg, given_kind); + } + return 0; +} + static inline int zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zval *arg TSRMLS_DC) { zend_arg_info *cur_arg_info; - zend_execute_data *ptr = EG(current_execute_data)-prev_execute_data; - char *fsep, *error_msg; - zstr fclass, fname; + char *need_msg; zend_class_entry *ce; if (!zf-common.arg_info @@ -487,91 +519,27 @@ } cur_arg_info = zf-common.arg_info[arg_num-1]; - fname = zf-common.function_name; - fsep = zf-common.scope ? :: : ; - fclass = zf-common.scope ? zf-common.scope-name : EMPTY_ZSTR; if (cur_arg_info-class_name.v) { if (!arg) { - if (ptr ptr-op_array) { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, none given, called in %s on line %d and defined, arg_num, fclass, fsep, fname, cur_arg_info-class_name, ptr-op_array-filename, ptr-opline-lineno); - } else { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, none given, arg_num, fclass, fsep, fname, cur_arg_info-class_name); - } - return 0; + need_msg = zend_verify_arg_class_kind(cur_arg_info, ce TSRMLS_CC); + return zend_verify_arg_error(zf, arg_num, cur_arg_info, need_msg, ce-name, none, EMPTY_ZSTR TSRMLS_CC); } - switch (Z_TYPE_P(arg)) { - case IS_NULL: - if (!cur_arg_info-allow_null) { - if (ptr ptr-op_array) { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, null given, called in %s on line %d and defined, arg_num, fclass, fsep, fname, cur_arg_info-class_name, ptr-op_array-filename, ptr-opline-lineno); - } else { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, null given, arg_num, fclass, fsep, fname, cur_arg_info-class_name); - } - return 0; - } - break; - case IS_OBJECT: { - ce =
[PHP-CVS] cvs: php-src /ext/spl php_spl.c spl_iterators.c spl_iterators.h
helly Fri May 26 00:37:33 2006 UTC Modified files: /php-src/ext/splphp_spl.c spl_iterators.c spl_iterators.h Log: - Add function iterator_apply() http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/php_spl.c?r1=1.90r2=1.91diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.90 php-src/ext/spl/php_spl.c:1.91 --- php-src/ext/spl/php_spl.c:1.90 Wed May 10 21:09:31 2006 +++ php-src/ext/spl/php_spl.c Fri May 26 00:37:32 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.90 2006/05/10 21:09:31 helly Exp $ */ +/* $Id: php_spl.c,v 1.91 2006/05/26 00:37:32 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -621,7 +621,14 @@ static ZEND_BEGIN_ARG_INFO(arginfo_iterator, 0) - ZEND_ARG_INFO(0, iterator) + ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) +ZEND_END_ARG_INFO(); + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_iterator_apply, 0, 0, 2) + ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) + ZEND_ARG_INFO(0, function) + ZEND_ARG_ARRAY_INFO(0, args, 0) ZEND_END_ARG_INFO(); /* {{{ spl_functions @@ -639,6 +646,7 @@ #ifdef SPL_ITERATORS_H PHP_FE(iterator_to_array, arginfo_iterator) PHP_FE(iterator_count, arginfo_iterator) + PHP_FE(iterator_apply, arginfo_iterator_apply) #endif /* SPL_ITERATORS_H */ {NULL, NULL, NULL} }; http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.134r2=1.135diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.134 php-src/ext/spl/spl_iterators.c:1.135 --- php-src/ext/spl/spl_iterators.c:1.134 Sun May 21 17:36:52 2006 +++ php-src/ext/spl/spl_iterators.c Fri May 26 00:37:33 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.134 2006/05/21 17:36:52 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.135 2006/05/26 00:37:33 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -2612,7 +2612,7 @@ Copy the iterator into an array */ PHP_FUNCTION(iterator_to_array) { - zval *obj; + zval *obj; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, O, obj, zend_ce_traversable) == FAILURE) { RETURN_FALSE; @@ -2637,8 +2637,8 @@ Count the elements in an iterator */ PHP_FUNCTION(iterator_count) { - zval *obj; - longcount = 0; + zval *obj; + long count = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, O, obj, zend_ce_traversable) == FAILURE) { RETURN_FALSE; @@ -2650,6 +2650,53 @@ } /* }}} */ +typedef struct { + zval *obj; + zval *args; + long count; + zend_fcall_infofci; + zend_fcall_info_cache fcc; +} spl_iterator_apply_info; + +static int spl_iterator_func_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */ +{ + zval *retval; + spl_iterator_apply_info *apply_info = (spl_iterator_apply_info*)puser; + int result; + + apply_info-count++; + zend_fcall_info_call(apply_info-fci, apply_info-fcc, retval, NULL TSRMLS_CC); + if (retval) { + result = zend_is_true(retval) ? ZEND_HASH_APPLY_KEEP : ZEND_HASH_APPLY_STOP; + zval_ptr_dtor(retval); + } else { + result = ZEND_HASH_APPLY_STOP; + } + return result; +} +/* }}} */ + +/* {{{ proto int iterator_apply(Traversable it, mixed function [, mixed params]) + Calls a function for every element in an iterator */ +PHP_FUNCTION(iterator_apply) +{ + spl_iterator_apply_info apply_info; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Of|a, apply_info.obj, zend_ce_traversable, apply_info.fci, apply_info.fcc, apply_info.args) == FAILURE) { + RETURN_FALSE; + } + + apply_info.count = 0; + zend_fcall_info_args(apply_info.fci, apply_info.args TSRMLS_CC); + if (spl_iterator_apply(apply_info.obj, spl_iterator_func_apply, (void*)apply_info TSRMLS_CC) == SUCCESS) { + RETVAL_LONG(apply_info.count); + } else { + RETVAL_FALSE; + } + zend_fcall_info_args(apply_info.fci, NULL TSRMLS_CC); +} +/* }}} */ + static zend_function_entry spl_funcs_OuterIterator[] = { SPL_ABSTRACT_ME(OuterIterator, getInnerIterator, NULL) {NULL, NULL, NULL} http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.h?r1=1.35r2=1.36diff_format=u Index: php-src/ext/spl/spl_iterators.h diff -u php-src/ext/spl/spl_iterators.h:1.35 php-src/ext/spl/spl_iterators.h:1.36 --- php-src/ext/spl/spl_iterators.h:1.35Sun May 21 17:27:12 2006 +++ php-src/ext/spl/spl_iterators.h Fri May 26 00:37:33 2006 @@ -16,7 +16,7 @@
[PHP-CVS] cvs: php-src /ext/spl php_spl.c
helly Fri May 26 00:49:02 2006 UTC Modified files: /php-src/ext/splphp_spl.c Log: - Fix type hint http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/php_spl.c?r1=1.91r2=1.92diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.91 php-src/ext/spl/php_spl.c:1.92 --- php-src/ext/spl/php_spl.c:1.91 Fri May 26 00:37:32 2006 +++ php-src/ext/spl/php_spl.c Fri May 26 00:49:02 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.91 2006/05/26 00:37:32 helly Exp $ */ +/* $Id: php_spl.c,v 1.92 2006/05/26 00:49:02 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -621,12 +621,12 @@ static ZEND_BEGIN_ARG_INFO(arginfo_iterator, 0) - ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) + ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) ZEND_END_ARG_INFO(); static ZEND_BEGIN_ARG_INFO_EX(arginfo_iterator_apply, 0, 0, 2) - ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0) + ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) ZEND_ARG_INFO(0, function) ZEND_ARG_ARRAY_INFO(0, args, 0) ZEND_END_ARG_INFO(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl php_spl.c spl_iterators.c /ext/spl/tests spl_004.phpt
helly Fri May 26 01:40:57 2006 UTC Added files: /php-src/ext/spl/tests spl_004.phpt Modified files: /php-src/ext/splphp_spl.c spl_iterators.c Log: - Fix handling of third parameter to iterator_apply() - Add test http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/php_spl.c?r1=1.92r2=1.93diff_format=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.92 php-src/ext/spl/php_spl.c:1.93 --- php-src/ext/spl/php_spl.c:1.92 Fri May 26 00:49:02 2006 +++ php-src/ext/spl/php_spl.c Fri May 26 01:40:57 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.92 2006/05/26 00:49:02 helly Exp $ */ +/* $Id: php_spl.c,v 1.93 2006/05/26 01:40:57 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -628,7 +628,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_iterator_apply, 0, 0, 2) ZEND_ARG_OBJ_INFO(0, iterator, Traversable, 0) ZEND_ARG_INFO(0, function) - ZEND_ARG_ARRAY_INFO(0, args, 0) + ZEND_ARG_ARRAY_INFO(0, args, 1) ZEND_END_ARG_INFO(); /* {{{ spl_functions http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.135r2=1.136diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.135 php-src/ext/spl/spl_iterators.c:1.136 --- php-src/ext/spl/spl_iterators.c:1.135 Fri May 26 00:37:33 2006 +++ php-src/ext/spl/spl_iterators.c Fri May 26 01:40:57 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.135 2006/05/26 00:37:33 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.136 2006/05/26 01:40:57 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -2682,8 +2682,9 @@ { spl_iterator_apply_info apply_info; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Of|a, apply_info.obj, zend_ce_traversable, apply_info.fci, apply_info.fcc, apply_info.args) == FAILURE) { - RETURN_FALSE; + apply_info.args = NULL; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Of|a!, apply_info.obj, zend_ce_traversable, apply_info.fci, apply_info.fcc, apply_info.args) == FAILURE) { + return; } apply_info.count = 0; http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/tests/spl_004.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/spl_004.phpt +++ php-src/ext/spl/tests/spl_004.phpt --TEST-- SPL: iterator_apply() --SKIPIF-- ?php if (!extension_loaded(spl)) print skip; ? --FILE-- ?php function my_error_handler($errno, $errstr, $errfile, $errline) { echo Error: $errstr\n; } set_error_handler('my_error_handler'); function test_arg($arg) { if ($arg instanceof Iterator) { var_dump($arg-key()); var_dump($arg-current()); } else { var_dump($arg); } return true; } function test() { static $arg = 0; var_dump($arg++); return true; } $it = new RecursiveArrayIterator(array(1, array(21, 22), 3)); var_dump(iterator_apply($it, 'test', NULL)); echo ===ARGS===\n; var_dump(iterator_apply($it, 'test_arg', array($it))); echo ===RECURSIVE===\n; $it = new RecursiveIteratorIterator($it); var_dump(iterator_apply($it, 'test')); echo ===ERRORS===\n; var_dump(iterator_apply($it, 'test', 1)); var_dump(iterator_apply($it, 'non_existing_functon')); var_dump(iterator_apply($it, 'non_existing_functon', NULL, 2)); ? ===DONE=== ?php exit(0); ? --EXPECTF-- int(0) int(1) int(2) int(3) ===ARGS=== int(0) int(1) int(1) array(2) { [0]= int(21) [1]= int(22) } int(2) int(3) int(3) ===RECURSIVE=== int(3) int(4) int(5) int(6) int(4) ===ERRORS=== Error: Argument 3 passed to iterator_apply() must be an array, integer given Error: iterator_apply() expects parameter 3 to be array, integer given NULL Error: iterator_apply() expects parameter 2 to be function,%sstring given NULL Error: iterator_apply() expects at most 3 parameters, 4 given 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/simplexml simplexml.c
helly Tue May 23 21:37:18 2006 UTC Modified files: /php-src/ext/simplexml simplexml.c Log: - Fix SEGV in case class to generate is not derived from SimpleXMLElement by issueing an error http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/simplexml.c?r1=1.207r2=1.208diff_format=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.207 php-src/ext/simplexml/simplexml.c:1.208 --- php-src/ext/simplexml/simplexml.c:1.207 Wed May 17 00:07:05 2006 +++ php-src/ext/simplexml/simplexml.c Tue May 23 21:37:17 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: simplexml.c,v 1.207 2006/05/17 00:07:05 helly Exp $ */ +/* $Id: simplexml.c,v 1.208 2006/05/23 21:37:17 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1830,13 +1830,13 @@ char *filename; int filename_len; xmlDocPtr docp; - char *classname = NULL, *ns = NULL; - int classname_len = 0, ns_len = 0; + char *ns = NULL; + int ns_len = 0; longoptions = 0; zend_class_entry *ce= sxe_class_entry; zend_bool isprefix = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|slsb, filename, filename_len, classname, classname_len, options, ns, ns_len, isprefix) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|Clsb, filename, filename_len, ce, options, ns, ns_len, isprefix) == FAILURE) { return; } @@ -1846,14 +1846,6 @@ RETURN_FALSE; } - if (classname_len) { - zend_class_entry **pce; - if (zend_lookup_class(classname, classname_len, pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, Class %s does not exist, classname); - } - ce = *pce; - } - sxe = php_sxe_object_new(ce TSRMLS_CC); sxe-iter.nsprefix = ns_len ? xmlStrdup(ns) : NULL; sxe-iter.isprefix = isprefix; @@ -1873,13 +1865,13 @@ char *data; int data_len; xmlDocPtr docp; - char *classname = NULL, *ns = NULL; - int classname_len = 0, ns_len = 0; + char *ns = NULL; + int ns_len = 0; longoptions = 0; zend_class_entry *ce= sxe_class_entry; zend_bool isprefix = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|slsb, data, data_len, classname, classname_len, options, ns, ns_len, isprefix) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|Clsb, data, data_len, ce, options, ns, ns_len, isprefix) == FAILURE) { return; } @@ -1889,14 +1881,6 @@ RETURN_FALSE; } - if (classname_len) { - zend_class_entry **pce; - if (zend_lookup_class(classname, classname_len, pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, Class %s does not exist, classname); - } - ce = *pce; - } - sxe = php_sxe_object_new(ce TSRMLS_CC); sxe-iter.nsprefix = ns_len ? xmlStrdup(ns) : NULL; sxe-iter.isprefix = isprefix; @@ -2144,11 +2128,9 @@ zval *node; php_libxml_node_object *object; xmlNodePtr nodep = NULL; - char *classname = ; - int classname_len = 0; zend_class_entry *ce= sxe_class_entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o|s, node, classname, classname_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o|C, node, ce) == FAILURE) { return; } @@ -2167,14 +2149,6 @@ } if (nodep nodep-type == XML_ELEMENT_NODE) { - if (classname_len) { - zend_class_entry **pce; - if (zend_lookup_class(classname, classname_len, pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, Class %s does not exist, classname); - } - ce = *pce; - } - sxe = php_sxe_object_new(ce TSRMLS_CC); sxe-document = object-document; php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, nodep-doc TSRMLS_CC); @@ -2279,7 +2253,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, Simplexml support, enabled); - php_info_print_table_row(2, Revision, $Revision: 1.207 $); + php_info_print_table_row(2, Revision, $Revision: 1.208 $); php_info_print_table_row(2, Schema support, #ifdef LIBXML_SCHEMAS_ENABLED
[PHP-CVS] cvs: php-src /ext/simplexml/tests bug37565.phpt
helly Tue May 23 21:56:36 2006 UTC Added files: /php-src/ext/simplexml/testsbug37565.phpt Log: - Add new test http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/tests/bug37565.phpt?view=markuprev=1.1 Index: php-src/ext/simplexml/tests/bug37565.phpt +++ php-src/ext/simplexml/tests/bug37565.phpt --TEST-- Bug #37565 Using reflection::export with simplexml causing a crash --FILE-- ?php class Setting extends ReflectionObject { } Reflection::export(simplexml_load_string('test/', 'Setting')); Reflection::export(simplexml_load_file('data:,test/', 'Setting')); ? ===DONE=== --EXPECTF-- Warning: simplexml_load_string() expects parameter 2 to be a class name derived from SimpleXMLElement, 'Setting' given in %sbug37565.php on line %d Warning: Reflection::export() expects parameter 1 to be Reflector, null given in %sbug37565.php on line %d Warning: simplexml_load_file() expects parameter 2 to be a class name derived from SimpleXMLElement, 'Setting' given in %sbug37565.php on line %d Warning: Reflection::export() expects parameter 1 to be Reflector, null given in %sbug37565.php on line %d ===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) / NEWS /ext/simplexml simplexml.c /ext/simplexml/tests bug37565.phpt
helly Tue May 23 21:58:45 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/simplexml/testsbug37565.phpt Modified files: /php-srcNEWS /php-src/ext/simplexml simplexml.c Log: - MFH Bugfix #37565 http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.39r2=1.2027.2.547.2.40diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.39 php-src/NEWS:1.2027.2.547.2.40 --- php-src/NEWS:1.2027.2.547.2.39 Mon May 22 19:04:19 2006 +++ php-src/NEWSTue May 23 21:58:44 2006 @@ -43,6 +43,8 @@ - Added pg_field_table() function. (Edin) - Added implementation of curl_multi_info_read(). (Brian) - Added RFC2397 (data: stream) support. (Marcus) +- Fixed bug #37565 (Using reflection::export with simplexml causing a crash). + (Marcus) - Fixed bug #37514 (strtotime doesn't assume year correctly). (Derick) - Fixed bug #37510 (session_regenerate_id changes session_id() even on failure). (Hannes) http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.3r2=1.151.2.22.2.4diff_format=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.3 php-src/ext/simplexml/simplexml.c:1.151.2.22.2.4 --- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.3Wed May 17 00:07:28 2006 +++ php-src/ext/simplexml/simplexml.c Tue May 23 21:58:44 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: simplexml.c,v 1.151.2.22.2.3 2006/05/17 00:07:28 helly Exp $ */ +/* $Id: simplexml.c,v 1.151.2.22.2.4 2006/05/23 21:58:44 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1837,12 +1837,10 @@ char *filename; int filename_len; xmlDocPtr docp; - char *classname = ; - int classname_len = 0; longoptions = 0; zend_class_entry *ce= sxe_class_entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|sl, filename, filename_len, classname, classname_len, options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|Cl, filename, filename_len, ce, options) == FAILURE) { return; } @@ -1852,14 +1850,6 @@ RETURN_FALSE; } - if (classname_len) { - zend_class_entry **pce; - if (zend_lookup_class(classname, classname_len, pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, Class %s does not exist, classname); - } - ce = *pce; - } - sxe = php_sxe_object_new(ce TSRMLS_CC); php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC); php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC); @@ -1877,12 +1867,10 @@ char *data; int data_len; xmlDocPtr docp; - char *classname = ; - int classname_len = 0; longoptions = 0; zend_class_entry *ce= sxe_class_entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|sl, data, data_len, classname, classname_len, options) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|Cl, data, data_len, ce, options) == FAILURE) { return; } @@ -1892,14 +1880,6 @@ RETURN_FALSE; } - if (classname_len) { - zend_class_entry **pce; - if (zend_lookup_class(classname, classname_len, pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, Class %s does not exist, classname); - } - ce = *pce; - } - sxe = php_sxe_object_new(ce TSRMLS_CC); php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, docp TSRMLS_CC); php_libxml_increment_node_ptr((php_libxml_node_object *)sxe, xmlDocGetRootElement(docp), NULL TSRMLS_CC); @@ -2131,11 +2111,9 @@ zval *node; php_libxml_node_object *object; xmlNodePtr nodep = NULL; - char *classname = ; - int classname_len = 0; zend_class_entry *ce= sxe_class_entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o|s, node, classname, classname_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o|C, node, ce) == FAILURE) { return; } @@ -2154,14 +2132,6 @@ } if (nodep nodep-type == XML_ELEMENT_NODE) { - if (classname_len) { - zend_class_entry **pce; - if (zend_lookup_class(classname, classname_len, pce TSRMLS_CC) == FAILURE) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, Class %s
[PHP-CVS] cvs: php-src /ext/simplexml simplexml.c
helly Tue May 23 22:22:35 2006 UTC Modified files: /php-src/ext/simplexml simplexml.c Log: - Readd NULL as allowed classname to skip parameter http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/simplexml.c?r1=1.208r2=1.209diff_format=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.208 php-src/ext/simplexml/simplexml.c:1.209 --- php-src/ext/simplexml/simplexml.c:1.208 Tue May 23 21:37:17 2006 +++ php-src/ext/simplexml/simplexml.c Tue May 23 22:22:35 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: simplexml.c,v 1.208 2006/05/23 21:37:17 helly Exp $ */ +/* $Id: simplexml.c,v 1.209 2006/05/23 22:22:35 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -1836,7 +1836,7 @@ zend_class_entry *ce= sxe_class_entry; zend_bool isprefix = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|Clsb, filename, filename_len, ce, options, ns, ns_len, isprefix) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|C!lsb, filename, filename_len, ce, options, ns, ns_len, isprefix) == FAILURE) { return; } @@ -1846,6 +1846,9 @@ RETURN_FALSE; } + if (!ce) { + ce = sxe_class_entry; + } sxe = php_sxe_object_new(ce TSRMLS_CC); sxe-iter.nsprefix = ns_len ? xmlStrdup(ns) : NULL; sxe-iter.isprefix = isprefix; @@ -1871,7 +1874,7 @@ zend_class_entry *ce= sxe_class_entry; zend_bool isprefix = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|Clsb, data, data_len, ce, options, ns, ns_len, isprefix) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|C!lsb, data, data_len, ce, options, ns, ns_len, isprefix) == FAILURE) { return; } @@ -1881,6 +1884,9 @@ RETURN_FALSE; } + if (!ce) { + ce = sxe_class_entry; + } sxe = php_sxe_object_new(ce TSRMLS_CC); sxe-iter.nsprefix = ns_len ? xmlStrdup(ns) : NULL; sxe-iter.isprefix = isprefix; @@ -2130,7 +2136,7 @@ xmlNodePtr nodep = NULL; zend_class_entry *ce= sxe_class_entry; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o|C, node, ce) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, o|C!, node, ce) == FAILURE) { return; } @@ -2149,6 +2155,9 @@ } if (nodep nodep-type == XML_ELEMENT_NODE) { + if (!ce) { + ce = sxe_class_entry; + } sxe = php_sxe_object_new(ce TSRMLS_CC); sxe-document = object-document; php_libxml_increment_doc_ref((php_libxml_node_object *)sxe, nodep-doc TSRMLS_CC); @@ -2253,7 +2262,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, Simplexml support, enabled); - php_info_print_table_row(2, Revision, $Revision: 1.208 $); + php_info_print_table_row(2, Revision, $Revision: 1.209 $); php_info_print_table_row(2, Schema support, #ifdef LIBXML_SCHEMAS_ENABLED enabled); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS
helly Tue May 23 22:24:10 2006 UTC Modified files: /php-srcNEWS Log: - Done in 5.2 http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2116r2=1.2117diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2116 php-src/NEWS:1.2117 --- php-src/NEWS:1.2116 Fri May 19 10:44:34 2006 +++ php-src/NEWSTue May 23 22:24:10 2006 @@ -15,7 +15,6 @@ . register_globals support. (Pierre) . register_long_arrays ini option. (Dmitry) . safe_mode support. (Ilia, Andi) - . zend.ze1_compatibility_mode ini option. (Dmitry) . allow_call_time_pass_reference, added E_STRICT error message. (Dmitry) . session_register(), session_unregister() and session_is_registered() (needed only with register_globals=On). -- 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/simplexml php_simplexml.h simplexml.c /ext/simplexml/tests profile12.phpt profile13.phpt
helly Tue May 23 22:24:44 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/simplexml/testsprofile12.phpt profile13.phpt Modified files: /php-src/ext/simplexml php_simplexml.h simplexml.c Log: - MFH Sync with head (namespace prefix handling) http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/php_simplexml.h?r1=1.20.2.2r2=1.20.2.2.2.1diff_format=u Index: php-src/ext/simplexml/php_simplexml.h diff -u php-src/ext/simplexml/php_simplexml.h:1.20.2.2 php-src/ext/simplexml/php_simplexml.h:1.20.2.2.2.1 --- php-src/ext/simplexml/php_simplexml.h:1.20.2.2 Sun Feb 26 23:14:45 2006 +++ php-src/ext/simplexml/php_simplexml.h Tue May 23 22:24:43 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_simplexml.h,v 1.20.2.2 2006/02/26 23:14:45 helly Exp $ */ +/* $Id: php_simplexml.h,v 1.20.2.2.2.1 2006/05/23 22:24:43 helly Exp $ */ #ifndef PHP_SIMPLEXML_H #define PHP_SIMPLEXML_H @@ -67,9 +67,9 @@ HashTable *properties; xmlXPathContextPtr xpath; struct { - int itertype; char *name; char *nsprefix; + int isprefix; SXE_ITER type; zval *data; } iter; http://cvs.php.net/viewcvs.cgi/php-src/ext/simplexml/simplexml.c?r1=1.151.2.22.2.4r2=1.151.2.22.2.5diff_format=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.151.2.22.2.4 php-src/ext/simplexml/simplexml.c:1.151.2.22.2.5 --- php-src/ext/simplexml/simplexml.c:1.151.2.22.2.4Tue May 23 21:58:44 2006 +++ php-src/ext/simplexml/simplexml.c Tue May 23 22:24:43 2006 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: simplexml.c,v 1.151.2.22.2.4 2006/05/23 21:58:44 helly Exp $ */ +/* $Id: simplexml.c,v 1.151.2.22.2.5 2006/05/23 22:24:43 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -58,7 +58,7 @@ /* {{{ _node_as_zval() */ -static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, int itertype, char *name, char *prefix TSRMLS_DC) +static void _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value, SXE_ITER itertype, char *name, char *nsprefix, int isprefix TSRMLS_DC) { php_sxe_object *subnode; @@ -69,8 +69,9 @@ if (name) { subnode-iter.name = xmlStrdup(name); } - if (prefix) { - subnode-iter.nsprefix = xmlStrdup(prefix); + if (nsprefix *nsprefix) { + subnode-iter.nsprefix = xmlStrdup(nsprefix); + subnode-iter.isprefix = isprefix; } php_libxml_increment_node_ptr((php_libxml_node_object *)subnode, node, NULL TSRMLS_CC); @@ -116,13 +117,13 @@ } } -static inline int match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name) /* {{{ */ +static inline int match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name, int prefix) /* {{{ */ { if (name == NULL (node-ns == NULL || node-ns-prefix == NULL)) { return 1; } - if (node-ns !xmlStrcmp(node-ns-href, name)) { + if (node-ns !xmlStrcmp(prefix ? node-ns-prefix : node-ns-href, name)) { return 1; } @@ -139,7 +140,7 @@ } while (node nodendx = offset) { SKIP_TEXT(node) - if (node-type == XML_ELEMENT_NODE match_ns(sxe, node, sxe-iter.nsprefix)) { + if (node-type == XML_ELEMENT_NODE match_ns(sxe, node, sxe-iter.nsprefix, sxe-iter.isprefix)) { if (sxe-iter.type == SXE_ITER_CHILD || ( sxe-iter.type == SXE_ITER_ELEMENT !xmlStrcmp(node-name, sxe-iter.name))) { if (nodendx == offset) { @@ -164,7 +165,7 @@ { while (node) { SKIP_TEXT(node) - if (node-type == XML_ELEMENT_NODE match_ns(sxe, node, sxe-iter.nsprefix)) { + if (node-type == XML_ELEMENT_NODE match_ns(sxe, node, sxe-iter.nsprefix, sxe-iter.isprefix)) { if (!xmlStrcmp(node-name, name)) { return node; } @@ -198,7 +199,7 @@ while (node) { SKIP_TEXT(node) - if (node-type == XML_ELEMENT_NODE match_ns(sxe, node, sxe-iter.nsprefix)) { + if (node-type == XML_ELEMENT_NODE match_ns(sxe, node, sxe-iter.nsprefix, sxe-iter.isprefix)) { if (!xmlStrcmp(node-name, *name)) { if (1||retnode) { @@ -276,9 +277,9 @@ if (Z_TYPE_P(member) != IS_LONG || sxe-iter.type == SXE_ITER_ATTRLIST) { if
[PHP-CVS] cvs: php-src /main/streams memory.c
helly Tue May 23 22:26:23 2006 UTC Modified files: /php-src/main/streams memory.c Log: - Fix feof() with temp/memory streams http://cvs.php.net/viewcvs.cgi/php-src/main/streams/memory.c?r1=1.21r2=1.22diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.21 php-src/main/streams/memory.c:1.22 --- php-src/main/streams/memory.c:1.21 Sun May 21 13:35:06 2006 +++ php-src/main/streams/memory.c Tue May 23 22:26:23 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.21 2006/05/21 13:35:06 helly Exp $ */ +/* $Id: memory.c,v 1.22 2006/05/23 22:26:23 helly Exp $ */ #define _GNU_SOURCE #include php.h @@ -88,16 +88,15 @@ php_stream_memory_data *ms = (php_stream_memory_data*)stream-abstract; assert(ms != NULL); - if (ms-fpos + count ms-fsize) { + if (ms-fpos + count = ms-fsize) { count = ms-fsize - ms-fpos; + stream-eof = 1; } if (count) { assert(ms-data!= NULL); assert(buf!= NULL); memcpy(buf, ms-data+ms-fpos, count); ms-fpos += count; - } else { - stream-eof = 1; } return count; } @@ -147,6 +146,7 @@ } else { ms-fpos = ms-fpos + offset; *newoffs = ms-fpos; + stream-eof = 0; return 0; } } else { @@ -157,6 +157,7 @@ } else { ms-fpos = ms-fpos + offset; *newoffs = ms-fpos; + stream-eof = 0; return 0; } } @@ -168,6 +169,7 @@ } else { ms-fpos = offset; *newoffs = ms-fpos; + stream-eof = 0; return 0; } case SEEK_END: @@ -182,6 +184,7 @@ } else { ms-fpos = ms-fsize + offset; *newoffs = ms-fpos; + stream-eof = 0; return 0; } default: @@ -359,9 +362,7 @@ got = php_stream_read(ts-innerstream, buf, count); - if (!got) { - stream-eof |= ts-innerstream-eof; - } + stream-eof = ts-innerstream-eof; return got; } @@ -418,6 +419,7 @@ } ret = php_stream_seek(ts-innerstream, offset, whence); *newoffs = php_stream_tell(ts-innerstream); + stream-eof = ts-innerstream-eof; return ret; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard/tests/file stream_rfc2397_007.phpt
helly Tue May 23 22:26:55 2006 UTC Added files: /php-src/ext/standard/tests/filestream_rfc2397_007.phpt Log: - Add new test http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/file/stream_rfc2397_007.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/file/stream_rfc2397_007.phpt +++ php-src/ext/standard/tests/file/stream_rfc2397_007.phpt --TEST-- Stream: RFC2397 and seeking --FILE-- ?php $streams = array( data:,012345, ); foreach($streams as $stream) { echo ===$stream===\n; $fp = fopen($stream, 'rb'); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:4,S===\n; var_dump(fseek($fp, 4)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===GETC===\n; var_dump(fgetc($fp)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===GETC===\n; var_dump(fgetc($fp)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===REWIND===\n; var_dump(rewind($fp)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===GETC===\n; var_dump(fgetc($fp)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:3,S===\n; var_dump(fseek($fp, 3, SEEK_SET)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:1,C===\n; var_dump(fseek($fp, 1, SEEK_CUR)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:-2,C===\n; var_dump(fseek($fp, -2, SEEK_CUR)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:-10,C===\n; var_dump(fseek($fp, -10, SEEK_CUR)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:3,S===\n; var_dump(fseek($fp, 3, SEEK_SET)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:10,C===\n; var_dump(fseek($fp, 10, SEEK_CUR)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:-1,E===\n; var_dump(fseek($fp, -1, SEEK_END)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:0,E===\n; var_dump(fseek($fp, 0, SEEK_END)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:1,E===\n; var_dump(fseek($fp, 1, SEEK_END)); var_dump(ftell($fp)); var_dump(feof($fp)); fclose($fp); } ? ===DONE=== ?php exit(0); ? --EXPECTF-- ===data:,012345=== int(0) bool(false) ===S:4,S=== int(0) int(4) bool(false) ===GETC=== string(1) 4 int(5) bool(false) ===GETC=== string(1) 5 int(6) bool(true) ===REWIND=== bool(true) int(0) bool(false) ===GETC=== string(1) 0 int(1) bool(false) ===S:3,S=== int(0) int(3) bool(false) ===S:1,C=== int(0) int(4) bool(false) ===S:-2,C=== int(0) int(2) bool(false) ===S:-10,C=== int(-1) bool(false) bool(false) ===S:3,S=== int(0) int(3) bool(false) ===S:10,C=== int(-1) bool(false) bool(false) ===S:-1,E=== int(0) int(5) bool(false) ===S:0,E=== int(0) int(6) bool(false) ===S:1,E=== int(-1) bool(false) bool(false) ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/file stream_rfc2397_007.phpt /main/streams memory.c
helly Tue May 23 22:31:25 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/filestream_rfc2397_007.phpt Modified files: /php-src/main/streams memory.c Log: - MFH Fix feof() http://cvs.php.net/viewcvs.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.5r2=1.8.2.6.2.6diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.5 php-src/main/streams/memory.c:1.8.2.6.2.6 --- php-src/main/streams/memory.c:1.8.2.6.2.5 Sun May 21 13:37:19 2006 +++ php-src/main/streams/memory.c Tue May 23 22:31:25 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.5 2006/05/21 13:37:19 helly Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.6 2006/05/23 22:31:25 helly Exp $ */ #define _GNU_SOURCE #include php.h @@ -88,16 +88,15 @@ php_stream_memory_data *ms = (php_stream_memory_data*)stream-abstract; assert(ms != NULL); - if (ms-fpos + count ms-fsize) { + if (ms-fpos + count = ms-fsize) { count = ms-fsize - ms-fpos; + stream-eof = 1; } if (count) { assert(ms-data!= NULL); assert(buf!= NULL); memcpy(buf, ms-data+ms-fpos, count); ms-fpos += count; - } else { - stream-eof = 1; } return count; } @@ -147,6 +146,7 @@ } else { ms-fpos = ms-fpos + offset; *newoffs = ms-fpos; + stream-eof = 0; return 0; } } else { @@ -157,6 +157,7 @@ } else { ms-fpos = ms-fpos + offset; *newoffs = ms-fpos; + stream-eof = 0; return 0; } } @@ -168,6 +169,7 @@ } else { ms-fpos = offset; *newoffs = ms-fpos; + stream-eof = 0; return 0; } case SEEK_END: @@ -182,6 +184,7 @@ } else { ms-fpos = ms-fsize + offset; *newoffs = ms-fpos; + stream-eof = 0; return 0; } default: @@ -359,9 +362,7 @@ got = php_stream_read(ts-innerstream, buf, count); - if (!got) { - stream-eof |= ts-innerstream-eof; - } + stream-eof = ts-innerstream-eof; return got; } @@ -418,6 +419,7 @@ } ret = php_stream_seek(ts-innerstream, offset, whence); *newoffs = php_stream_tell(ts-innerstream); + stream-eof = ts-innerstream-eof; return ret; } http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/file/stream_rfc2397_007.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/file/stream_rfc2397_007.phpt +++ php-src/ext/standard/tests/file/stream_rfc2397_007.phpt --TEST-- Stream: RFC2397 and seeking --FILE-- ?php $streams = array( data:,012345, ); foreach($streams as $stream) { echo ===$stream===\n; $fp = fopen($stream, 'rb'); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:4,S===\n; var_dump(fseek($fp, 4)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===GETC===\n; var_dump(fgetc($fp)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===GETC===\n; var_dump(fgetc($fp)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===REWIND===\n; var_dump(rewind($fp)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===GETC===\n; var_dump(fgetc($fp)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:3,S===\n; var_dump(fseek($fp, 3, SEEK_SET)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:1,C===\n; var_dump(fseek($fp, 1, SEEK_CUR)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:-2,C===\n; var_dump(fseek($fp, -2, SEEK_CUR)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:-10,C===\n; var_dump(fseek($fp, -10, SEEK_CUR)); var_dump(ftell($fp)); var_dump(feof($fp)); echo ===S:3,S===\n; var_dump(fseek($fp, 3, SEEK_SET)); var_dump(ftell($fp));
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/array array_combine.phpt array_diff_assoc.phpt
helly Tue May 23 23:47:44 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/array array_combine.phpt array_diff_assoc.phpt Log: - MFH Add more tests from Ligaya Turmelle http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/array/array_combine.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/array/array_combine.phpt +++ php-src/ext/standard/tests/array/array_combine.phpt --TEST-- basic array_combine test --FILE-- ?php $array1 = array('green', 'red', 'yellow'); $array2 = array('1', '2', '3'); $array3 = array(0, 1, 2); $array4 = array(TRUE, FALSE, NULL); $a = array_combine($array1, $array1); $b = array_combine($array1, $array2); $c = array_combine($array1, $array3); $d = array_combine($array1, $array4); $e = array_combine($array2, $array1); $f = array_combine($array2, $array2); $g = array_combine($array2, $array3); $h = array_combine($array2, $array4); $i = array_combine($array3, $array1); $j = array_combine($array3, $array2); $k = array_combine($array3, $array3); $l = array_combine($array3, $array4); $m = array_combine($array4, $array1); $n = array_combine($array4, $array2); $o = array_combine($array4, $array3); $p = array_combine($array4, $array4); for($letter = a; $letter = p; $letter++) { print_r($$letter); } ? --EXPECT-- Array ( [green] = green [red] = red [yellow] = yellow ) Array ( [green] = 1 [red] = 2 [yellow] = 3 ) Array ( [green] = 0 [red] = 1 [yellow] = 2 ) Array ( [green] = 1 [red] = [yellow] = ) Array ( [1] = green [2] = red [3] = yellow ) Array ( [1] = 1 [2] = 2 [3] = 3 ) Array ( [1] = 0 [2] = 1 [3] = 2 ) Array ( [1] = 1 [2] = [3] = ) Array ( [0] = green [1] = red [2] = yellow ) Array ( [0] = 1 [1] = 2 [2] = 3 ) Array ( [0] = 0 [1] = 1 [2] = 2 ) Array ( [0] = 1 [1] = [2] = ) Array ( [1] = green [] = yellow ) Array ( [1] = 1 [] = 3 ) Array ( [1] = 0 [] = 2 ) Array ( [1] = 1 [] = ) http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/array/array_diff_assoc.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/array/array_diff_assoc.phpt +++ php-src/ext/standard/tests/array/array_diff_assoc.phpt --TEST-- basic array_diff_assoc test --FILE-- ?php $array1 = array(a = green, b = brown, c = blue, red, ); $array2 = array(a = green, yellow, red, TRUE); $array3 = array(red, a=brown, ); $result[] = array_diff_assoc($array1, $array2); $result[] = array_diff_assoc($array1, $array3); $result[] = array_diff_assoc($array2, $array3); $result[] = array_diff_assoc($array1, $array2, $array3); print_r($result) ? --EXPECT-- Array ( [0] = Array ( [b] = brown [c] = blue [0] = red [1] = ) [1] = Array ( [a] = green [b] = brown [c] = blue ) [2] = Array ( [a] = green [0] = yellow [1] = red [2] = 1 ) [3] = Array ( [b] = brown [c] = blue ) ) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) /ext/standard/tests/array array_combine.phpt array_diff_assoc.phpt
helly Tue May 23 23:49:49 2006 UTC Added files: (Branch: PHP_5_1) /php-src/ext/standard/tests/array array_combine.phpt array_diff_assoc.phpt Log: - MFH Add more tests from Ligaya Turmelle http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/array/array_combine.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/array/array_combine.phpt +++ php-src/ext/standard/tests/array/array_combine.phpt --TEST-- basic array_combine test --FILE-- ?php $array1 = array('green', 'red', 'yellow'); $array2 = array('1', '2', '3'); $array3 = array(0, 1, 2); $array4 = array(TRUE, FALSE, NULL); $a = array_combine($array1, $array1); $b = array_combine($array1, $array2); $c = array_combine($array1, $array3); $d = array_combine($array1, $array4); $e = array_combine($array2, $array1); $f = array_combine($array2, $array2); $g = array_combine($array2, $array3); $h = array_combine($array2, $array4); $i = array_combine($array3, $array1); $j = array_combine($array3, $array2); $k = array_combine($array3, $array3); $l = array_combine($array3, $array4); $m = array_combine($array4, $array1); $n = array_combine($array4, $array2); $o = array_combine($array4, $array3); $p = array_combine($array4, $array4); for($letter = a; $letter = p; $letter++) { print_r($$letter); } ? --EXPECT-- Array ( [green] = green [red] = red [yellow] = yellow ) Array ( [green] = 1 [red] = 2 [yellow] = 3 ) Array ( [green] = 0 [red] = 1 [yellow] = 2 ) Array ( [green] = 1 [red] = [yellow] = ) Array ( [1] = green [2] = red [3] = yellow ) Array ( [1] = 1 [2] = 2 [3] = 3 ) Array ( [1] = 0 [2] = 1 [3] = 2 ) Array ( [1] = 1 [2] = [3] = ) Array ( [0] = green [1] = red [2] = yellow ) Array ( [0] = 1 [1] = 2 [2] = 3 ) Array ( [0] = 0 [1] = 1 [2] = 2 ) Array ( [0] = 1 [1] = [2] = ) Array ( [1] = green [] = yellow ) Array ( [1] = 1 [] = 3 ) Array ( [1] = 0 [] = 2 ) Array ( [1] = 1 [] = ) http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/array/array_diff_assoc.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/array/array_diff_assoc.phpt +++ php-src/ext/standard/tests/array/array_diff_assoc.phpt --TEST-- basic array_diff_assoc test --FILE-- ?php $array1 = array(a = green, b = brown, c = blue, red, ); $array2 = array(a = green, yellow, red, TRUE); $array3 = array(red, a=brown, ); $result[] = array_diff_assoc($array1, $array2); $result[] = array_diff_assoc($array1, $array3); $result[] = array_diff_assoc($array2, $array3); $result[] = array_diff_assoc($array1, $array2, $array3); print_r($result) ? --EXPECT-- Array ( [0] = Array ( [b] = brown [c] = blue [0] = red [1] = ) [1] = Array ( [a] = green [b] = brown [c] = blue ) [2] = Array ( [a] = green [0] = yellow [1] = red [2] = 1 ) [3] = Array ( [b] = brown [c] = blue ) ) -- 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
helly Mon May 22 19:04:19 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcNEWS Log: - Update http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.547.2.38r2=1.2027.2.547.2.39diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.38 php-src/NEWS:1.2027.2.547.2.39 --- php-src/NEWS:1.2027.2.547.2.38 Sun May 21 16:31:56 2006 +++ php-src/NEWSMon May 22 19:04:19 2006 @@ -31,6 +31,7 @@ . Added new attribute ATTR_DEFAULT_FETCH_MODE. (Pierre) . Added FETCH_PROPS_LATE. (Marcus) - Improved SPL: (Marcus) + . Made most iterator code exception safe. . Added RegExIterator and RecursiveRegExIterator. . Added full caching support and ArrayAccess to CachingIterator. . Added array functions to ArrayObject/ArrayIterator and made them faster. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / .gdbinit
helly Mon May 22 19:43:15 2006 UTC Modified files: /php-src.gdbinit Log: - Provide user func printztype to retrieve the name of a zval type http://cvs.php.net/viewcvs.cgi/php-src/.gdbinit?r1=1.18r2=1.19diff_format=u Index: php-src/.gdbinit diff -u php-src/.gdbinit:1.18 php-src/.gdbinit:1.19 --- php-src/.gdbinit:1.18 Sat May 20 12:44:46 2006 +++ php-src/.gdbinitMon May 22 19:43:15 2006 @@ -33,13 +33,62 @@ dumps the current execution stack. usage: dump_bt executor_globals.current_execute_data end +define printztype + printz_type $arg0 + printf \n +end + +document printztype + prints the type name of a zval type +end + +define printz_type + set $type = $arg0 + if $type == 0 + printf NULL + end + if $type == 1 + printf long + end + if $type == 2 + printf double + end + if $type == 3 + printf bool + end + if $type == 4 + printf array + end + if $type == 5 + printf object + end + if $type == 6 + printf string + end + if $type == 7 + printf resource + end + if $type == 8 + printf constant + end + if $type == 9 + printf const_array + end + if $type == 10 + printf unicode string + end + if $type 10 + printf unknown type %d, $type + end +end + define printzv set $ind = 1 printzv $arg0 0 end document printzv - prints content of zval + prints zval contents end define printzv_contents @@ -50,22 +99,22 @@ if $type == 0 printf NULL end + printz_type $type if $type == 1 - printf long: %ld, $zvalue-value.lval + printf : %ld, $zvalue-value.lval end if $type == 2 - printf double: %lf, $zvalue-value.dval + printf : %lf, $zvalue-value.dval end if $type == 3 - printf bool: if $zvalue-value.lval - printf true + printf : true else - printf false + printf : false end end if $type == 4 - printf array(%d): , $zvalue-value.ht-nNumOfElements + printf (%d): , $zvalue-value.ht-nNumOfElements if ! $arg1 printf {\n set $ind = $ind + 1 @@ -81,7 +130,6 @@ set $type = 0 end if $type == 5 - printf object executor_globals set $handle = $zvalue-value.obj.handle set $handlers = $zvalue-value.obj.handlers @@ -119,22 +167,19 @@ set $type = 0 end if $type == 6 - printf string(%d): \%s\, $zvalue-value.str.len, $zvalue-value.str.val + printf (%d): \%s\, $zvalue-value.str.len, $zvalue-value.str.val end if $type == 7 - printf resource: #%d, $zvalue-value.lval + printf : #%d, $zvalue-value.lval end if $type == 8 - printf constant end if $type == 9 - printf const_array end if $type == 10 - printf unicode string(%d): [%p], $zvalue-value.str.len, $zvalue-value.str.val + printf (%d): [%p], $zvalue-value.str.len, $zvalue-value.str.val end if $type 10 - printfunknown type %d, $type end printf \n end -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) / README.CVS-RULES
helly Sun May 21 09:09:55 2006 UTC Modified files: (Branch: PHP_4_3) /php-srcREADME.CVS-RULES Log: - Update http://cvs.php.net/viewcvs.cgi/php-src/README.CVS-RULES?r1=1.16.2.2r2=1.16.2.3diff_format=u Index: php-src/README.CVS-RULES diff -u php-src/README.CVS-RULES:1.16.2.2 php-src/README.CVS-RULES:1.16.2.3 --- php-src/README.CVS-RULES:1.16.2.2 Tue Mar 22 09:05:48 2005 +++ php-src/README.CVS-RULESSun May 21 09:09:54 2006 @@ -29,14 +29,21 @@ 5. If you don't know how to do something, ask first! 6. Test your changes before committing them. We mean it. Really. + To do so use make test. + + 7. For development use the --enable-maintainer-zts switch to ensure your + code handles TSRM correctly and doesn't break for thos who need that. Currently we have the following branches in use: -HEAD Will become PHP 5.1. This CVS branch is for active development. -PHP_5_0 Is used to release the PHP 5.0.x series. Only minor feature -enhancements may go in here, but please keep that as infrequent as -possible. -PHP_4_3 Is used to release the PHP 4.3.x series. Only bugfixes are permitted - on this branch. +HEAD Will become PHP 6.0. This CVS branch is for active development. +PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature + enhancements may go in here, but please keep that as infrequent as + possible. +PHP_5_1 Is used to release the PHP 5.1.x series. Only bugfixes are permitted + on this branch (Consult the releasemaster prior to commit). +PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted + on this branch (Consult the releasemaster prior to commit). +PHP_4_3 This branch is closed. The next few rules are more of a technical nature. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_4) / README.CVS-RULES
helly Sun May 21 09:10:02 2006 UTC Modified files: (Branch: PHP_4_4) /php-srcREADME.CVS-RULES Log: - Update http://cvs.php.net/viewcvs.cgi/php-src/README.CVS-RULES?r1=1.16.2.2r2=1.16.2.2.2.1diff_format=u Index: php-src/README.CVS-RULES diff -u php-src/README.CVS-RULES:1.16.2.2 php-src/README.CVS-RULES:1.16.2.2.2.1 --- php-src/README.CVS-RULES:1.16.2.2 Tue Mar 22 09:05:48 2005 +++ php-src/README.CVS-RULESSun May 21 09:10:02 2006 @@ -29,14 +29,21 @@ 5. If you don't know how to do something, ask first! 6. Test your changes before committing them. We mean it. Really. + To do so use make test. + + 7. For development use the --enable-maintainer-zts switch to ensure your + code handles TSRM correctly and doesn't break for thos who need that. Currently we have the following branches in use: -HEAD Will become PHP 5.1. This CVS branch is for active development. -PHP_5_0 Is used to release the PHP 5.0.x series. Only minor feature -enhancements may go in here, but please keep that as infrequent as -possible. -PHP_4_3 Is used to release the PHP 4.3.x series. Only bugfixes are permitted - on this branch. +HEAD Will become PHP 6.0. This CVS branch is for active development. +PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature + enhancements may go in here, but please keep that as infrequent as + possible. +PHP_5_1 Is used to release the PHP 5.1.x series. Only bugfixes are permitted + on this branch (Consult the releasemaster prior to commit). +PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted + on this branch (Consult the releasemaster prior to commit). +PHP_4_3 This branch is closed. The next few rules are more of a technical nature. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_0) / README.CVS-RULES
helly Sun May 21 09:11:21 2006 UTC Modified files: (Branch: PHP_5_0) /php-srcREADME.CVS-RULES Log: - Update http://cvs.php.net/viewcvs.cgi/php-src/README.CVS-RULES?r1=1.16.14.2r2=1.16.14.3diff_format=u Index: php-src/README.CVS-RULES diff -u php-src/README.CVS-RULES:1.16.14.2 php-src/README.CVS-RULES:1.16.14.3 --- php-src/README.CVS-RULES:1.16.14.2 Tue Mar 22 09:01:43 2005 +++ php-src/README.CVS-RULESSun May 21 09:11:21 2006 @@ -29,14 +29,22 @@ 5. If you don't know how to do something, ask first! 6. Test your changes before committing them. We mean it. Really. + To do so use make test. + + 7. For development use the --enable-maintainer-zts switch to ensure your + code handles TSRM correctly and doesn't break for thos who need that. Currently we have the following branches in use: -HEAD Will become PHP 5.1. This CVS branch is for active development. -PHP_5_0 Is used to release the PHP 5.0.x series. Only minor feature -enhancements may go in here, but please keep that as infrequent as -possible. -PHP_4_3 Is used to release the PHP 4.3.x series. Only bugfixes are permitted - on this branch. +HEAD Will become PHP 6.0. This CVS branch is for active development. +PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature + enhancements may go in here, but please keep that as infrequent as + possible. +PHP_5_1 Is used to release the PHP 5.1.x series. Only bugfixes are permitted + on this branch (Consult the releasemaster prior to commit). +PHP_5_0 This branch is closed. +PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted + on this branch (Consult the releasemaster prior to commit). +PHP_4_3 This branch is closed. The next few rules are more of a technical nature. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_1) / README.CVS-RULES
helly Sun May 21 09:12:23 2006 UTC Modified files: (Branch: PHP_5_1) /php-srcREADME.CVS-RULES Log: - Update http://cvs.php.net/viewcvs.cgi/php-src/README.CVS-RULES?r1=1.18.2.1r2=1.18.2.2diff_format=u Index: php-src/README.CVS-RULES diff -u php-src/README.CVS-RULES:1.18.2.1 php-src/README.CVS-RULES:1.18.2.2 --- php-src/README.CVS-RULES:1.18.2.1 Sun Dec 4 23:19:44 2005 +++ php-src/README.CVS-RULESSun May 21 09:12:23 2006 @@ -29,14 +29,22 @@ 5. If you don't know how to do something, ask first! 6. Test your changes before committing them. We mean it. Really. + To do so use make test. + + 7. For development use the --enable-maintainer-zts switch to ensure your + code handles TSRM correctly and doesn't break for thos who need that. Currently we have the following branches in use: HEAD Will become PHP 6.0. This CVS branch is for active development. -PHP_5_1 Is used to release the PHP 5.1.x series. Only minor feature -enhancements may go in here, but please keep that as infrequent as -possible. +PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature + enhancements may go in here, but please keep that as infrequent as + possible. +PHP_5_1 Is used to release the PHP 5.1.x series. Only bugfixes are permitted + on this branch (Consult the releasemaster prior to commit). +PHP_5_0 This branch is closed. PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted - on this branch. + on this branch (Consult the releasemaster prior to commit). +PHP_4_3 This branch is closed. The next few rules are more of a technical nature. -- 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) / README.CVS-RULES
helly Sun May 21 09:12:34 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcREADME.CVS-RULES Log: - Update http://cvs.php.net/viewcvs.cgi/php-src/README.CVS-RULES?r1=1.18.2.1r2=1.18.2.1.2.1diff_format=u Index: php-src/README.CVS-RULES diff -u php-src/README.CVS-RULES:1.18.2.1 php-src/README.CVS-RULES:1.18.2.1.2.1 --- php-src/README.CVS-RULES:1.18.2.1 Sun Dec 4 23:19:44 2005 +++ php-src/README.CVS-RULESSun May 21 09:12:34 2006 @@ -29,14 +29,22 @@ 5. If you don't know how to do something, ask first! 6. Test your changes before committing them. We mean it. Really. + To do so use make test. + + 7. For development use the --enable-maintainer-zts switch to ensure your + code handles TSRM correctly and doesn't break for thos who need that. Currently we have the following branches in use: HEAD Will become PHP 6.0. This CVS branch is for active development. -PHP_5_1 Is used to release the PHP 5.1.x series. Only minor feature -enhancements may go in here, but please keep that as infrequent as -possible. +PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature + enhancements may go in here, but please keep that as infrequent as + possible. +PHP_5_1 Is used to release the PHP 5.1.x series. Only bugfixes are permitted + on this branch (Consult the releasemaster prior to commit). +PHP_5_0 This branch is closed. PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted - on this branch. + on this branch (Consult the releasemaster prior to commit). +PHP_4_3 This branch is closed. The next few rules are more of a technical nature. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / README.CVS-RULES
helly Sun May 21 09:12:41 2006 UTC Modified files: /php-srcREADME.CVS-RULES Log: - Update http://cvs.php.net/viewcvs.cgi/php-src/README.CVS-RULES?r1=1.19r2=1.20diff_format=u Index: php-src/README.CVS-RULES diff -u php-src/README.CVS-RULES:1.19 php-src/README.CVS-RULES:1.20 --- php-src/README.CVS-RULES:1.19 Wed Aug 17 19:52:03 2005 +++ php-src/README.CVS-RULESSun May 21 09:12:41 2006 @@ -29,17 +29,22 @@ 5. If you don't know how to do something, ask first! 6. Test your changes before committing them. We mean it. Really. + To do so use make test. 7. For development use the --enable-maintainer-zts switch to ensure your code handles TSRM correctly and doesn't break for thos who need that. Currently we have the following branches in use: -HEAD Will become PHP 5.1. This CVS branch is for active development. -PHP_5_0 Is used to release the PHP 5.0.x series. Only minor feature -enhancements may go in here, but please keep that as infrequent as -possible. -PHP_4_3 Is used to release the PHP 4.3.x series. Only bugfixes are permitted - on this branch. +HEAD Will become PHP 6.0. This CVS branch is for active development. +PHP_5_2 Is used to release the PHP 5.2.x series. Only minor feature + enhancements may go in here, but please keep that as infrequent as + possible. +PHP_5_1 Is used to release the PHP 5.1.x series. Only bugfixes are permitted + on this branch (Consult the releasemaster prior to commit). +PHP_5_0 This branch is closed. +PHP_4_4 Is used to release the PHP 4.4.x series. Only bugfixes are permitted + on this branch (Consult the releasemaster prior to commit). +PHP_4_3 This branch is closed. The next few rules are more of a technical nature. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/classes interfaces_003.phpt type_hinting_001.phpt type_hinting_003.phpt /tests/lang bug24658.phpt catchable_error_001.phpt catchable_error_002.phpt type_hints_001.phpt
helly Sun May 21 11:23:35 2006 UTC Modified files: /ZendEngine2zend_execute.c /ZendEngine2/tests array_type_hint_001.phpt bug33996.phpt /php-src/tests/classes interfaces_003.phpt type_hinting_001.phpt type_hinting_003.phpt /php-src/tests/lang bug24658.phpt catchable_error_001.phpt catchable_error_002.phpt type_hints_001.phpt Log: - Improved error messages http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.c?r1=1.742r2=1.743diff_format=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.742 ZendEngine2/zend_execute.c:1.743 --- ZendEngine2/zend_execute.c:1.742Mon May 15 15:31:49 2006 +++ ZendEngine2/zend_execute.c Sun May 21 11:23:35 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_execute.c,v 1.742 2006/05/15 15:31:49 dmitry Exp $ */ +/* $Id: zend_execute.c,v 1.743 2006/05/21 11:23:35 helly Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -493,9 +493,9 @@ if (cur_arg_info-class_name.v) { if (!arg) { if (ptr ptr-op_array) { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, called in %s on line %d and defined, arg_num, fclass, fsep, fname, cur_arg_info-class_name, ptr-op_array-filename, ptr-opline-lineno); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, none given, called in %s on line %d and defined, arg_num, fclass, fsep, fname, cur_arg_info-class_name, ptr-op_array-filename, ptr-opline-lineno); } else { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, arg_num, fclass, fsep, fname, cur_arg_info-class_name); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, none given, arg_num, fclass, fsep, fname, cur_arg_info-class_name); } return 0; } @@ -503,9 +503,9 @@ case IS_NULL: if (!cur_arg_info-allow_null) { if (ptr ptr-op_array) { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must not be null, called in %s on line %d and defined, arg_num, fclass, fsep, fname, ptr-op_array-filename, ptr-opline-lineno); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, null given, called in %s on line %d and defined, arg_num, fclass, fsep, fname, cur_arg_info-class_name, ptr-op_array-filename, ptr-opline-lineno); } else { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must not be null, arg_num, fclass, fsep, fname); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, null given, arg_num, fclass, fsep, fname, cur_arg_info-class_name); } return 0; } @@ -520,9 +520,9 @@ error_msg = be an instance of; } if (ptr ptr-op_array) { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must %s %v, called in %s on line %d and defined, arg_num, fclass, fsep, fname, error_msg, ce-name, ptr-op_array-filename, ptr-opline-lineno); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must %s %v, instance of %v given, called in %s on line %d and defined, arg_num, fclass, fsep, fname, error_msg, ce-name, Z_OBJCE_P(arg)-name, ptr-op_array-filename, ptr-opline-lineno); } else { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must %s %v, arg_num, fclass, fsep, fname, error_msg, ce-name); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must %s %v, instance of %v given, arg_num, fclass, fsep, fname, error_msg, ce-name, Z_OBJCE_P(arg)-name); } return 0; } @@ -530,18 +530,18 @@ break;
[PHP-CVS] cvs: php-src /tests/lang catchable_error_002.phpt
helly Sun May 21 11:38:24 2006 UTC Modified files: /php-src/tests/lang catchable_error_002.phpt Log: - Fix unicode expectations http://cvs.php.net/viewcvs.cgi/php-src/tests/lang/catchable_error_002.phpt?r1=1.4r2=1.5diff_format=u Index: php-src/tests/lang/catchable_error_002.phpt diff -u php-src/tests/lang/catchable_error_002.phpt:1.4 php-src/tests/lang/catchable_error_002.phpt:1.5 --- php-src/tests/lang/catchable_error_002.phpt:1.4 Sun May 21 11:23:35 2006 +++ php-src/tests/lang/catchable_error_002.phpt Sun May 21 11:38:24 2006 @@ -25,7 +25,7 @@ [0]= int(4096) [1]= - string(%d) Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line 17 and defined + string(%d) Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d and defined [2]= string(%d) %scatchable_error_002.php [3]= @@ -40,7 +40,7 @@ [0]= int(4096) [1]= - unicode(%d) Argument 1 passed to blah() must be an instance of Foo, called in %scatchable_error_002.php on line 17 and defined + unicode(%d) Argument 1 passed to blah() must be an instance of Foo, instance of stdClass given, called in %scatchable_error_002.php on line %d and defined [2]= unicode(%d) %scatchable_error_002.php [3]= -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/lang bug24658.phpt ZendEngine2 zend_execute.c
helly Sun May 21 12:38:28 2006 UTC Modified files: /ZendEngine2zend_execute.c /php-src/tests/lang bug24658.phpt Log: - Improve error messages (part 2) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.c?r1=1.743r2=1.744diff_format=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.743 ZendEngine2/zend_execute.c:1.744 --- ZendEngine2/zend_execute.c:1.743Sun May 21 11:23:35 2006 +++ ZendEngine2/zend_execute.c Sun May 21 12:38:28 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_execute.c,v 1.743 2006/05/21 11:23:35 helly Exp $ */ +/* $Id: zend_execute.c,v 1.744 2006/05/21 12:38:28 helly Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -477,8 +477,9 @@ { zend_arg_info *cur_arg_info; zend_execute_data *ptr = EG(current_execute_data)-prev_execute_data; - char *fsep; + char *fsep, *error_msg; zstr fclass, fname; + zend_class_entry *ce; if (!zf-common.arg_info || arg_numzf-common.num_args) { @@ -511,9 +512,8 @@ } break; case IS_OBJECT: { - zend_class_entry *ce = zend_u_fetch_class(UG(unicode) ? IS_UNICODE : IS_STRING, cur_arg_info-class_name, cur_arg_info-class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + ce = zend_u_fetch_class(UG(unicode) ? IS_UNICODE : IS_STRING, cur_arg_info-class_name, cur_arg_info-class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); if (!instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) { - char *error_msg; if (ce-ce_flags ZEND_ACC_INTERFACE) { error_msg = implement interface; } else { @@ -528,13 +528,20 @@ } } break; - default: + default: { + ce = zend_u_fetch_class(UG(unicode) ? IS_UNICODE : IS_STRING, cur_arg_info-class_name, cur_arg_info-class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + if (ce-ce_flags ZEND_ACC_INTERFACE) { + error_msg = implement interface; + } else { + error_msg = be an instance of; + } if (ptr ptr-op_array) { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, %s given, called in %s on line %d and defined, arg_num, fclass, fsep, fname, cur_arg_info-class_name, zend_zval_type_name(arg), ptr-op_array-filename, ptr-opline-lineno); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must %s %v, %s given, called in %s on line %d and defined, arg_num, fclass, fsep, fname, error_msg, ce-name, zend_zval_type_name(arg), ptr-op_array-filename, ptr-opline-lineno); } else { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must be an object of class %v, %s given, arg_num, fclass, fsep, fname, cur_arg_info-class_name, zend_zval_type_name(arg)); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %v%s%v() must %s %v, %s given, arg_num, fclass, fsep, fname, error_msg, ce-name, zend_zval_type_name(arg)); } return 0; + } } } else if (cur_arg_info-array_type_hint) { if (!arg) { http://cvs.php.net/viewcvs.cgi/php-src/tests/lang/bug24658.phpt?r1=1.6r2=1.7diff_format=u Index: php-src/tests/lang/bug24658.phpt diff -u php-src/tests/lang/bug24658.phpt:1.6 php-src/tests/lang/bug24658.phpt:1.7 --- php-src/tests/lang/bug24658.phpt:1.6Sun May 21 11:23:35 2006 +++ php-src/tests/lang/bug24658.phptSun May 21 12:38:28 2006 @@ -53,4 +53,4 @@ object(foo)#%d (0) { } -Catchable fatal error: Argument 1 passed to typehint() must be an object of class foo, integer given in %s on line %d +Catchable fatal error: Argument 1 passed to typehint() must be an instance of foo, integer given 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/spl spl_iterators.c /ext/spl/tests iterator_042.phpt
helly Sun May 21 12:42:00 2006 UTC Added files: /php-src/ext/spl/tests iterator_042.phpt Modified files: /php-src/ext/splspl_iterators.c Log: - Remove duplicate error message and add new test http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.131r2=1.132diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.131 php-src/ext/spl/spl_iterators.c:1.132 --- php-src/ext/spl/spl_iterators.c:1.131 Sat May 20 20:46:11 2006 +++ php-src/ext/spl/spl_iterators.c Sun May 21 12:42:00 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.131 2006/05/20 20:46:11 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.132 2006/05/21 12:42:00 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -2306,7 +2306,7 @@ APPENDIT_CHECK_CTOR(intern); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, O, it, zend_ce_iterator) == FAILURE) { + if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, O, it, zend_ce_iterator) == FAILURE) { return; } spl_array_iterator_append(intern-u.append.zarrayit, it TSRMLS_CC); http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/tests/iterator_042.phpt?view=markuprev=1.1 Index: php-src/ext/spl/tests/iterator_042.phpt +++ php-src/ext/spl/tests/iterator_042.phpt --TEST-- SPL: AppendIterator and its ArrayIterator --SKIPIF-- ?php if (!extension_loaded(spl)) print skip; ? --FILE-- ?php function test_error_handler($errno, $msg, $filename, $linenum, $vars) { echo Error $msg in $filename on line $linenum\n; return true; } set_error_handler('test_error_handler'); $it = new AppendIterator; $it-append(array()); $it-append(new ArrayIterator(array(1))); $it-append(new ArrayIterator(array(21, 22))); var_dump($it-getArrayIterator()); $it-append(new ArrayIterator(array(31, 32, 33))); var_dump($it-getArrayIterator()); $idx = 0; foreach($it as $k = $v) { echo '===' . $idx++ . ===\n; var_dump($it-getIteratorIndex()); var_dump($k); var_dump($v); } ? ===DONE=== ?php exit(0); ? --EXPECTF-- Error Argument 1 passed to AppendIterator::append() must implement interface Iterator, array given in %siterator_042.php on line %d object(ArrayIterator)#%d (2) { [0]= object(ArrayIterator)#%d (1) { [0]= int(1) } [1]= object(ArrayIterator)#%d (2) { [0]= int(21) [1]= int(22) } } object(ArrayIterator)#%d (3) { [0]= object(ArrayIterator)#%d (1) { [0]= int(1) } [1]= object(ArrayIterator)#%d (2) { [0]= int(21) [1]= int(22) } [2]= object(ArrayIterator)#5 (3) { [0]= int(31) [1]= int(32) [2]= int(33) } } ===0=== int(0) int(0) int(1) ===1=== int(1) int(0) int(21) ===2=== int(1) int(1) int(22) ===3=== int(2) int(0) int(31) ===4=== int(2) int(1) int(32) ===5=== int(2) int(2) int(33) ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl/tests bug36287.phpt
helly Sun May 21 12:48:42 2006 UTC Modified files: /php-src/ext/spl/tests bug36287.phpt Log: - There is a problem in the string / unicode comparison here which we do not want to test here, so simply drop the part which is irrelevant to the actual test http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/tests/bug36287.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/ext/spl/tests/bug36287.phpt diff -u php-src/ext/spl/tests/bug36287.phpt:1.2 php-src/ext/spl/tests/bug36287.phpt:1.3 --- php-src/ext/spl/tests/bug36287.phpt:1.2 Thu Mar 23 15:05:02 2006 +++ php-src/ext/spl/tests/bug36287.phpt Sun May 21 12:48:42 2006 @@ -11,15 +11,9 @@ foreach($it as $file) { echo First\n; - if(. != $file .. != $file) - { - var_Dump($file-getFilename()); - } + var_Dump($file-getFilename()); echo Second\n; - if($file != . $file != ..) - { - var_dump($file-getFilename()); - } + var_dump($file-getFilename()); if (++$idx 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/standard base64.c
helly Sun May 21 13:25:16 2006 UTC Modified files: /php-src/ext/standard base64.c Log: - Drop unneccesary check and change to safe_emalloc http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/base64.c?r1=1.46r2=1.47diff_format=u Index: php-src/ext/standard/base64.c diff -u php-src/ext/standard/base64.c:1.46 php-src/ext/standard/base64.c:1.47 --- php-src/ext/standard/base64.c:1.46 Thu Mar 2 13:12:45 2006 +++ php-src/ext/standard/base64.c Sun May 21 13:25:16 2006 @@ -15,7 +15,7 @@ | Author: Jim Winstead [EMAIL PROTECTED] | +--+ */ -/* $Id: base64.c,v 1.46 2006/03/02 13:12:45 dmitry Exp $ */ +/* $Id: base64.c,v 1.47 2006/05/21 13:25:16 helly Exp $ */ #include string.h @@ -144,10 +144,7 @@ /* this sucks for threaded environments */ unsigned char *result; - result = (unsigned char *)emalloc(length + 1); - if (result == NULL) { - return NULL; - } + result = (unsigned char *)safe_emalloc(length, 1, 1); /* run through the whole string, converting as we go */ while ((ch = *current++) != '\0' length-- 0) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard/tests/file stream_rfc2397_006.phpt /main/streams memory.c
helly Sun May 21 13:35:06 2006 UTC Added files: /php-src/ext/standard/tests/filestream_rfc2397_006.phpt Modified files: /php-src/main/streams memory.c Log: - Handle corrupt base64 data in data: url http://cvs.php.net/viewcvs.cgi/php-src/main/streams/memory.c?r1=1.20r2=1.21diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.20 php-src/main/streams/memory.c:1.21 --- php-src/main/streams/memory.c:1.20 Sun May 14 19:13:17 2006 +++ php-src/main/streams/memory.c Sun May 21 13:35:06 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.20 2006/05/14 19:13:17 helly Exp $ */ +/* $Id: memory.c,v 1.21 2006/05/21 13:35:06 helly Exp $ */ #define _GNU_SOURCE #include php.h @@ -652,21 +652,25 @@ } add_assoc_bool(meta, base64, base64); + /* skip ',' */ + comma++; + dlen--; + + if (base64) { + comma = (char*)php_base64_decode((const unsigned char *)comma, dlen, ilen); + if (!comma) { + php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, rfc2397: unable to decode); + return NULL; + } + } else { + comma = estrndup(comma, dlen); + ilen = dlen = php_url_decode(comma, dlen); + } + if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) { - /* skip ',' */ - comma++; - dlen--; /* store data */ - if (base64) { - comma = (char*)php_base64_decode((const unsigned char *)comma, dlen, ilen); - php_stream_temp_write(stream, comma, ilen TSRMLS_CC); - efree(comma); - } else { - comma = estrndup(comma, dlen); - dlen = php_url_decode(comma, dlen); - php_stream_temp_write(stream, comma, dlen TSRMLS_CC); - efree(comma); - } + php_stream_temp_write(stream, comma, ilen TSRMLS_CC); + efree(comma); php_stream_temp_seek(stream, 0, SEEK_SET, newoffs TSRMLS_CC); /* set special stream stuff (enforce exact mode) */ vlen = strlen(mode); http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/file/stream_rfc2397_006.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/file/stream_rfc2397_006.phpt +++ php-src/ext/standard/tests/file/stream_rfc2397_006.phpt --TEST-- Stream: RFC2397 with corrupt? payload --FILE-- ?php $streams = array( data:;base64,\0Zm9vYmFyIGZvb2Jhcg==, data:;base64,Zm9vYmFy\0IGZvb2Jhcg==, 'data:;base64,#Zm9vYmFyIGZvb2Jhcg==', 'data:;base64,#Zm9vYmFyIGZvb2Jhc=', ); foreach($streams as $stream) { var_dump(file_get_contents($stream)); } ? ===DONE=== ?php exit(0); ? --EXPECTF-- string(0) string(6) foobar string(13) foobar foobar Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhc=): failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d bool(false) ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/file stream_rfc2397_006.phpt /main/streams memory.c
helly Sun May 21 13:37:19 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/filestream_rfc2397_006.phpt Modified files: /php-src/main/streams memory.c Log: - MFH Handle corrupt base64 data in data: url http://cvs.php.net/viewcvs.cgi/php-src/main/streams/memory.c?r1=1.8.2.6.2.4r2=1.8.2.6.2.5diff_format=u Index: php-src/main/streams/memory.c diff -u php-src/main/streams/memory.c:1.8.2.6.2.4 php-src/main/streams/memory.c:1.8.2.6.2.5 --- php-src/main/streams/memory.c:1.8.2.6.2.4 Sun May 14 19:15:31 2006 +++ php-src/main/streams/memory.c Sun May 21 13:37:19 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: memory.c,v 1.8.2.6.2.4 2006/05/14 19:15:31 helly Exp $ */ +/* $Id: memory.c,v 1.8.2.6.2.5 2006/05/21 13:37:19 helly Exp $ */ #define _GNU_SOURCE #include php.h @@ -652,21 +652,25 @@ } add_assoc_bool(meta, base64, base64); + /* skip ',' */ + comma++; + dlen--; + + if (base64) { + comma = (char*)php_base64_decode((const unsigned char *)comma, dlen, ilen); + if (!comma) { + php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, rfc2397: unable to decode); + return NULL; + } + } else { + comma = estrndup(comma, dlen); + ilen = dlen = php_url_decode(comma, dlen); + } + if ((stream = php_stream_temp_create_rel(0, ~0u)) != NULL) { - /* skip ',' */ - comma++; - dlen--; /* store data */ - if (base64) { - comma = (char*)php_base64_decode((const unsigned char *)comma, dlen, ilen); - php_stream_temp_write(stream, comma, ilen TSRMLS_CC); - efree(comma); - } else { - comma = estrndup(comma, dlen); - dlen = php_url_decode(comma, dlen); - php_stream_temp_write(stream, comma, dlen TSRMLS_CC); - efree(comma); - } + php_stream_temp_write(stream, comma, ilen TSRMLS_CC); + efree(comma); php_stream_temp_seek(stream, 0, SEEK_SET, newoffs TSRMLS_CC); /* set special stream stuff (enforce exact mode) */ vlen = strlen(mode); http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/file/stream_rfc2397_006.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/file/stream_rfc2397_006.phpt +++ php-src/ext/standard/tests/file/stream_rfc2397_006.phpt --TEST-- Stream: RFC2397 with corrupt? payload --FILE-- ?php $streams = array( data:;base64,\0Zm9vYmFyIGZvb2Jhcg==, data:;base64,Zm9vYmFy\0IGZvb2Jhcg==, 'data:;base64,#Zm9vYmFyIGZvb2Jhcg==', 'data:;base64,#Zm9vYmFyIGZvb2Jhc=', ); foreach($streams as $stream) { var_dump(file_get_contents($stream)); } ? ===DONE=== ?php exit(0); ? --EXPECTF-- string(0) string(6) foobar string(13) foobar foobar Warning: file_get_contents(data:;base64,#Zm9vYmFyIGZvb2Jhc=): failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d bool(false) ===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl_iterators.c spl_iterators.h /ext/spl/tests iterator_043.phpt iterator_044.phpt iterator_045.phpt iterator_046.phpt iterator_047.phpt iterator_048.phpt
helly Sun May 21 17:27:12 2006 UTC Added files: /php-src/ext/spl/tests iterator_043.phpt iterator_044.phpt iterator_045.phpt iterator_046.phpt iterator_047.phpt iterator_048.phpt Modified files: /php-src/ext/splspl_iterators.c spl_iterators.h Log: - Make code exception safe - Make RecursiveRegexIterator::getChildren pass regex to inner ctor - Fix CachingIterator::__toString() in TOSTRING_USE_KEY mode - Add CachingIterator::getCache() - Add tests http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.132r2=1.133diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.132 php-src/ext/spl/spl_iterators.c:1.133 --- php-src/ext/spl/spl_iterators.c:1.132 Sun May 21 12:42:00 2006 +++ php-src/ext/spl/spl_iterators.c Sun May 21 17:27:12 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.132 2006/05/21 12:42:00 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.133 2006/05/21 17:27:12 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -193,6 +193,13 @@ switch (object-iterators[object-level].state) { case RS_NEXT: iterator-funcs-move_forward(iterator TSRMLS_CC); + if (EG(exception)) { + if (!(object-flags RIT_CATCH_GET_CHILD)) { + return; + } else { + zend_clear_exception(TSRMLS_C); + } + } case RS_START: if (iterator-funcs-valid(iterator TSRMLS_CC) == FAILURE) { break; @@ -207,6 +214,14 @@ } else { zend_call_method_with_0_params(zobject, ce, NULL, haschildren, retval); } + if (EG(exception)) { + if (!(object-flags RIT_CATCH_GET_CHILD)) { + object-iterators[object-level].state = RS_NEXT; + return; + } else { + zend_clear_exception(TSRMLS_C); + } + } if (retval) { has_children = zend_is_true(retval); zval_ptr_dtor(retval); @@ -235,6 +250,13 @@ zend_call_method_with_0_params(zthis, object-ce, object-nextElement, nextelement, NULL); } object-iterators[object-level].state = RS_NEXT; + if (EG(exception)) { + if (!(object-flags RIT_CATCH_GET_CHILD)) { + return; + } else { + zend_clear_exception(TSRMLS_C); + } + } return /* self */; case RS_SELF: if (object-nextElement (object-mode == RIT_SELF_FIRST || object-mode == RIT_CHILD_FIRST)) { @@ -292,6 +314,13 @@ } if (object-beginChildren) { zend_call_method_with_0_params(zthis, object-ce, object-beginChildren, beginchildren, NULL); + if (EG(exception)) { + if (!(object-flags RIT_CATCH_GET_CHILD)) { + return; + } else { + zend_clear_exception(TSRMLS_C); + } + } } goto next_step; } @@ -299,6 +328,13 @@ if (object-level 0) { if (object-endChildren) { zend_call_method_with_0_params(zthis, object-ce, object-endChildren, endchildren, NULL); + if (EG(exception)) { + if (!(object-flags RIT_CATCH_GET_CHILD)) { +
[PHP-CVS] cvs: php-src /ext/spl spl_iterators.c
helly Sun May 21 17:36:53 2006 UTC Modified files: /php-src/ext/splspl_iterators.c Log: - More exception related issues http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.133r2=1.134diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.133 php-src/ext/spl/spl_iterators.c:1.134 --- php-src/ext/spl/spl_iterators.c:1.133 Sun May 21 17:27:12 2006 +++ php-src/ext/spl/spl_iterators.c Sun May 21 17:36:52 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.133 2006/05/21 17:27:12 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.134 2006/05/21 17:36:52 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -1317,8 +1317,10 @@ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zend_call_method_with_0_params(intern-inner.zobject, intern-inner.ce, NULL, getchildren, retval); - if (!EG(exception)) { + if (!EG(exception) retval) { spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), return_value, 0, retval TSRMLS_CC); + } + if (retval) { zval_ptr_dtor(retval); } } /* }}} */ @@ -1357,8 +1359,10 @@ intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); zend_call_method_with_0_params(intern-inner.zobject, intern-inner.ce, NULL, getchildren, retval); - if (retval) { + if (!EG(exception) retval) { spl_instantiate_arg_ex1(Z_OBJCE_P(getThis()), return_value, 0, retval TSRMLS_CC); + } + if (retval) { zval_ptr_dtor(retval); } } /* }}} */ -- 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) /tests/classes interfaces_003.phpt type_hinting_001.phpt type_hinting_003.phpt /tests/lang bug24658.phpt type_hints_001.phpt ZendEngine2 zend_execute.c ZendEngine2/t
helly Sun May 21 18:10:32 2006 UTC Modified files: (Branch: PHP_5_2) /ZendEngine2zend_execute.c /ZendEngine2/tests array_type_hint_001.phpt bug33996.phpt /php-src/tests/classes interfaces_003.phpt type_hinting_001.phpt type_hinting_003.phpt /php-src/tests/lang bug24658.phpt type_hints_001.phpt Log: - MFH improve error messages http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_execute.c?r1=1.716.2.12.2.4r2=1.716.2.12.2.5diff_format=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.716.2.12.2.4 ZendEngine2/zend_execute.c:1.716.2.12.2.5 --- ZendEngine2/zend_execute.c:1.716.2.12.2.4 Mon May 15 15:31:27 2006 +++ ZendEngine2/zend_execute.c Sun May 21 18:10:30 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: zend_execute.c,v 1.716.2.12.2.4 2006/05/15 15:31:27 dmitry Exp $ */ +/* $Id: zend_execute.c,v 1.716.2.12.2.5 2006/05/21 18:10:30 helly Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -454,7 +454,9 @@ { zend_arg_info *cur_arg_info; zend_execute_data *ptr = EG(current_execute_data)-prev_execute_data; - char *fclass, *fsep, *fname; + char *fsep, *error_msg; + char *fclass, *fname; + zend_class_entry *ce; if (!zf-common.arg_info || arg_numzf-common.num_args) { @@ -469,9 +471,9 @@ if (cur_arg_info-class_name) { if (!arg) { if (ptr ptr-op_array) { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %s%s%s() must be an object of class %s, called in %s on line %d and defined, arg_num, fclass, fsep, fname, cur_arg_info-class_name, ptr-op_array-filename, ptr-opline-lineno); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %s%s%s() must be an object of class %s, none given, called in %s on line %d and defined, arg_num, fclass, fsep, fname, cur_arg_info-class_name, ptr-op_array-filename, ptr-opline-lineno); } else { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %s%s%s() must be an object of class %s, arg_num, fclass, fsep, fname, cur_arg_info-class_name); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %s%s%s() must be an object of class %s, none given, arg_num, fclass, fsep, fname, cur_arg_info-class_name); } return 0; } @@ -479,45 +481,51 @@ case IS_NULL: if (!cur_arg_info-allow_null) { if (ptr ptr-op_array) { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined, arg_num, fclass, fsep, fname, ptr-op_array-filename, ptr-opline-lineno); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %s%s%s() must be an object of class %s, null given, called in %s on line %d and defined, arg_num, fclass, fsep, fname, cur_arg_info-class_name, ptr-op_array-filename, ptr-opline-lineno); } else { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %s%s%s() must not be null, arg_num, fclass, fsep, fname); + zend_error(E_RECOVERABLE_ERROR, Argument %d passed to %s%s%s() must be an object of class %s, null given, arg_num, fclass, fsep, fname, cur_arg_info-class_name); } return 0; } break; case IS_OBJECT: { - zend_class_entry *ce = zend_fetch_class(cur_arg_info-class_name, cur_arg_info-class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); + ce = zend_fetch_class(cur_arg_info-class_name, cur_arg_info-class_name_len, ZEND_FETCH_CLASS_AUTO TSRMLS_CC); if (!instanceof_function(Z_OBJCE_P(arg), ce TSRMLS_CC)) { - char *error_msg; if (ce-ce_flags ZEND_ACC_INTERFACE) { error_msg = implement interface; } else { error_msg = be an instance of; } if (ptr ptr-op_array) { - zend_error(E_RECOVERABLE_ERROR, Argument %d passed to
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/spl spl_iterators.c spl_iterators.h /ext/spl/tests iterator_042.phpt iterator_043.phpt iterator_044.phpt iterator_045.phpt iterator_046.phpt iterator_047.phpt ite
helly Sun May 21 18:13:37 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/spl/tests iterator_042.phpt iterator_043.phpt iterator_044.phpt iterator_045.phpt iterator_046.phpt iterator_047.phpt iterator_048.phpt Modified files: /php-src/ext/splspl_iterators.c spl_iterators.h Log: - MFH . Make code exception safe . Make RecursiveRegexIterator::getChildren pass regex to inner ctor . Fix CachingIterator::__toString() in TOSTRING_USE_KEY mode . Add CachingIterator::getCache() . Add tests http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.73.2.30.2.8r2=1.73.2.30.2.9diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.73.2.30.2.8 php-src/ext/spl/spl_iterators.c:1.73.2.30.2.9 --- php-src/ext/spl/spl_iterators.c:1.73.2.30.2.8 Sat May 20 21:01:42 2006 +++ php-src/ext/spl/spl_iterators.c Sun May 21 18:13:37 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.73.2.30.2.8 2006/05/20 21:01:42 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.73.2.30.2.9 2006/05/21 18:13:37 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -193,6 +193,13 @@ switch (object-iterators[object-level].state) { case RS_NEXT: iterator-funcs-move_forward(iterator TSRMLS_CC); + if (EG(exception)) { + if (!(object-flags RIT_CATCH_GET_CHILD)) { + return; + } else { + zend_clear_exception(TSRMLS_C); + } + } case RS_START: if (iterator-funcs-valid(iterator TSRMLS_CC) == FAILURE) { break; @@ -207,6 +214,14 @@ } else { zend_call_method_with_0_params(zobject, ce, NULL, haschildren, retval); } + if (EG(exception)) { + if (!(object-flags RIT_CATCH_GET_CHILD)) { + object-iterators[object-level].state = RS_NEXT; + return; + } else { + zend_clear_exception(TSRMLS_C); + } + } if (retval) { has_children = zend_is_true(retval); zval_ptr_dtor(retval); @@ -235,6 +250,13 @@ zend_call_method_with_0_params(zthis, object-ce, object-nextElement, nextelement, NULL); } object-iterators[object-level].state = RS_NEXT; + if (EG(exception)) { + if (!(object-flags RIT_CATCH_GET_CHILD)) { + return; + } else { + zend_clear_exception(TSRMLS_C); + } + } return /* self */; case RS_SELF: if (object-nextElement (object-mode == RIT_SELF_FIRST || object-mode == RIT_CHILD_FIRST)) { @@ -292,6 +314,13 @@ } if (object-beginChildren) { zend_call_method_with_0_params(zthis, object-ce, object-beginChildren, beginchildren, NULL); + if (EG(exception)) { + if (!(object-flags RIT_CATCH_GET_CHILD)) { + return; + } else { + zend_clear_exception(TSRMLS_C); + } + } } goto next_step; } @@ -299,6 +328,13 @@ if (object-level 0) { if (object-endChildren) { zend_call_method_with_0_params(zthis, object-ce, object-endChildren, endchildren, NULL); +
[PHP-CVS] cvs: php-src(PHP_4_4) /ext/curl curl.c
helly Sun May 21 18:48:50 2006 UTC Modified files: (Branch: PHP_4_4) /php-src/ext/curl curl.c Log: - Fix build http://cvs.php.net/viewcvs.cgi/php-src/ext/curl/curl.c?r1=1.124.2.30.2.10r2=1.124.2.30.2.11diff_format=u Index: php-src/ext/curl/curl.c diff -u php-src/ext/curl/curl.c:1.124.2.30.2.10 php-src/ext/curl/curl.c:1.124.2.30.2.11 --- php-src/ext/curl/curl.c:1.124.2.30.2.10 Sun May 21 16:32:51 2006 +++ php-src/ext/curl/curl.c Sun May 21 18:48:50 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: curl.c,v 1.124.2.30.2.10 2006/05/21 16:32:51 iliaa Exp $ */ +/* $Id: curl.c,v 1.124.2.30.2.11 2006/05/21 18:48:50 helly Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -84,6 +84,7 @@ #define SMART_STR_PREALLOC 4096 #include ext/standard/php_smart_str.h +#include ext/standard/php_string.h #include ext/standard/info.h #include ext/standard/file.h #include ext/standard/url.h -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /tests/classes abstract_by_interface_001.phpt abstract_by_interface_002.phpt
helly Sat May 20 11:34:58 2006 UTC Added files: /php-src/tests/classes abstract_by_interface_001.phpt abstract_by_interface_002.phpt Log: - Add new tests http://cvs.php.net/viewcvs.cgi/php-src/tests/classes/abstract_by_interface_001.phpt?view=markuprev=1.1 Index: php-src/tests/classes/abstract_by_interface_001.phpt +++ php-src/tests/classes/abstract_by_interface_001.phpt --TEST-- ZE2 An abstract method may not be called --FILE-- ?php class Root { } interface MyInterface { function MyInterfaceFunc(); } abstract class Derived extends Root implements MyInterface { } class Leaf extends Derived { function MyInterfaceFunc() {} } var_dump(new Leaf); class Fails extends Root implements MyInterface { } ? ===DONE=== --EXPECTF-- object(Leaf)#%d (0) { } Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_001.php on line %d http://cvs.php.net/viewcvs.cgi/php-src/tests/classes/abstract_by_interface_002.phpt?view=markuprev=1.1 Index: php-src/tests/classes/abstract_by_interface_002.phpt +++ php-src/tests/classes/abstract_by_interface_002.phpt --TEST-- ZE2 An abstract method may not be called --FILE-- ?php class Root { } interface MyInterface { static function MyInterfaceFunc(); } abstract class Derived extends Root implements MyInterface { } class Leaf extends Derived { static function MyInterfaceFunc() {} } var_dump(new Leaf); class Fails extends Root implements MyInterface { } ? ===DONE=== --EXPECTF-- object(Leaf)#%d (0) { } Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_002.php 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) /tests/classes abstract_by_interface_001.phpt abstract_by_interface_002.phpt
helly Sat May 20 11:35:38 2006 UTC Added files: (Branch: PHP_5_2) /php-src/tests/classes abstract_by_interface_001.phpt abstract_by_interface_002.phpt Log: - MFH Add new tests http://cvs.php.net/viewcvs.cgi/php-src/tests/classes/abstract_by_interface_001.phpt?view=markuprev=1.1 Index: php-src/tests/classes/abstract_by_interface_001.phpt +++ php-src/tests/classes/abstract_by_interface_001.phpt --TEST-- ZE2 An abstract method may not be called --FILE-- ?php class Root { } interface MyInterface { function MyInterfaceFunc(); } abstract class Derived extends Root implements MyInterface { } class Leaf extends Derived { function MyInterfaceFunc() {} } var_dump(new Leaf); class Fails extends Root implements MyInterface { } ? ===DONE=== --EXPECTF-- object(Leaf)#%d (0) { } Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_001.php on line %d http://cvs.php.net/viewcvs.cgi/php-src/tests/classes/abstract_by_interface_002.phpt?view=markuprev=1.1 Index: php-src/tests/classes/abstract_by_interface_002.phpt +++ php-src/tests/classes/abstract_by_interface_002.phpt --TEST-- ZE2 An abstract method may not be called --FILE-- ?php class Root { } interface MyInterface { static function MyInterfaceFunc(); } abstract class Derived extends Root implements MyInterface { } class Leaf extends Derived { static function MyInterfaceFunc() {} } var_dump(new Leaf); class Fails extends Root implements MyInterface { } ? ===DONE=== --EXPECTF-- object(Leaf)#%d (0) { } Fatal error: Class Fails contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (MyInterface::MyInterfaceFunc) in %sabstract_by_interface_002.php 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 / .gdbinit
helly Sat May 20 12:44:46 2006 UTC Modified files: /php-src.gdbinit Log: - In printzv show private/protected visibility and class in case of private http://cvs.php.net/viewcvs.cgi/php-src/.gdbinit?r1=1.17r2=1.18diff_format=u Index: php-src/.gdbinit diff -u php-src/.gdbinit:1.17 php-src/.gdbinit:1.18 --- php-src/.gdbinit:1.17 Mon Mar 13 22:54:05 2006 +++ php-src/.gdbinitSat May 20 12:44:46 2006 @@ -69,7 +69,7 @@ if ! $arg1 printf {\n set $ind = $ind + 1 - print_ht $zvalue-value.ht + print_ht $zvalue-value.ht 0 set $ind = $ind - 1 set $i = $ind while $i 0 @@ -103,7 +103,7 @@ printf (%d): , $ht-nNumOfElements printf {\n set $ind = $ind + 1 - print_ht $ht + print_ht $ht 1 set $ind = $ind - 1 set $i = $ind while $i 0 @@ -190,6 +190,7 @@ define print_ht set $ht = $arg0 + set $obj = $arg1 set $p = $ht-pListHead while $p != 0 @@ -201,8 +202,20 @@ set $i = $i - 1 end - if $p-nKeyLength 0 - printf \%s\ = , $p-key.arKey.s + if $p-nKeyLength 0 + if $obj $p-key.arKey.s[0] == 0 + if $p-key.arKey.s[1] == '*' + printf \protected %s\ = , $p-key.arKey.s+3 + else + set $n = 1 + while $n $p-nKeyLength $p-key.arKey.s[$n] != 0 + set $n = $n + 1 + end + printf \private %s::%s\ = , $p-key.arKey.s+1, $p-key.arKey.s+$n+1 + end + else + printf \%s\ = , $p-key.arKey.s + end else printf %d = , $p-h end @@ -215,7 +228,7 @@ define print_ht set $ind = 1 printf [0x%08x] {\n, $arg0 - print_ht $arg0 + print_ht $arg0 0 printf }\n end -- 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 spl_iterators.h /ext/spl/tests iterator_041.phpt
helly Sat May 20 13:23:00 2006 UTC Added files: /php-src/ext/spl/tests iterator_041.phpt Modified files: /php-src/ext/splspl_iterators.c spl_iterators.h Log: - Provide a generic c-level iterator apply function - Base iterator_to_array() and iterator_count() on it - Add a testcase # Somehow there is an issue with exceptions in __destruct() here http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_iterators.c?r1=1.128r2=1.129diff_format=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.128 php-src/ext/spl/spl_iterators.c:1.129 --- php-src/ext/spl/spl_iterators.c:1.128 Thu May 18 21:41:37 2006 +++ php-src/ext/spl/spl_iterators.c Sat May 20 13:23:00 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.128 2006/05/18 21:41:37 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.129 2006/05/20 13:23:00 helly Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -2401,67 +2401,107 @@ {NULL, NULL, NULL} }; -/* {{{ proto array iterator_to_array(Traversable it) - Copy the iterator into an array */ -PHP_FUNCTION(iterator_to_array) +PHPAPI int spl_iterator_apply(zval *obj, spl_iterator_apply_func_t apply_func, void *puser TSRMLS_DC) { - zval *obj, **data; zend_object_iterator *iter; - zstrstr_key; - uintstr_key_len; - ulong int_key; - int key_type; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, O, obj, zend_ce_traversable) == FAILURE) { - RETURN_FALSE; - } - - array_init(return_value); - + obj-refcount++; iter = Z_OBJCE_P(obj)-get_iterator(Z_OBJCE_P(obj), obj, 0 TSRMLS_CC); + if (EG(exception)) { + goto done; + } + if (iter-funcs-rewind) { iter-funcs-rewind(iter TSRMLS_CC); + if (EG(exception)) { + goto done; + } } - if (EG(exception)) { - return; - } + while (iter-funcs-valid(iter TSRMLS_CC) == SUCCESS) { - iter-funcs-get_current_data(iter, data TSRMLS_CC); if (EG(exception)) { - return; + goto done; } - (*data)-refcount++; - if (iter-funcs-get_current_key) { - key_type = iter-funcs-get_current_key(iter, str_key, str_key_len, int_key TSRMLS_CC); - if (EG(exception)) { - return; - } - switch(key_type) { - case HASH_KEY_IS_STRING: - add_assoc_zval_ex(return_value, str_key.s, str_key_len, *data); - efree(str_key.s); - break; - case HASH_KEY_IS_UNICODE: - add_u_assoc_zval_ex(return_value, IS_UNICODE, str_key, str_key_len, *data); - efree(str_key.u); - break; - case HASH_KEY_IS_LONG: - add_index_zval(return_value, int_key, *data); - break; - } - } else { - add_next_index_zval(return_value, *data); + if (apply_func(iter, puser TSRMLS_CC) == ZEND_HASH_APPLY_STOP || EG(exception)) { + goto done; } iter-funcs-move_forward(iter TSRMLS_CC); if (EG(exception)) { - return; + goto done; } } + +done: iter-funcs-dtor(iter TSRMLS_CC); + if (obj-refcount 0 !EG(exception)) { + zval_ptr_dtor(obj); + } + return EG(exception) ? FAILURE : SUCCESS; +} +/* }}} */ + +static int spl_iterator_to_array_apply(zend_object_iterator *iter, void *puser TSRMLS_DC) /* {{{ */ +{ + zval**data, *return_value = (zval*)puser; + zstrstr_key; + uintstr_key_len; + ulong int_key; + int key_type; + + iter-funcs-get_current_data(iter, data TSRMLS_CC); if (EG(exception)) { - return; + return ZEND_HASH_APPLY_STOP; } + if (iter-funcs-get_current_key) { + key_type = iter-funcs-get_current_key(iter, str_key, str_key_len, int_key TSRMLS_CC); + if (EG(exception)) { + return ZEND_HASH_APPLY_STOP; + }