[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/date php_date.c /ext/date/lib parse_date.c tm2unixtime.c /ext/date/tests bug40743.phpt bug41599.phpt bug42910.phpt bug43003.phpt bug43527.phpt bug43808.p
derick Sat Jan 26 16:26:56 2008 UTC Added files: (Branch: PHP_5_2) /php-src/ext/date/tests bug40743.phpt bug41599.phpt bug42910.phpt bug43003.phpt bug43527.phpt bug43808.phpt Modified files: /php-srcNEWS /php-src/ext/date php_date.c /php-src/ext/date/lib parse_date.c tm2unixtime.c Log: - MFH Bugfixes: - Fixed bug #43808 (date_create never fails (even when it should)). - Fixed bug #43527 (DateTime created from a timestamp reports environment timezone). - Fixed bug #43003 (Invalid timezone reported for DateTime objects constructed using a timestamp). - Fixed bug #42190 (Constructing DateTime with TimeZone Indicator invalidates DateTimeZone). - Fixed bug #41599 (setTime() fails after modify() is used). http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1059r2=1.2027.2.547.2.1060diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1059 php-src/NEWS:1.2027.2.547.2.1060 --- php-src/NEWS:1.2027.2.547.2.1059Wed Jan 23 01:22:57 2008 +++ php-src/NEWSSat Jan 26 16:26:33 2008 @@ -16,6 +16,7 @@ in mysql_connect()). (Hannes) - Fixed bug #43863 (str_word_count() breaks on cyrillic ya in locale cp1251). (phprus at gmail dot com, Tony) +- Fixed bug #43808 (date_create never fails (even when it should)). (Derick) - Fixed bug #43793 (zlib filter is unable to auto-detect gzip/zlib file headers). (Greg) - Fixed bug #43703 (Signature compatibility check broken). (Dmitry) @@ -32,6 +33,8 @@ - Fixed bug #43580 (removed bogus declaration of a non-existent php_is_url() function). (Ilia) - Fixed bug #43533 (escapeshellarg('') returns null). (Ilia) +- Fixed bug #43527 (DateTime created from a timestamp reports environment + timezone). (Derick) - Fixed bug #43522 (stream_get_line() eats additional characters). (Felipe, Ilia, Tony) - Fixed bug #43497 (OCI8 XML/getClobVal aka temporary LOBs leak UGA memory). @@ -57,6 +60,8 @@ (Jani) - Fixed bug #43301 (mb_ereg*_replace() crashes when replacement string is invalid PHP expression and 'e' option is used). (Jani) +- Fixed bug #43003 (Invalid timezone reported for DateTime objects constructed + using a timestamp). (Derick) - Fixed bug #43295 (crash because of uninitialized SG(sapi_headers).mimetype). (Dmitry) - Fixed bug #43293 (Multiple segfaults in getopt()). (Hannes) @@ -87,6 +92,9 @@ - Fixed bug #42272 (var_export() incorrectly escapes char(0)). (Derick) - Fixed bug #42261 (Incorrect lengths for date and boolean data types). (Ilia) +- Fixed bug #42190 (Constructing DateTime with TimeZone Indicator invalidates + DateTimeZone). (Derick) +- Fixed bug #41599 (setTime() fails after modify() is used). (Derick) - Fixed bug #38468 (Unexpected creation of cycle). (Dmitry) 08 Nov 2007, PHP 5.2.5 http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.53r2=1.43.2.45.2.54diff_format=u Index: php-src/ext/date/php_date.c diff -u php-src/ext/date/php_date.c:1.43.2.45.2.53 php-src/ext/date/php_date.c:1.43.2.45.2.54 --- php-src/ext/date/php_date.c:1.43.2.45.2.53 Mon Dec 31 07:20:05 2007 +++ php-src/ext/date/php_date.c Sat Jan 26 16:26:33 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: php_date.c,v 1.43.2.45.2.53 2007/12/31 07:20:05 sebastian Exp $ */ +/* $Id: php_date.c,v 1.43.2.45.2.54 2008/01/26 16:26:33 derick Exp $ */ #include php.h #include php_streams.h @@ -266,7 +266,18 @@ struct _php_timezone_obj { zend_object std; - timelib_tzinfo *tz; + int initialized; + int type; + union { + timelib_tzinfo *tz; // TIMELIB_ZONETYPE_ID; + timelib_sll utc_offset; // TIMELIB_ZONETYPE_OFFSET + struct // TIMELIB_ZONETYPE_ABBR + { + timelib_sll utc_offset; + char*abbr; + int dst; + } z; + } tzi; }; #define DATE_SET_CONTEXT \ @@ -808,7 +819,26 @@ ); break; case 'T': length = slprintf(buffer, 32, %s, localtime ? offset-abbr : GMT); break; - case 'e': length = slprintf(buffer, 32, %s, localtime ? t-tz_info-name : UTC); break; + case 'e': if (!localtime) { + length = slprintf(buffer, 32, %s, UTC); + } else { + switch (t-zone_type) { + case TIMELIB_ZONETYPE_ID: + length = slprintf(buffer,
[PHP-CVS] cvs: php-src /ext/spl spl_dllist.c /ext/spl/tests dllist_007.phpt
colder Sat Jan 26 18:06:51 2008 UTC Added files: /php-src/ext/spl/tests dllist_007.phpt Modified files: /php-src/ext/splspl_dllist.c Log: Iterator implementation for SplDoublyLinkedList, SplStack, SplQueue http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_dllist.c?r1=1.5r2=1.6diff_format=u Index: php-src/ext/spl/spl_dllist.c diff -u php-src/ext/spl/spl_dllist.c:1.5 php-src/ext/spl/spl_dllist.c:1.6 --- php-src/ext/spl/spl_dllist.c:1.5Tue Jan 22 19:51:11 2008 +++ php-src/ext/spl/spl_dllist.cSat Jan 26 18:06:51 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_dllist.c,v 1.5 2008/01/22 19:51:11 colder Exp $ */ +/* $Id: spl_dllist.c,v 1.6 2008/01/26 18:06:51 colder Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -877,6 +877,67 @@ } /* }}} */ +static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags TSRMLS_DC) /* {{{ */ +{ + SPL_LLIST_CHECK_DELREF(*traverse_pointer_ptr); + + if (flags SPL_DLLIST_IT_LIFO) { + *traverse_position_ptr = llist-count-1; + *traverse_pointer_ptr = llist-tail; + } else { + *traverse_position_ptr = 0; + *traverse_pointer_ptr = llist-head; + } + + SPL_LLIST_CHECK_ADDREF(*traverse_pointer_ptr); +} +/* }}} */ + +static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags TSRMLS_DC) /* {{{ */ +{ + if (*traverse_pointer_ptr) { + spl_ptr_llist_element *old = *traverse_pointer_ptr; + + if (flags SPL_DLLIST_IT_LIFO) { + *traverse_pointer_ptr = old-prev; + (*traverse_position_ptr)--; + + if (flags SPL_DLLIST_IT_DELETE) { + zval *prev = (zval *)spl_ptr_llist_pop(llist); + + if (prev) { + zval_ptr_dtor((zval **)prev); + } + } + } else { + *traverse_pointer_ptr = old-next; + (*traverse_position_ptr)++; + + if (flags SPL_DLLIST_IT_DELETE) { + zval *prev = (zval *)spl_ptr_llist_shift(llist); + + if (prev) { + zval_ptr_dtor((zval **)prev); + } + } + } + + SPL_LLIST_DELREF(old); + SPL_LLIST_CHECK_ADDREF(*traverse_pointer_ptr); + } +} +/* }}} */ + +static void spl_dllist_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +{ + spl_dllist_it *iterator = (spl_dllist_it *)iter; + spl_dllist_object *object = iterator-object; + spl_ptr_llist *llist= object-llist; + + spl_dllist_it_helper_rewind(iterator-traverse_pointer, iterator-traverse_position, llist, object-flags TSRMLS_CC); +} +/* }}} */ + static int spl_dllist_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ { spl_dllist_it *iterator = (spl_dllist_it *)iter; @@ -915,56 +976,63 @@ zend_user_it_invalidate_current(iter TSRMLS_CC); - if (iterator-traverse_pointer) { - spl_ptr_llist_element *old = iterator-traverse_pointer; + spl_dllist_it_helper_move_forward(iterator-traverse_pointer, iterator-traverse_position, object-llist, object-flags TSRMLS_CC); +} +/* }}} */ - if (iterator-flags SPL_DLLIST_IT_LIFO) { - iterator-traverse_pointer = old-prev; - iterator-traverse_position--; +/* {{{ proto int SplDoublyLinkedList::key() U + Return current array key */ +SPL_METHOD(SplDoublyLinkedList, key) +{ + spl_dllist_object *intern = (spl_dllist_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - if (iterator-flags SPL_DLLIST_IT_DELETE) { - zval *prev = (zval *)spl_ptr_llist_pop(object-llist); + RETURN_LONG(intern-traverse_position); +} +/* }}} */ - if (prev) { - zval_ptr_dtor((zval **)prev); - } - } - } else { - iterator-traverse_pointer = old-next; - iterator-traverse_position++; +/* {{{ proto void SplDoublyLinkedList::next() U + Move to next entry */ +SPL_METHOD(SplDoublyLinkedList, next) +{ + spl_dllist_object *intern = (spl_dllist_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - if (iterator-flags SPL_DLLIST_IT_DELETE) { -
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
Confirmed, gave me a headache today ... - Markus Antony Dovgal wrote: On 25.01.2008 23:29, Nuno Lopes wrote: -zend_module_entry spl_module_entry = { +const zend_module_entry spl_module_entry = { -zend_module_entry tidy_module_entry = { +const zend_module_entry tidy_module_entry = { This makes PHP to crash right after the start. Please revert. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl spl_dllist.c /ext/spl/tests dllist_007.phpt
colder Sat Jan 26 23:04:43 2008 UTC Added files: (Branch: PHP_5_3) /php-src/ext/spl/tests dllist_007.phpt Modified files: /php-src/ext/splspl_dllist.c Log: MFH: Iterator implementation in SplDoublyLinkedList, SplStack, SplQueue http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_dllist.c?r1=1.1.2.6r2=1.1.2.7diff_format=u Index: php-src/ext/spl/spl_dllist.c diff -u php-src/ext/spl/spl_dllist.c:1.1.2.6 php-src/ext/spl/spl_dllist.c:1.1.2.7 --- php-src/ext/spl/spl_dllist.c:1.1.2.6Tue Jan 22 19:55:31 2008 +++ php-src/ext/spl/spl_dllist.cSat Jan 26 23:04:43 2008 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: spl_dllist.c,v 1.1.2.6 2008/01/22 19:55:31 colder Exp $ */ +/* $Id: spl_dllist.c,v 1.1.2.7 2008/01/26 23:04:43 colder Exp $ */ #ifdef HAVE_CONFIG_H # include config.h @@ -874,6 +874,67 @@ } /* }}} */ +static void spl_dllist_it_helper_rewind(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags TSRMLS_DC) /* {{{ */ +{ + SPL_LLIST_CHECK_DELREF(*traverse_pointer_ptr); + + if (flags SPL_DLLIST_IT_LIFO) { + *traverse_position_ptr = llist-count-1; + *traverse_pointer_ptr = llist-tail; + } else { + *traverse_position_ptr = 0; + *traverse_pointer_ptr = llist-head; + } + + SPL_LLIST_CHECK_ADDREF(*traverse_pointer_ptr); +} +/* }}} */ + +static void spl_dllist_it_helper_move_forward(spl_ptr_llist_element **traverse_pointer_ptr, int *traverse_position_ptr, spl_ptr_llist *llist, int flags TSRMLS_DC) /* {{{ */ +{ + if (*traverse_pointer_ptr) { + spl_ptr_llist_element *old = *traverse_pointer_ptr; + + if (flags SPL_DLLIST_IT_LIFO) { + *traverse_pointer_ptr = old-prev; + (*traverse_position_ptr)--; + + if (flags SPL_DLLIST_IT_DELETE) { + zval *prev = (zval *)spl_ptr_llist_pop(llist); + + if (prev) { + zval_ptr_dtor((zval **)prev); + } + } + } else { + *traverse_pointer_ptr = old-next; + (*traverse_position_ptr)++; + + if (flags SPL_DLLIST_IT_DELETE) { + zval *prev = (zval *)spl_ptr_llist_shift(llist); + + if (prev) { + zval_ptr_dtor((zval **)prev); + } + } + } + + SPL_LLIST_DELREF(old); + SPL_LLIST_CHECK_ADDREF(*traverse_pointer_ptr); + } +} +/* }}} */ + +static void spl_dllist_it_rewind(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ +{ + spl_dllist_it *iterator = (spl_dllist_it *)iter; + spl_dllist_object *object = iterator-object; + spl_ptr_llist *llist= object-llist; + + spl_dllist_it_helper_rewind(iterator-traverse_pointer, iterator-traverse_position, llist, object-flags TSRMLS_CC); +} +/* }}} */ + static int spl_dllist_it_valid(zend_object_iterator *iter TSRMLS_DC) /* {{{ */ { spl_dllist_it *iterator = (spl_dllist_it *)iter; @@ -912,56 +973,63 @@ zend_user_it_invalidate_current(iter TSRMLS_CC); - if (iterator-traverse_pointer) { - spl_ptr_llist_element *old = iterator-traverse_pointer; + spl_dllist_it_helper_move_forward(iterator-traverse_pointer, iterator-traverse_position, object-llist, object-flags TSRMLS_CC); +} +/* }}} */ - if (iterator-flags SPL_DLLIST_IT_LIFO) { - iterator-traverse_pointer = old-prev; - iterator-traverse_position--; +/* {{{ proto int SplDoublyLinkedList::key() U + Return current array key */ +SPL_METHOD(SplDoublyLinkedList, key) +{ + spl_dllist_object *intern = (spl_dllist_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - if (iterator-flags SPL_DLLIST_IT_DELETE) { - zval *prev = (zval *)spl_ptr_llist_pop(object-llist); + RETURN_LONG(intern-traverse_position); +} +/* }}} */ - if (prev) { - zval_ptr_dtor((zval **)prev); - } - } - } else { - iterator-traverse_pointer = old-next; - iterator-traverse_position++; +/* {{{ proto void SplDoublyLinkedList::next() U + Move to next entry */ +SPL_METHOD(SplDoublyLinkedList, next) +{ + spl_dllist_object *intern = (spl_dllist_object*)zend_object_store_get_object(getThis() TSRMLS_CC); - if
Re: [PHP-CVS] cvs: php-src(PHP_5_3) /ext/spl php_spl.c php_spl.h /ext/tidy php_tidy.h tidy.c
On 25.01.2008 23:29, Nuno Lopes wrote: -zend_module_entry spl_module_entry = { +const zend_module_entry spl_module_entry = { -zend_module_entry tidy_module_entry = { +const zend_module_entry tidy_module_entry = { This makes PHP to crash right after the start. Please revert. Ah damn.. Sorry for the breakage and thanks for letting me know about this. (I though I had tested everything...) Tomorrow I'll fix it (today I'm just too tired). Thanks, Nuno -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php