[PHP-CVS] cvs: php-src /scripts Makefile.frag
sniper Tue Mar 1 04:25:37 2005 EDT Modified files: /php-src/scriptsMakefile.frag Log: ws http://cvs.php.net/diff.php/php-src/scripts/Makefile.frag?r1=1.15&r2=1.16&ty=u Index: php-src/scripts/Makefile.frag diff -u php-src/scripts/Makefile.frag:1.15 php-src/scripts/Makefile.frag:1.16 --- php-src/scripts/Makefile.frag:1.15 Mon Feb 28 00:21:35 2005 +++ php-src/scripts/Makefile.frag Tue Mar 1 04:25:36 2005 @@ -47,7 +47,7 @@ ext/xml/expat/ \ ext/mbstring/ \ ext/mbstring/libmbfl/ \ -ext/mbstring/libmbfl/mbfl/ \ + ext/mbstring/libmbfl/mbfl/ \ ext/sqlite/libsqlite/src/sqlite.h install-headers: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard var_unserializer.c
sniper Tue Mar 1 04:26:29 2005 EDT Modified files: /php-src/ext/standard var_unserializer.c Log: update http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.58&r2=1.59&ty=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.58 php-src/ext/standard/var_unserializer.c:1.59 --- php-src/ext/standard/var_unserializer.c:1.58Sun Feb 27 06:30:41 2005 +++ php-src/ext/standard/var_unserializer.c Tue Mar 1 04:26:28 2005 @@ -1,4 +1,4 @@ -/* Generated by re2c 0.9.4 on Thu Feb 24 19:48:52 2005 */ +/* Generated by re2c 0.9.4 on Tue Mar 1 03:49:26 2005 */ #line 1 "/usr/src/php/php5/ext/standard/var_unserializer.re" /* +--+ @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.58 2005/02/27 11:30:41 stas Exp $ */ +/* $Id: var_unserializer.c,v 1.59 2005/03/01 09:26:28 sniper Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -448,7 +448,7 @@ if(yych == ':') goto yy87; goto yy4; yy4: -#line 621 "/usr/src/php/php5/ext/standard/var_unserializer.re" +#line 625 "/usr/src/php/php5/ext/standard/var_unserializer.re" { return 0; } #line 103 "" yy5: yyaccept = 0; @@ -489,7 +489,7 @@ yy14: ++YYCURSOR; goto yy15; yy15: -#line 615 "/usr/src/php/php5/ext/standard/var_unserializer.re" +#line 619 "/usr/src/php/php5/ext/standard/var_unserializer.re" { /* this is the case where we have less data than planned */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); @@ -518,7 +518,7 @@ yy22: ++YYCURSOR; goto yy23; yy23: -#line 503 "/usr/src/php/php5/ext/standard/var_unserializer.re" +#line 507 "/usr/src/php/php5/ext/standard/var_unserializer.re" { size_t len, len2, len3, maxlen; int elements; @@ -659,7 +659,7 @@ yy29: ++YYCURSOR; goto yy30; yy30: -#line 495 "/usr/src/php/php5/ext/standard/var_unserializer.re" +#line 499 "/usr/src/php/php5/ext/standard/var_unserializer.re" { INIT_PZVAL(*rval); @@ -697,6 +697,10 @@ *p = YYCURSOR; + if (elements < 0) { + return 0; + } + INIT_PZVAL(*rval); Z_TYPE_PP(rval) = IS_ARRAY; ALLOC_HASHTABLE(Z_ARRVAL_PP(rval)); @@ -709,7 +713,7 @@ return finish_nested_data(UNSERIALIZE_PASSTHRU); } -#line 365 "" +#line 369 "" yy38: yych = *++YYCURSOR; if(yych == '+') goto yy39; if(yych <= '/') goto yy2; @@ -761,7 +765,7 @@ ZVAL_STRINGL(*rval, str, len, 1); return 1; } -#line 418 "" +#line 422 "" yy45: yych = *++YYCURSOR; if(yych <= '/'){ if(yych <= ','){ @@ -857,7 +861,7 @@ ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL)); return 1; } -#line 516 "" +#line 520 "" yy57: yych = *++YYCURSOR; if(yych <= ','){ if(yych != '+') goto yy2; @@ -932,7 +936,7 @@ return 1; } -#line 593 "" +#line 597 "" yy68: yych = *++YYCURSOR; if(yych == 'N') goto yy65; goto yy2; @@ -968,7 +972,7 @@ ZVAL_LONG(*rval, parse_iv(start + 2)); return 1; } -#line 630 "" +#line 634 "" yy75: yych = *++YYCURSOR; if(yych <= '/') goto yy2; if(yych >= '2') goto yy2; @@ -986,7 +990,7 @@ ZVAL_BOOL(*rval, parse_iv(start + 2)); return 1; } -#line 648 "" +#line 652 "" yy79: ++YYCURSOR; goto yy80; yy80: @@ -997,7 +1001,7 @@ ZVAL_NULL(*rval); return 1; } -#line 659 "" +#line 663 "" yy81: yych = *++YYCURSOR; if(yych <= ','){ if(yych != '+') goto yy2; @@ -1046,7 +1050,7 @@ return 1; } -#line 709 "" +#line 713 "" yy87: yych = *++YYCURSOR; if(yych <= ','){ if(yych != '+') goto yy2; @@ -1093,9 +1097,9 @@ return 1; } -#line 757 "" +#line 761 "" } -#line 623 "/usr/src/php/php5/ext/standard/var_unserializer.re" +#line 627 "/usr/src/php/php5/ext/standard/var_unserializer.re" return 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/spl spl_iterators.c
helly Tue Mar 1 05:05:13 2005 EDT Modified files: /php-src/ext/splspl_iterators.c Log: - Need to store class entry http://cvs.php.net/diff.php/php-src/ext/spl/spl_iterators.c?r1=1.63&r2=1.64&ty=u Index: php-src/ext/spl/spl_iterators.c diff -u php-src/ext/spl/spl_iterators.c:1.63 php-src/ext/spl/spl_iterators.c:1.64 --- php-src/ext/spl/spl_iterators.c:1.63Tue Feb 22 20:03:16 2005 +++ php-src/ext/spl/spl_iterators.c Tue Mar 1 05:05:12 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_iterators.c,v 1.63 2005/02/23 01:03:16 helly Exp $ */ +/* $Id: spl_iterators.c,v 1.64 2005/03/01 10:05:12 helly Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -689,6 +689,7 @@ if (instanceof_function(ce, zend_ce_aggregate TSRMLS_CC)) { zval *retval; zobject = zend_call_method_with_0_params(&zobject, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval); + ce = Z_OBJCE_P(zobject); } } break; -- 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_array.c
helly Tue Mar 1 05:06:11 2005 EDT Modified files: /php-src/ext/splspl_array.c Log: - Fix #32130 (ArrayIterator::seek() does not throw an Exception on invalid index) http://cvs.php.net/diff.php/php-src/ext/spl/spl_array.c?r1=1.58&r2=1.59&ty=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.58 php-src/ext/spl/spl_array.c:1.59 --- php-src/ext/spl/spl_array.c:1.58Wed Jan 26 19:22:06 2005 +++ php-src/ext/spl/spl_array.c Tue Mar 1 05:06:11 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_array.c,v 1.58 2005/01/27 00:22:06 helly Exp $ */ +/* $Id: spl_array.c,v 1.59 2005/03/01 10:06:11 helly Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -726,10 +726,11 @@ Seek to position. */ SPL_METHOD(Array, seek) { - long position; + long opos, position; zval *object = getThis(); spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); HashTable *aht = HASH_OF(intern->array); + int result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &position) == FAILURE) { return; @@ -742,7 +743,17 @@ zend_hash_internal_pointer_reset_ex(aht, &intern->pos); - while (position-- > 0 && spl_array_next(intern TSRMLS_CC) == SUCCESS); + opos = position; + while (position-- > 0 && (result = spl_array_next(intern TSRMLS_CC)) == SUCCESS); + + if (intern->pos && intern->is_ref && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) { + /* fail */ + } else { + if (zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS) { + return; /* ok */ + } + } + zend_throw_exception_ex(spl_ce_OutOfBoundsException, 0 TSRMLS_CC, "Seek position %ld is out of range", opos); } /* }}} */ int spl_array_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */ -- 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) /ext/spl spl_array.c
helly Tue Mar 1 05:09:05 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/splspl_array.c Log: - MFH http://cvs.php.net/diff.php/php-src/ext/spl/spl_array.c?r1=1.49.2.2&r2=1.49.2.3&ty=u Index: php-src/ext/spl/spl_array.c diff -u php-src/ext/spl/spl_array.c:1.49.2.2 php-src/ext/spl/spl_array.c:1.49.2.3 --- php-src/ext/spl/spl_array.c:1.49.2.2Mon Jan 24 16:38:29 2005 +++ php-src/ext/spl/spl_array.c Tue Mar 1 05:09:05 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_array.c,v 1.49.2.2 2005/01/24 21:38:29 helly Exp $ */ +/* $Id: spl_array.c,v 1.49.2.3 2005/03/01 10:09:05 helly Exp $ */ #ifdef HAVE_CONFIG_H # include "config.h" @@ -713,10 +713,11 @@ Seek to position. */ SPL_METHOD(Array, seek) { - long position; + long opos, position; zval *object = getThis(); spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC); HashTable *aht = HASH_OF(intern->array); + int result; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &position) == FAILURE) { return; @@ -729,7 +730,17 @@ zend_hash_internal_pointer_reset_ex(aht, &intern->pos); - while (position-- > 0 && spl_array_next(intern TSRMLS_CC) == SUCCESS); + opos = position; + while (position-- > 0 && (result = spl_array_next(intern TSRMLS_CC)) == SUCCESS); + + if (intern->pos && intern->is_ref && spl_hash_verify_pos(intern TSRMLS_CC) == FAILURE) { + /* fail */ + } else { + if (zend_hash_has_more_elements_ex(aht, &intern->pos) == SUCCESS) { + return; /* ok */ + } + } + zend_throw_exception_ex(zend_exception_get_default(), 0 TSRMLS_CC, "Seek position %ld is out of range", opos); } /* }}} */ int spl_array_object_count_elements(zval *object, long *count TSRMLS_DC) /* {{{ */ -- 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) / NEWS
helly Tue Mar 1 05:11:08 2005 EDT Modified files: (Branch: PHP_5_0) /php-srcNEWS Log: - BFN http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.265&r2=1.1760.2.266&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.265 php-src/NEWS:1.1760.2.266 --- php-src/NEWS:1.1760.2.265 Mon Feb 28 21:21:57 2005 +++ php-src/NEWSTue Mar 1 05:11:07 2005 @@ -26,7 +26,9 @@ - Fixed segfault in mysqli_fetch_field_direct() when invalid field offset is passed. (Tony) - Fixed posix_getsid() & posix_getpgid() to return sid & pgid instead - of true. (Tony) + of true. (Tony) +- Fixed bug #32130 (ArrayIterator::seek() does not throw an Exception on + invalid index). (Marcus) - Fixed bug #32081 (in mysqli default socket value is not being used). (Ilia) - Fixed bug #32021 (Crash caused by range('', 'z')). (Derick) - Fixed bug #32011 (Fragments which replaced Nodes are not globaly useable). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard image.c
helly Tue Mar 1 05:14:19 2005 EDT Modified files: /php-src/ext/standard image.c Log: - MFB http://cvs.php.net/diff.php/php-src/ext/standard/image.c?r1=1.108&r2=1.109&ty=u Index: php-src/ext/standard/image.c diff -u php-src/ext/standard/image.c:1.108 php-src/ext/standard/image.c:1.109 --- php-src/ext/standard/image.c:1.108 Sun Feb 27 12:08:18 2005 +++ php-src/ext/standard/image.cTue Mar 1 05:14:18 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: image.c,v 1.108 2005/02/27 17:08:18 iliaa Exp $ */ +/* $Id: image.c,v 1.109 2005/03/01 10:14:18 helly Exp $ */ #include "php.h" #include @@ -629,12 +629,12 @@ result->width = php_read4(stream TSRMLS_CC); /* Ysiz */ #if MBO_0 - dummy_int = php_read4(stream TSRMLS_CC); /* XOsiz */ - dummy_int = php_read4(stream TSRMLS_CC); /* YOsiz */ - dummy_int = php_read4(stream TSRMLS_CC); /* XTsiz */ - dummy_int = php_read4(stream TSRMLS_CC); /* YTsiz */ - dummy_int = php_read4(stream TSRMLS_CC); /* XTOsiz */ - dummy_int = php_read4(stream TSRMLS_CC); /* YTOsiz */ + php_read4(stream TSRMLS_CC); /* XOsiz */ + php_read4(stream TSRMLS_CC); /* YOsiz */ + php_read4(stream TSRMLS_CC); /* XTsiz */ + php_read4(stream TSRMLS_CC); /* YTsiz */ + php_read4(stream TSRMLS_CC); /* XTOsiz */ + php_read4(stream TSRMLS_CC); /* YTOsiz */ #else if (php_stream_seek(stream, 24, SEEK_CUR)) { efree(result); -- 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) /ext/standard image.c
helly Tue Mar 1 05:13:15 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard image.c Log: - Fix warning http://cvs.php.net/diff.php/php-src/ext/standard/image.c?r1=1.98.2.5&r2=1.98.2.6&ty=u Index: php-src/ext/standard/image.c diff -u php-src/ext/standard/image.c:1.98.2.5 php-src/ext/standard/image.c:1.98.2.6 --- php-src/ext/standard/image.c:1.98.2.5 Sun Feb 27 12:08:26 2005 +++ php-src/ext/standard/image.cTue Mar 1 05:13:15 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: image.c,v 1.98.2.5 2005/02/27 17:08:26 iliaa Exp $ */ +/* $Id: image.c,v 1.98.2.6 2005/03/01 10:13:15 helly Exp $ */ #include "php.h" #include @@ -632,12 +632,12 @@ result->width = php_read4(stream TSRMLS_CC); /* Ysiz */ #if MBO_0 - dummy_int = php_read4(stream TSRMLS_CC); /* XOsiz */ - dummy_int = php_read4(stream TSRMLS_CC); /* YOsiz */ - dummy_int = php_read4(stream TSRMLS_CC); /* XTsiz */ - dummy_int = php_read4(stream TSRMLS_CC); /* YTsiz */ - dummy_int = php_read4(stream TSRMLS_CC); /* XTOsiz */ - dummy_int = php_read4(stream TSRMLS_CC); /* YTOsiz */ + php_read4(stream TSRMLS_CC); /* XOsiz */ + php_read4(stream TSRMLS_CC); /* YOsiz */ + php_read4(stream TSRMLS_CC); /* XTsiz */ + php_read4(stream TSRMLS_CC); /* YTsiz */ + php_read4(stream TSRMLS_CC); /* XTOsiz */ + php_read4(stream TSRMLS_CC); /* YTOsiz */ #else if (php_stream_seek(stream, 24, SEEK_CUR)) { efree(result); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/gmp gmp.c
tony2001Tue Mar 1 08:09:33 2005 EDT Modified files: /php-src/ext/gmpgmp.c Log: fix SIGFPE in gmp_powm(), gmp_sqrt() & gmp_sqrtrem() when using negative values do not allow negative value to be passed to gmp_fact() http://cvs.php.net/diff.php/php-src/ext/gmp/gmp.c?r1=1.46&r2=1.47&ty=u Index: php-src/ext/gmp/gmp.c diff -u php-src/ext/gmp/gmp.c:1.46 php-src/ext/gmp/gmp.c:1.47 --- php-src/ext/gmp/gmp.c:1.46 Wed Jun 9 10:39:33 2004 +++ php-src/ext/gmp/gmp.c Tue Mar 1 08:09:33 2005 @@ -781,7 +781,28 @@ Calculates factorial function */ ZEND_FUNCTION(gmp_fact) { - gmp_unary_ui_op(mpz_fac_ui); + zval **a_arg; + mpz_t *gmpnum_tmp; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ + WRONG_PARAM_COUNT; + } + + if (Z_TYPE_PP(a_arg) == IS_RESOURCE) { + FETCH_GMP_ZVAL(gmpnum_tmp, a_arg); + if (mpz_sgn(*gmpnum_tmp) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + } else { + convert_to_long_ex(a_arg); + if (Z_LVAL_PP(a_arg) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + } + + gmp_zval_unary_ui_op(return_value, a_arg, mpz_fac_ui); } /* }}} */ @@ -839,6 +860,10 @@ use_ui = 1; } else { FETCH_GMP_ZVAL(gmpnum_exp, exp_arg); + if (mpz_sgn(*gmpnum_exp) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Second parameter cannot be less than 0"); + RETURN_FALSE; + } } FETCH_GMP_ZVAL(gmpnum_mod, mod_arg); @@ -862,7 +887,24 @@ Takes integer part of square root of a */ ZEND_FUNCTION(gmp_sqrt) { - gmp_unary_op(mpz_sqrt); + zval **a_arg; + mpz_t *gmpnum_a, *gmpnum_result; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ + WRONG_PARAM_COUNT; + } + + FETCH_GMP_ZVAL(gmpnum_a, a_arg); + + if (mpz_sgn(*gmpnum_a) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + + INIT_GMP_NUM(gmpnum_result); + mpz_sqrt(*gmpnum_result, *gmpnum_a); + + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ @@ -879,7 +921,12 @@ } FETCH_GMP_ZVAL(gmpnum_a, a_arg); - + + if (mpz_sgn(*gmpnum_a) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + INIT_GMP_NUM(gmpnum_result1); INIT_GMP_NUM(gmpnum_result2); -- 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) / NEWS /ext/gmp gmp.c
tony2001Tue Mar 1 08:13:08 2005 EDT Modified files: (Branch: PHP_5_0) /php-srcNEWS /php-src/ext/gmpgmp.c Log: MFH: checks for negative values to gmp_sqrt(), gmp_powm(), gmp_sqrtrem() and gmp_fact() to prevent SIGFPE http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.266&r2=1.1760.2.267&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.266 php-src/NEWS:1.1760.2.267 --- php-src/NEWS:1.1760.2.266 Tue Mar 1 05:11:07 2005 +++ php-src/NEWSTue Mar 1 08:13:06 2005 @@ -3,6 +3,8 @@ ?? ??? 2005, PHP 5.0.4 - Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony) - Added length and charsetnr for field array and object in mysqli. (Georg) +- Added checks for negative values to gmp_sqrt(), gmp_powm(), gmp_sqrtrem() + and gmp_fact() to prevent SIGFPE. (Tony) - Changed foreach() to throw an exception if IteratorAggregate::getIterator() does not return an Iterator. (Marcus) - Changed phpize not to require libtool. (Jani) http://cvs.php.net/diff.php/php-src/ext/gmp/gmp.c?r1=1.46&r2=1.46.2.1&ty=u Index: php-src/ext/gmp/gmp.c diff -u php-src/ext/gmp/gmp.c:1.46 php-src/ext/gmp/gmp.c:1.46.2.1 --- php-src/ext/gmp/gmp.c:1.46 Wed Jun 9 10:39:33 2004 +++ php-src/ext/gmp/gmp.c Tue Mar 1 08:13:07 2005 @@ -781,7 +781,28 @@ Calculates factorial function */ ZEND_FUNCTION(gmp_fact) { - gmp_unary_ui_op(mpz_fac_ui); + zval **a_arg; + mpz_t *gmpnum_tmp; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ + WRONG_PARAM_COUNT; + } + + if (Z_TYPE_PP(a_arg) == IS_RESOURCE) { + FETCH_GMP_ZVAL(gmpnum_tmp, a_arg); + if (mpz_sgn(*gmpnum_tmp) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + } else { + convert_to_long_ex(a_arg); + if (Z_LVAL_PP(a_arg) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + } + + gmp_zval_unary_ui_op(return_value, a_arg, mpz_fac_ui); } /* }}} */ @@ -839,6 +860,10 @@ use_ui = 1; } else { FETCH_GMP_ZVAL(gmpnum_exp, exp_arg); + if (mpz_sgn(*gmpnum_exp) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Second parameter cannot be less than 0"); + RETURN_FALSE; + } } FETCH_GMP_ZVAL(gmpnum_mod, mod_arg); @@ -862,7 +887,24 @@ Takes integer part of square root of a */ ZEND_FUNCTION(gmp_sqrt) { - gmp_unary_op(mpz_sqrt); + zval **a_arg; + mpz_t *gmpnum_a, *gmpnum_result; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ + WRONG_PARAM_COUNT; + } + + FETCH_GMP_ZVAL(gmpnum_a, a_arg); + + if (mpz_sgn(*gmpnum_a) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + + INIT_GMP_NUM(gmpnum_result); + mpz_sqrt(*gmpnum_result, *gmpnum_a); + + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ @@ -880,6 +922,11 @@ FETCH_GMP_ZVAL(gmpnum_a, a_arg); + if (mpz_sgn(*gmpnum_a) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + INIT_GMP_NUM(gmpnum_result1); INIT_GMP_NUM(gmpnum_result2); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/gmp gmp.c
tony2001Tue Mar 1 08:18:32 2005 EDT Modified files: (Branch: PHP_4_3) /php-srcNEWS /php-src/ext/gmpgmp.c Log: MFH: checks for negative values to gmp_sqrt(), gmp_powm(), gmp_sqrtrem() and gmp_fact() to prevent SIGFPE changed zend_error() to php_error_docref() http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.846&r2=1.1247.2.847&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.846 php-src/NEWS:1.1247.2.847 --- php-src/NEWS:1.1247.2.846 Mon Feb 28 21:22:41 2005 +++ php-src/NEWSTue Mar 1 08:18:29 2005 @@ -2,6 +2,8 @@ ||| ?? ??? , Version 4.3.11 - Added Oracle Instant Client support. (cjbj at hotmail dot com, Tony) +- Added checks for negative values to gmp_sqrt(), gmp_powm(), gmp_sqrtrem() + and gmp_fact() to prevent SIGFPE. (Tony) - Changed phpize not to require libtool. (Jani) - Updated bundled libmbfl library (used for multibyte functions). (Moriyoshi) - Fixed bug #32114 (DOM crashing when attribute appended to Document). (Rob) http://cvs.php.net/diff.php/php-src/ext/gmp/gmp.c?r1=1.29.4.11&r2=1.29.4.12&ty=u Index: php-src/ext/gmp/gmp.c diff -u php-src/ext/gmp/gmp.c:1.29.4.11 php-src/ext/gmp/gmp.c:1.29.4.12 --- php-src/ext/gmp/gmp.c:1.29.4.11 Wed Jun 9 10:39:36 2004 +++ php-src/ext/gmp/gmp.c Tue Mar 1 08:18:31 2005 @@ -251,7 +251,7 @@ } break; default: - zend_error(E_WARNING,"Unable to convert variable to GMP - wrong type"); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unable to convert variable to GMP - wrong type"); efree(*gmpnumber); return FAILURE; } @@ -504,7 +504,7 @@ convert_to_long_ex(base_arg); base = Z_LVAL_PP(base_arg); if(base < 2 || base > 36) { - zend_error(E_WARNING, "Bad base for conversion: %d (should be between 2 and 36)", base); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %d (should be between 2 and 36)", base); RETURN_FALSE; } } @@ -566,7 +566,7 @@ } if(base < 2 || base > 36) { - zend_error(E_WARNING, "Bad base for conversion: %d", base); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %d", base); RETURN_FALSE; } @@ -770,7 +770,28 @@ Calculates factorial function */ ZEND_FUNCTION(gmp_fact) { - gmp_unary_ui_op(mpz_fac_ui); + zval **a_arg; + mpz_t *gmpnum_tmp; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ + WRONG_PARAM_COUNT; + } + + if (Z_TYPE_PP(a_arg) == IS_RESOURCE) { + FETCH_GMP_ZVAL(gmpnum_tmp, a_arg); + if (mpz_sgn(*gmpnum_tmp) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + } else { + convert_to_long_ex(a_arg); + if (Z_LVAL_PP(a_arg) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + } + + gmp_zval_unary_ui_op(return_value, a_arg, mpz_fac_ui); } /* }}} */ @@ -795,7 +816,7 @@ convert_to_long_ex(exp_arg); if(Z_LVAL_PP(exp_arg) < 0) { - zend_error(E_WARNING,"Negative exponent not supported"); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Negative exponent not supported"); RETURN_FALSE; } @@ -827,6 +848,10 @@ use_ui=1; } else { FETCH_GMP_ZVAL(gmpnum_exp, exp_arg); + if (mpz_sgn(*gmpnum_exp) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Second parameter cannot be less than 0"); + RETURN_FALSE; + } } FETCH_GMP_ZVAL(gmpnum_mod, mod_arg); @@ -850,7 +875,24 @@ Takes integer part of square root of a */ ZEND_FUNCTION(gmp_sqrt) { - gmp_unary_op(mpz_sqrt); + zval **a_arg; + mpz_t *gmpnum_a, *gmpnum_result; + + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ + WRONG_PARAM_COUNT; + } + + FETCH_GMP_ZVAL(gmpnum_a, a_arg); + + if (mpz_sgn(*gmpnum_a) < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); + RETURN_FALSE; + } + + INIT_GMP_NUM(gmpnum_result); + mpz_sqrt(*gmpnum_result, *gmpnum_a); + + ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */
[PHP-CVS] cvs: php-src /ext/standard image.c
sesser Tue Mar 1 08:53:03 2005 EDT Modified files: /php-src/ext/standard image.c Log: Handle last or broken JP2 boxes correctly. http://cvs.php.net/diff.php/php-src/ext/standard/image.c?r1=1.109&r2=1.110&ty=u Index: php-src/ext/standard/image.c diff -u php-src/ext/standard/image.c:1.109 php-src/ext/standard/image.c:1.110 --- php-src/ext/standard/image.c:1.109 Tue Mar 1 05:14:18 2005 +++ php-src/ext/standard/image.cTue Mar 1 08:53:02 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: image.c,v 1.109 2005/03/01 10:14:18 helly Exp $ */ +/* $Id: image.c,v 1.110 2005/03/01 13:53:02 sesser Exp $ */ #include "php.h" #include @@ -708,6 +708,11 @@ break; } + /* Stop if this was the last box */ + if ((int)box_length <= 0) { + break; + } + /* Skip over LBox (Which includes both TBox and LBox itself */ if (php_stream_seek(stream, box_length - 8, SEEK_CUR)) { break; -- 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) /ext/standard image.c
sesser Tue Mar 1 08:53:19 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard image.c Log: MFH http://cvs.php.net/diff.php/php-src/ext/standard/image.c?r1=1.98.2.6&r2=1.98.2.7&ty=u Index: php-src/ext/standard/image.c diff -u php-src/ext/standard/image.c:1.98.2.6 php-src/ext/standard/image.c:1.98.2.7 --- php-src/ext/standard/image.c:1.98.2.6 Tue Mar 1 05:13:15 2005 +++ php-src/ext/standard/image.cTue Mar 1 08:53:19 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: image.c,v 1.98.2.6 2005/03/01 10:13:15 helly Exp $ */ +/* $Id: image.c,v 1.98.2.7 2005/03/01 13:53:19 sesser Exp $ */ #include "php.h" #include @@ -711,6 +711,11 @@ break; } + /* Stop if this was the last box */ + if ((int)box_length <= 0) { + break; + } + /* Skip over LBox (Which includes both TBox and LBox itself */ if (php_stream_seek(stream, box_length - 8, SEEK_CUR)) { break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/standard image.c
sesser Tue Mar 1 08:53:35 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/standard image.c Log: MFH http://cvs.php.net/diff.php/php-src/ext/standard/image.c?r1=1.72.2.16&r2=1.72.2.17&ty=u Index: php-src/ext/standard/image.c diff -u php-src/ext/standard/image.c:1.72.2.16 php-src/ext/standard/image.c:1.72.2.17 --- php-src/ext/standard/image.c:1.72.2.16 Thu Feb 24 15:54:18 2005 +++ php-src/ext/standard/image.cTue Mar 1 08:53:35 2005 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: image.c,v 1.72.2.16 2005/02/24 20:54:18 helly Exp $ */ +/* $Id: image.c,v 1.72.2.17 2005/03/01 13:53:35 sesser Exp $ */ #include "php.h" #include @@ -711,6 +711,11 @@ break; } + /* Stop if this was the last box */ + if ((int)box_length <= 0) { + break; + } + /* Skip over LBox (Which includes both TBox and LBox itself */ if (php_stream_seek(stream, box_length - 8, SEEK_CUR)) { 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 string.c
hyanantha Tue Mar 1 09:59:38 2005 EDT Modified files: /php-src/ext/standard string.c Log: NetWare allows directory seperator as \ and / http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.428&r2=1.429&ty=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.428 php-src/ext/standard/string.c:1.429 --- php-src/ext/standard/string.c:1.428 Tue Jan 18 10:47:57 2005 +++ php-src/ext/standard/string.c Tue Mar 1 09:59:37 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.428 2005/01/18 15:47:57 iliaa Exp $ */ +/* $Id: string.c,v 1.429 2005/03/01 14:59:37 hyanantha Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -1142,7 +1142,7 @@ case 0: goto quit_loop; case 1: -#ifdef PHP_WIN32 +#if defined(PHP_WIN32) || defined(NETWARE) if (*c == '/' || *c == '\\') { #else if (*c == '/') { -- 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) /ext/standard string.c
hyanantha Tue Mar 1 10:01:08 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard string.c Log: NetWare allows directory seperator as \ and / http://cvs.php.net/diff.php/php-src/ext/standard/string.c?r1=1.420.2.5&r2=1.420.2.6&ty=u Index: php-src/ext/standard/string.c diff -u php-src/ext/standard/string.c:1.420.2.5 php-src/ext/standard/string.c:1.420.2.6 --- php-src/ext/standard/string.c:1.420.2.5 Tue Jan 18 10:48:39 2005 +++ php-src/ext/standard/string.c Tue Mar 1 10:01:08 2005 @@ -18,7 +18,7 @@ +--+ */ -/* $Id: string.c,v 1.420.2.5 2005/01/18 15:48:39 iliaa Exp $ */ +/* $Id: string.c,v 1.420.2.6 2005/03/01 15:01:08 hyanantha Exp $ */ /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */ @@ -1090,7 +1090,7 @@ case 0: goto quit_loop; case 1: -#ifdef PHP_WIN32 +#if defined(PHP_WIN32) || defined(NETWARE) if (*c == '/' || *c == '\\') { #else if (*c == '/') { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] Re: thanks!
Your document. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /pear/Console Getopt.php
andrei Tue Mar 1 13:19:13 2005 EDT Modified files: /php-src/pear/Console Getopt.php Log: Allow = sign in long option argument. Fixes PEAR bug #1831. http://cvs.php.net/diff.php/php-src/pear/Console/Getopt.php?r1=1.28&r2=1.29&ty=u Index: php-src/pear/Console/Getopt.php diff -u php-src/pear/Console/Getopt.php:1.28 php-src/pear/Console/Getopt.php:1.29 --- php-src/pear/Console/Getopt.php:1.28Thu Jan 8 12:33:10 2004 +++ php-src/pear/Console/Getopt.php Tue Mar 1 13:19:12 2005 @@ -16,7 +16,7 @@ // | Author: Andrei Zmievski <[EMAIL PROTECTED]> | // +--+ // -// $Id: Getopt.php,v 1.28 2004/01/08 17:33:10 sniper Exp $ +// $Id: Getopt.php,v 1.29 2005/03/01 18:19:12 andrei Exp $ require_once 'PEAR.php'; @@ -184,7 +184,7 @@ */ function _parseLongOption($arg, $long_options, &$opts, &$args) { -@list($opt, $opt_arg) = explode('=', $arg); +@list($opt, $opt_arg) = explode('=', $arg, 2); $opt_len = strlen($opt); for ($i = 0; $i < count($long_options); $i++) { -- 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) /pear/Console Getopt.php
andrei Tue Mar 1 13:19:48 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/pear/Console Getopt.php Log: Allow = sign in long option argument. Fixes PEAR bug #1831. http://cvs.php.net/diff.php/php-src/pear/Console/Getopt.php?r1=1.21.4.8&r2=1.21.4.9&ty=u Index: php-src/pear/Console/Getopt.php diff -u php-src/pear/Console/Getopt.php:1.21.4.8 php-src/pear/Console/Getopt.php:1.21.4.9 --- php-src/pear/Console/Getopt.php:1.21.4.8Thu Dec 11 14:28:25 2003 +++ php-src/pear/Console/Getopt.php Tue Mar 1 13:19:48 2005 @@ -16,7 +16,7 @@ // | Author: Andrei Zmievski <[EMAIL PROTECTED]> | // +--+ // -// $Id: Getopt.php,v 1.21.4.8 2003/12/11 19:28:25 andrei Exp $ +// $Id: Getopt.php,v 1.21.4.9 2005/03/01 18:19:48 andrei Exp $ require_once 'PEAR.php'; @@ -184,7 +184,7 @@ */ function _parseLongOption($arg, $long_options, &$opts, &$args) { -@list($opt, $opt_arg) = explode('=', $arg); +@list($opt, $opt_arg) = explode('=', $arg, 2); $opt_len = strlen($opt); for ($i = 0; $i < count($long_options); $i++) { -- 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) /pear/Console Getopt.php
andrei Tue Mar 1 13:20:26 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/pear/Console Getopt.php Log: Allow = sign in long option argument. Fixes PEAR bug #1831. http://cvs.php.net/diff.php/php-src/pear/Console/Getopt.php?r1=1.28&r2=1.28.4.1&ty=u Index: php-src/pear/Console/Getopt.php diff -u php-src/pear/Console/Getopt.php:1.28 php-src/pear/Console/Getopt.php:1.28.4.1 --- php-src/pear/Console/Getopt.php:1.28Thu Jan 8 12:33:10 2004 +++ php-src/pear/Console/Getopt.php Tue Mar 1 13:20:26 2005 @@ -16,7 +16,7 @@ // | Author: Andrei Zmievski <[EMAIL PROTECTED]> | // +--+ // -// $Id: Getopt.php,v 1.28 2004/01/08 17:33:10 sniper Exp $ +// $Id: Getopt.php,v 1.28.4.1 2005/03/01 18:20:26 andrei Exp $ require_once 'PEAR.php'; @@ -184,7 +184,7 @@ */ function _parseLongOption($arg, $long_options, &$opts, &$args) { -@list($opt, $opt_arg) = explode('=', $arg); +@list($opt, $opt_arg) = explode('=', $arg, 2); $opt_len = strlen($opt); for ($i = 0; $i < count($long_options); $i++) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pdo_oci/tests connection.inc pdo_001.phpt pdo_002.phpt pdo_003.phpt pdo_004.phpt pdo_005.phpt pdo_006.phpt pdo_007.phpt pdo_008.phpt pdo_009.phpt pdo_010.phpt pdo_011.phpt pdo_012.phpt pdo_013.phpt pdo_014.phpt pdo_015.phpt prepare.inc skipif.inc
magnus Tue Mar 1 16:09:12 2005 EDT Added files: /php-src/ext/pdo_oci/tests connection.inc pdo_001.phpt pdo_002.phpt pdo_003.phpt pdo_004.phpt pdo_005.phpt pdo_006.phpt pdo_007.phpt pdo_008.phpt pdo_009.phpt pdo_010.phpt pdo_011.phpt pdo_012.phpt pdo_013.phpt pdo_014.phpt pdo_015.phpt prepare.inc skipif.inc Log: Add Oracle tests for PDO. http://cvs.php.net/co.php/php-src/ext/pdo_oci/tests/connection.inc?r=1.1&p=1 Index: php-src/ext/pdo_oci/tests/connection.inc +++ php-src/ext/pdo_oci/tests/connection.inc http://cvs.php.net/co.php/php-src/ext/pdo_oci/tests/pdo_001.phpt?r=1.1&p=1 Index: php-src/ext/pdo_oci/tests/pdo_001.phpt +++ php-src/ext/pdo_oci/tests/pdo_001.phpt --TEST-- PDO_OCI: PDO_FETCH_ASSOC --SKIPIF-- --FILE-- ===DONE=== --EXPECT-- array(3) { [0]=> array(2) { ["id"]=> string(1) "1" ["val"]=> string(1) "A" } [1]=> array(2) { ["id"]=> string(1) "2" ["val"]=> string(1) "B" } [2]=> array(2) { ["id"]=> string(1) "3" ["val"]=> string(1) "C" } } ===DONE=== http://cvs.php.net/co.php/php-src/ext/pdo_oci/tests/pdo_002.phpt?r=1.1&p=1 Index: php-src/ext/pdo_oci/tests/pdo_002.phpt +++ php-src/ext/pdo_oci/tests/pdo_002.phpt --TEST-- PDO_OCI: PDO_FETCH_NUM --SKIPIF-- --FILE-- ===DONE=== --EXPECT-- array(3) { [0]=> array(2) { [0]=> string(1) "1" [1]=> string(1) "A" } [1]=> array(2) { [0]=> string(1) "2" [1]=> string(1) "B" } [2]=> array(2) { [0]=> string(1) "3" [1]=> string(1) "C" } } ===DONE=== http://cvs.php.net/co.php/php-src/ext/pdo_oci/tests/pdo_003.phpt?r=1.1&p=1 Index: php-src/ext/pdo_oci/tests/pdo_003.phpt +++ php-src/ext/pdo_oci/tests/pdo_003.phpt --TEST-- PDO_OCI: PDO_FETCH_BOTH --SKIPIF-- --FILE-- ===DONE=== --EXPECT-- array(3) { [0]=> array(4) { ["id"]=> string(1) "1" [0]=> string(1) "1" ["val"]=> string(1) "A" [1]=> string(1) "A" } [1]=> array(4) { ["id"]=> string(1) "2" [0]=> string(1) "2" ["val"]=> string(1) "B" [1]=> string(1) "B" } [2]=> array(4) { ["id"]=> string(1) "3" [0]=> string(1) "3" ["val"]=> string(1) "C" [1]=> string(1) "C" } } ===DONE=== http://cvs.php.net/co.php/php-src/ext/pdo_oci/tests/pdo_004.phpt?r=1.1&p=1 Index: php-src/ext/pdo_oci/tests/pdo_004.phpt +++ php-src/ext/pdo_oci/tests/pdo_004.phpt --TEST-- PDO_OCI: PDO_FETCH_OBJ --SKIPIF-- --FILE-- ===DONE=== --EXPECTF-- array(3) { [0]=> object(stdClass)#%d (2) { ["id"]=> string(1) "1" ["val"]=> string(1) "A" } [1]=> object(stdClass)#%d (2) { ["id"]=> string(1) "2" ["val"]=> string(1) "B" } [2]=> object(stdClass)#%d (2) { ["id"]=> string(1) "3" ["val"]=> string(1) "C" } } ===DONE=== http://cvs.php.net/co.php/php-src/ext/pdo_oci/tests/pdo_005.phpt?r=1.1&p=1 Index: php-src/ext/pdo_oci/tests/pdo_005.phpt +++ php-src/ext/pdo_oci/tests/pdo_005.phpt --TEST-- PDO_OCI: PDO_FETCH_CLASS --SKIPIF-- --FILE-- ===DONE=== --EXPECTF-- array(3) { [0]=> object(stdClass)#%d (3) { ["id"]=> string(1) "1" ["val"]=> string(1) "A" ["val2"]=> string(2) "AA" } [1]=> object(stdClass)#%d (3) { ["id"]=> string(1) "2" ["val"]=> string(1) "B" ["val2"]=> string(2) "BB" } [2]=> object(stdClass)#%d (3) { ["id"]=> string(1) "3" ["val"]=> string(1) "C" ["val2"]=> string(2) "CC" } } array(3) { [0]=> object(TestBase)#%d (3) { ["id"]=> string(1) "1" ["val:protected"]=> string(1) "A" ["val2:private"]=> string(2) "AA" } [1]=> object(TestBase)#%d (3) { ["id"]=> string(1) "2" ["val:protected"]=> string(1) "B" ["val2:private"]=> string(2) "BB" } [2]=> object(TestBase)#%d (3) { ["id"]=> string(1) "3" ["val:protected"]=> string(1) "C" ["val2:private"]=> string(2) "CC" } } TestDerived::__construct(0,1) TestDerived::__construct(1,2) TestDerived::__construct(2,3) array(3) { [0]=> object(TestDerived)#%d (5) { ["row:protected"]=> int(0) ["id"]=> string(1) "1" ["val:protected"]=> string(1) "A" ["val2:private"]=> NULL ["val2"]=> string(2) "AA" } [1]=> object(TestDerived)#%d (5) { ["row:protected"]=> int(1) ["id"]=> string(1) "2" ["val:protected"]=> string(1) "B" ["val2:private"]=> NULL ["val2"]=> string(2) "BB" } [2]=> object(TestDerived)#%d (5) { ["row:protected"]=> int(2) ["id"]=> string(1) "3" ["val:protected"]=> string(1) "C" ["val2:private"]=> NULL ["val2"]=> string(2) "CC" } } ===DONE=== http://cvs.php.net/co.php/php-src/ext/pdo_oci/tests/
[PHP-CVS] cvs: php-src /ext/standard microtime.c
iliaa Tue Mar 1 16:32:25 2005 EDT Modified files: /php-src/ext/standard microtime.c Log: Fixed bug #31792 (getrusage() does not provide ru_nswap value). http://cvs.php.net/diff.php/php-src/ext/standard/microtime.c?r1=1.50&r2=1.51&ty=u Index: php-src/ext/standard/microtime.c diff -u php-src/ext/standard/microtime.c:1.50 php-src/ext/standard/microtime.c:1.51 --- php-src/ext/standard/microtime.c:1.50 Wed Dec 29 20:23:44 2004 +++ php-src/ext/standard/microtime.cTue Mar 1 16:32:25 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: microtime.c,v 1.50 2004/12/30 01:23:44 iliaa Exp $ */ +/* $Id: microtime.c,v 1.51 2005/03/01 21:32:25 iliaa Exp $ */ #include "php.h" @@ -135,6 +135,7 @@ PHP_RUSAGE_PARA(ru_nsignals); PHP_RUSAGE_PARA(ru_nvcsw); PHP_RUSAGE_PARA(ru_nivcsw); + PHP_RUSAGE_PARA(ru_nswap); #endif /*_OSD_POSIX*/ PHP_RUSAGE_PARA(ru_utime.tv_usec); PHP_RUSAGE_PARA(ru_utime.tv_sec); -- 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) / NEWS /ext/standard microtime.c
iliaa Tue Mar 1 16:33:03 2005 EDT Modified files: (Branch: PHP_5_0) /php-srcNEWS /php-src/ext/standard microtime.c Log: MFH: Fixed bug #31792 (getrusage() does not provide ru_nswap value). http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.267&r2=1.1760.2.268&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.267 php-src/NEWS:1.1760.2.268 --- php-src/NEWS:1.1760.2.267 Tue Mar 1 08:13:06 2005 +++ php-src/NEWSTue Mar 1 16:33:02 2005 @@ -36,6 +36,7 @@ - Fixed bug #32011 (Fragments which replaced Nodes are not globaly useable). (Rob) - Fixed bug #31980 (Unicode exif data not available on Windows). (Edin) +- Fixed bug #31792 (getrusage() does not provide ru_nswap value). (Ilia) - Fixed bug #31960 (msql_fetch_row() and msql_fetch_array() dropping columns with NULL values). (Daniel Convissor) - Fixed bug #31878 (Segmentation fault using clone keyword on nodes). (Rob) http://cvs.php.net/diff.php/php-src/ext/standard/microtime.c?r1=1.44&r2=1.44.2.1&ty=u Index: php-src/ext/standard/microtime.c diff -u php-src/ext/standard/microtime.c:1.44 php-src/ext/standard/microtime.c:1.44.2.1 --- php-src/ext/standard/microtime.c:1.44 Thu Jan 8 03:17:33 2004 +++ php-src/ext/standard/microtime.cTue Mar 1 16:33:03 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: microtime.c,v 1.44 2004/01/08 08:17:33 andi Exp $ */ +/* $Id: microtime.c,v 1.44.2.1 2005/03/01 21:33:03 iliaa Exp $ */ #include "php.h" @@ -152,6 +152,7 @@ PHP_RUSAGE_PARA(ru_nsignals); PHP_RUSAGE_PARA(ru_nvcsw); PHP_RUSAGE_PARA(ru_nivcsw); + PHP_RUSAGE_PARA(ru_nswap); #endif /*_OSD_POSIX*/ PHP_RUSAGE_PARA(ru_utime.tv_usec); PHP_RUSAGE_PARA(ru_utime.tv_sec); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) / NEWS /ext/standard microtime.c
iliaa Tue Mar 1 16:34:31 2005 EDT Modified files: (Branch: PHP_4_3) /php-srcNEWS /php-src/ext/standard microtime.c Log: MFH: Fixed bug #31792 (getrusage() does not provide ru_nswap value). http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.847&r2=1.1247.2.848&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1247.2.847 php-src/NEWS:1.1247.2.848 --- php-src/NEWS:1.1247.2.847 Tue Mar 1 08:18:29 2005 +++ php-src/NEWSTue Mar 1 16:34:29 2005 @@ -26,6 +26,7 @@ - Fixed bug #31797 (exif_read_data() uses too low nesting limit). (Ilia) - Fixed bug #31796 (readline completion handler does not handle empty return values). (Ilia) +- Fixed bug #31792 (getrusage() does not provide ru_nswap value). (Ilia) - Fixed bug #31754 (dbase_open() fails for mode = 1). (Mehdi, Derick) - Fixed bug #31705 (parse_url() does not recognize http://foo.com#bar). (Ilia) - Fixed bug #31684 (dio_tcsetattr(): misconfigured termios settings). http://cvs.php.net/diff.php/php-src/ext/standard/microtime.c?r1=1.39.2.1&r2=1.39.2.2&ty=u Index: php-src/ext/standard/microtime.c diff -u php-src/ext/standard/microtime.c:1.39.2.1 php-src/ext/standard/microtime.c:1.39.2.2 --- php-src/ext/standard/microtime.c:1.39.2.1 Tue Dec 31 11:35:32 2002 +++ php-src/ext/standard/microtime.cTue Mar 1 16:34:30 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: microtime.c,v 1.39.2.1 2002/12/31 16:35:32 sebastian Exp $ */ +/* $Id: microtime.c,v 1.39.2.2 2005/03/01 21:34:30 iliaa Exp $ */ #include "php.h" @@ -141,6 +141,7 @@ PHP_RUSAGE_PARA(ru_nsignals); PHP_RUSAGE_PARA(ru_nvcsw); PHP_RUSAGE_PARA(ru_nivcsw); + PHP_RUSAGE_PARA(ru_nswap); #endif /*_OSD_POSIX*/ PHP_RUSAGE_PARA(ru_utime.tv_usec); PHP_RUSAGE_PARA(ru_utime.tv_sec); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_4_3) /ext/standard var_unserializer.c
sniper Tue Mar 1 16:56:41 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/standard var_unserializer.c Log: touch http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.18.4.21&r2=1.18.4.22&ty=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.18.4.21 php-src/ext/standard/var_unserializer.c:1.18.4.22 --- php-src/ext/standard/var_unserializer.c:1.18.4.21 Tue Feb 15 03:12:29 2005 +++ php-src/ext/standard/var_unserializer.c Tue Mar 1 16:56:40 2005 @@ -1,5 +1,5 @@ -/* Generated by re2c 0.9.4 on Tue Feb 15 09:07:53 2005 */ -#line 1 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +/* Generated by re2c 0.9.4 on Tue Mar 1 23:56:03 2005 */ +#line 1 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" /* +--+ | PHP Version 4| @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.18.4.21 2005/02/15 08:12:29 helly Exp $ */ +/* $Id: var_unserializer.c,v 1.18.4.22 2005/03/01 21:56:40 sniper Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -147,7 +147,7 @@ #define YYMARKER marker -#line 154 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +#line 154 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" @@ -432,7 +432,7 @@ if(yych == ':') goto yy87; goto yy4; yy4: -#line 582 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +#line 586 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" { return 0; } #line 102 "" yy5: yyaccept = 0; @@ -473,7 +473,7 @@ yy14: ++YYCURSOR; goto yy15; yy15: -#line 576 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +#line 580 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" { /* this is the case where we have less data than planned */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); @@ -502,7 +502,7 @@ yy22: ++YYCURSOR; goto yy23; yy23: -#line 487 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +#line 491 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" { size_t len, len2, len3, maxlen; int elements; @@ -620,7 +620,7 @@ yy29: ++YYCURSOR; goto yy30; yy30: -#line 479 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +#line 483 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" { INIT_PZVAL(*rval); @@ -652,12 +652,16 @@ yy36: ++YYCURSOR; goto yy37; yy37: -#line 461 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +#line 461 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" { int elements = parse_iv(start + 2); *p = YYCURSOR; + if (elements < 0) { + return 0; + } + INIT_PZVAL(*rval); Z_TYPE_PP(rval) = IS_ARRAY; ALLOC_HASHTABLE(Z_ARRVAL_PP(rval)); @@ -670,7 +674,7 @@ return finish_nested_data(UNSERIALIZE_PASSTHRU); } -#line 341 "" +#line 345 "" yy38: yych = *++YYCURSOR; if(yych == '+') goto yy39; if(yych <= '/') goto yy2; @@ -694,7 +698,7 @@ yy43: ++YYCURSOR; goto yy44; yy44: -#line 433 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +#line 433 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" { size_t len, maxlen; char *str; @@ -722,7 +726,7 @@ ZVAL_STRINGL(*rval, str, len, 1); return 1; } -#line 394 "" +#line 398 "" yy45: yych = *++YYCURSOR; if(yych <= '/'){ if(yych <= ','){ @@ -811,14 +815,14 @@ yy55: ++YYCURSOR; goto yy56; yy56: -#line 426 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +#line 426 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL)); return 1; } -#line 492 "" +#line 496 "" yy57: yych = *++YYCURSOR; if(yych <= ','){ if(yych != '+') goto yy2; @@ -878,7 +882,7 @@ yy66: ++YYCURSOR; goto yy67; yy67: -#line 411 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +#line 411 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); @@ -893,7 +897,7 @@ return 1; } -#line 569 "" +#line 573 "" yy68: yych = *++YYCURSOR; if(yych == 'N') goto yy65; goto yy2; @@ -922,14 +926,14 @@ yy73: ++YYCURSOR; goto yy74; yy74: -#line 404 "/usr/src/PHP_4_3_0/ext/standard/var_unserializer.re" +#line 404 "/usr/src/php/php_4_3/ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_LONG(*rval, parse_iv(start + 2)); return 1; } -#line 606 "" +#line 610 "" yy75: yych = *++YYCURSOR; if(yych <= '/') goto yy2; if(yych >= '2') goto
[PHP-CVS] cvs: php-src(PHP_5_0) /ext/standard var_unserializer.c
sniper Tue Mar 1 18:26:11 2005 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/standard var_unserializer.c Log: update http://cvs.php.net/diff.php/php-src/ext/standard/var_unserializer.c?r1=1.38.2.11&r2=1.38.2.12&ty=u Index: php-src/ext/standard/var_unserializer.c diff -u php-src/ext/standard/var_unserializer.c:1.38.2.11 php-src/ext/standard/var_unserializer.c:1.38.2.12 --- php-src/ext/standard/var_unserializer.c:1.38.2.11 Mon Feb 14 16:03:52 2005 +++ php-src/ext/standard/var_unserializer.c Tue Mar 1 18:26:08 2005 @@ -1,5 +1,5 @@ -/* Generated by re2c 0.9.4 on Mon Feb 14 22:03:31 2005 */ -#line 1 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +/* Generated by re2c 0.9.4 on Wed Mar 2 01:25:31 2005 */ +#line 1 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" /* +--+ | PHP Version 5| @@ -18,7 +18,7 @@ +--+ */ -/* $Id: var_unserializer.c,v 1.38.2.11 2005/02/14 21:03:52 helly Exp $ */ +/* $Id: var_unserializer.c,v 1.38.2.12 2005/03/01 23:26:08 sniper Exp $ */ #include "php.h" #include "ext/standard/php_var.h" @@ -147,7 +147,7 @@ #define YYMARKER marker -#line 154 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +#line 154 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" @@ -420,7 +420,7 @@ if(yych == ':') goto yy87; goto yy4; yy4: -#line 581 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +#line 585 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" { return 0; } #line 102 "" yy5: yyaccept = 0; @@ -461,7 +461,7 @@ yy14: ++YYCURSOR; goto yy15; yy15: -#line 575 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +#line 579 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" { /* this is the case where we have less data than planned */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); @@ -490,7 +490,7 @@ yy22: ++YYCURSOR; goto yy23; yy23: -#line 475 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +#line 479 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" { size_t len, len2, len3, maxlen; int elements; @@ -619,7 +619,7 @@ yy29: ++YYCURSOR; goto yy30; yy30: -#line 467 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +#line 471 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" { INIT_PZVAL(*rval); @@ -651,12 +651,16 @@ yy36: ++YYCURSOR; goto yy37; yy37: -#line 449 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +#line 449 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" { int elements = parse_iv(start + 2); *p = YYCURSOR; + if (elements < 0) { + return 0; + } + INIT_PZVAL(*rval); Z_TYPE_PP(rval) = IS_ARRAY; ALLOC_HASHTABLE(Z_ARRVAL_PP(rval)); @@ -669,7 +673,7 @@ return finish_nested_data(UNSERIALIZE_PASSTHRU); } -#line 352 "" +#line 356 "" yy38: yych = *++YYCURSOR; if(yych == '+') goto yy39; if(yych <= '/') goto yy2; @@ -693,7 +697,7 @@ yy43: ++YYCURSOR; goto yy44; yy44: -#line 421 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +#line 421 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" { size_t len, maxlen; char *str; @@ -721,7 +725,7 @@ ZVAL_STRINGL(*rval, str, len, 1); return 1; } -#line 405 "" +#line 409 "" yy45: yych = *++YYCURSOR; if(yych <= '/'){ if(yych <= ','){ @@ -810,14 +814,14 @@ yy55: ++YYCURSOR; goto yy56; yy56: -#line 414 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +#line 414 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL)); return 1; } -#line 503 "" +#line 507 "" yy57: yych = *++YYCURSOR; if(yych <= ','){ if(yych != '+') goto yy2; @@ -877,7 +881,7 @@ yy66: ++YYCURSOR; goto yy67; yy67: -#line 399 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +#line 399 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); @@ -892,7 +896,7 @@ return 1; } -#line 580 "" +#line 584 "" yy68: yych = *++YYCURSOR; if(yych == 'N') goto yy65; goto yy2; @@ -921,14 +925,14 @@ yy73: ++YYCURSOR; goto yy74; yy74: -#line 392 "/usr/src/PHP_5_0/ext/standard/var_unserializer.re" +#line 392 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_LONG(*rval, parse_iv(start + 2)); return 1; } -#line 617 "" +#line 621 "" yy75: yych = *++YYCURSOR; if(yych <= '/') goto yy2; if(yych >= '2') goto yy2; @@ -939,25 +943,25
[PHP-CVS] cvs: php-src /ext/spl spl.php /ext/spl/internal seekableiterator.inc
helly Tue Mar 1 18:44:05 2005 EDT Modified files: /php-src/ext/splspl.php /php-src/ext/spl/internal seekableiterator.inc Log: - Update docu http://cvs.php.net/diff.php/php-src/ext/spl/spl.php?r1=1.43&r2=1.44&ty=u Index: php-src/ext/spl/spl.php diff -u php-src/ext/spl/spl.php:1.43 php-src/ext/spl/spl.php:1.44 --- php-src/ext/spl/spl.php:1.43Wed Feb 16 19:24:57 2005 +++ php-src/ext/spl/spl.php Tue Mar 1 18:44:05 2005 @@ -548,6 +548,7 @@ function getArrayCopy(); /** @param $position offset to seek to +* @throw OutOfBoundsException if $position is invalid */ function seek($position); http://cvs.php.net/diff.php/php-src/ext/spl/internal/seekableiterator.inc?r1=1.5&r2=1.6&ty=u Index: php-src/ext/spl/internal/seekableiterator.inc diff -u php-src/ext/spl/internal/seekableiterator.inc:1.5 php-src/ext/spl/internal/seekableiterator.inc:1.6 --- php-src/ext/spl/internal/seekableiterator.inc:1.5 Wed Feb 16 19:24:57 2005 +++ php-src/ext/spl/internal/seekableiterator.inc Tue Mar 1 18:44:05 2005 @@ -25,17 +25,24 @@ * \param $index position to seek to * \return void * -* \note The method should throw an exception if it is not possible to -* seek to the given position. -*/ +* The method should throw an exception if it is not possible to seek to +* the given position. Typically this exception should be of type +* OutOfBoundsException. +\code function seek($index); -/* $this->rewind(); + $this->rewind(); $position = 0; while($position < $index && $this->valid()) { $this->next(); $position++; } - }*/ + if (!$this->valid()) { + throw new OutOfBoundsException('Invalid seek position'); + } + } +\endcode +*/ + function seek($index); } ?> \ No newline at end of file -- 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 php_spl.h /ext/spl/tests spl_autoload_001.phpt testclass testclass.class.inc testclass.inc testclass.php.inc
helly Tue Mar 1 20:14:41 2005 EDT Added files: /php-src/ext/spl/tests spl_autoload_001.phpt testclass testclass.class.inc testclass.inc testclass.php.inc Modified files: /php-src/ext/splphp_spl.c php_spl.h Log: - Add new functions http://cvs.php.net/diff.php/php-src/ext/spl/php_spl.c?r1=1.40&r2=1.41&ty=u Index: php-src/ext/spl/php_spl.c diff -u php-src/ext/spl/php_spl.c:1.40 php-src/ext/spl/php_spl.c:1.41 --- php-src/ext/spl/php_spl.c:1.40 Sun Feb 13 13:30:26 2005 +++ php-src/ext/spl/php_spl.c Tue Mar 1 20:14:40 2005 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_spl.c,v 1.40 2005/02/13 18:30:26 helly Exp $ */ +/* $Id: php_spl.c,v 1.41 2005/03/02 01:14:40 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -34,6 +34,8 @@ #include "spl_sxe.h" #include "spl_exceptions.h" #include "spl_observer.h" +#include "zend_exceptions.h" +#include "zend_interfaces.h" #ifdef COMPILE_DL_SPL ZEND_GET_MODULE(spl) @@ -52,6 +54,8 @@ */ static void spl_init_globals(zend_spl_globals *spl_globals) { + spl_globals->autoload_extensions = ".inc,.inc.php"; + spl_globals->autoload_functions = NULL; } /* }}} */ @@ -136,6 +140,201 @@ } /* }}} */ +int spl_autoload(const char *class_name, const char * lc_name, int class_name_len, const char * file_extension TSRMLS_DC) /* {{{ */ +{ + char *class_file; + int class_file_len; + int dummy = 1; + zend_file_handle file_handle; + zend_op_array *new_op_array; + zval *result = NULL; + + ; + + class_file_len = spprintf(&class_file, 0, "%s%s", lc_name, file_extension); + + if (zend_stream_open(class_file, &file_handle TSRMLS_CC) == SUCCESS) { + if (!file_handle.opened_path) { + file_handle.opened_path = estrndup(class_file, class_file_len); + } + if (zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL)==SUCCESS) { + new_op_array = zend_compile_file(&file_handle, ZEND_REQUIRE TSRMLS_CC); + zend_destroy_file_handle(&file_handle TSRMLS_CC); + } else { + new_op_array = NULL; + zend_file_handle_dtor(&file_handle); + } + if (new_op_array) { + EG(return_value_ptr_ptr) = &result; + EG(active_op_array) = new_op_array; + + zend_execute(new_op_array TSRMLS_CC); + + destroy_op_array(new_op_array TSRMLS_CC); + efree(new_op_array); + if (!EG(exception)) { + if (EG(return_value_ptr_ptr)) { + zval_ptr_dtor(EG(return_value_ptr_ptr)); + } + } + + efree(class_file); + return zend_hash_exists(EG(class_table), (char*)lc_name, class_name_len+1); + } + } + efree(class_file); + return 0; +} /* }}} */ + +/* {{{ void spl_autoload(string class_name [, string file_extensions]) + Default implementation for __autoload() */ +PHP_FUNCTION(spl_autoload) +{ + char *class_name, *lc_name, *file_exts; + int class_name_len, file_exts_len, found = 0; + char *copy, *pos1, *pos2; + zval **original_return_value = EG(return_value_ptr_ptr); + zend_op **original_opline_ptr = EG(opline_ptr); + zend_op_array *original_active_op_array = EG(active_op_array); + zend_function_state *original_function_state_ptr = EG(function_state_ptr); + zval err_mode; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s", &class_name, &class_name_len, &file_exts, &file_exts_len) == FAILURE) { + RETURN_FALSE; + } + + ZVAL_LONG(&err_mode, EG(error_reporting)); + php_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); + + copy = pos1 = estrdup(ZEND_NUM_ARGS() > 1 ? file_exts : SPL_G(autoload_extensions)); + lc_name = zend_str_tolower_dup(class_name, class_name_len); + while(pos1 && *pos1 && !EG(exception)) { + EG(return_value_ptr_ptr) = original_return_value; + EG(opline_ptr) = original_opline_ptr; + EG(active_op_array) = original_active_op_array; + EG(function_state_ptr) = original_function_state_ptr; + pos2 = strchr(pos1, ','); + if (pos2) *pos2 = '\0'; + if (spl_autoload(class_name, lc_name, class_name_len, pos1 TSRMLS_CC)) { + f
[PHP-CVS] cvs: php-src /ext/spl .cvsignore
helly Tue Mar 1 20:15:54 2005 EDT Modified files: /php-src/ext/spl.cvsignore Log: - Update .cvsignore http://cvs.php.net/diff.php/php-src/ext/spl/.cvsignore?r1=1.3&r2=1.4&ty=u Index: php-src/ext/spl/.cvsignore diff -u php-src/ext/spl/.cvsignore:1.3 php-src/ext/spl/.cvsignore:1.4 --- php-src/ext/spl/.cvsignore:1.3 Sun Oct 10 12:10:11 2004 +++ php-src/ext/spl/.cvsignore Tue Mar 1 20:15:54 2005 @@ -48,3 +48,6 @@ scan_makefile_in.awk *.gcda *.gcno +xml +html +spl.chm -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php