[PHP-CVS] com php-src: Make DateTime and DateTimeImmutable siblings.: ext/date/php_date.c ext/date/tests/DatePeriod_wrong_constructor.phpt ext/date/tests/date_format_error.phpt ext/date/tests/date_for
Commit:68a7fec7af2c8976820ae06063a112db6da82605 Author:Derick Rethans git...@derickrethans.nl Sun, 31 Mar 2013 10:37:16 +0100 Parents: 0e25e00ecf74bcc1a9e14eac25bd7d7cc4857c24 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=68a7fec7af2c8976820ae06063a112db6da82605 Log: Make DateTime and DateTimeImmutable siblings. They both implement the DateTimeInterface interface, which specifies the non-modifying methods of DateTime/DateTimeImmutable. Changed paths: M ext/date/php_date.c M ext/date/tests/DatePeriod_wrong_constructor.phpt M ext/date/tests/date_format_error.phpt M ext/date/tests/date_format_variation1.phpt M ext/date/tests/date_offset_get_error.phpt M ext/date/tests/date_offset_get_variation1.phpt M ext/date/tests/date_timestamp_get.phpt M ext/date/tests/date_timezone_get_error.phpt M ext/date/tests/date_timezone_get_variation1.phpt diff --git a/ext/date/php_date.c b/ext/date/php_date.c index a073aa6..c61a4d3 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -444,6 +444,16 @@ const zend_function_entry date_functions[] = { PHP_FE_END }; +static const zend_function_entry date_funcs_interface[] = { + PHP_ABSTRACT_ME(DateTimeInterface, format, arginfo_date_method_format) + PHP_ABSTRACT_ME(DateTimeInterface, getTimezone, arginfo_date_method_timezone_get) + PHP_ABSTRACT_ME(DateTimeInterface, getOffset, arginfo_date_method_offset_get) + PHP_ABSTRACT_ME(DateTimeInterface, getTimestamp, arginfo_date_method_timestamp_get) + PHP_ABSTRACT_ME(DateTimeInterface, diff, arginfo_date_method_diff) + PHP_ABSTRACT_ME(DateTimeInterface, __wakeup, NULL) + PHP_FE_END +}; + const zend_function_entry date_funcs_date[] = { PHP_ME(DateTime,__construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) PHP_ME(DateTime,__wakeup, NULL, ZEND_ACC_PUBLIC) @@ -468,7 +478,15 @@ const zend_function_entry date_funcs_date[] = { const zend_function_entry date_funcs_immutable[] = { PHP_ME(DateTimeImmutable, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(DateTime, __wakeup, NULL, ZEND_ACC_PUBLIC) PHP_ME(DateTimeImmutable, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME_MAPPING(createFromFormat, date_create_from_format, arginfo_date_create_from_format, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME_MAPPING(getLastErrors,date_get_last_errors, arginfo_date_get_last_errors, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME_MAPPING(format, date_format, arginfo_date_method_format, 0) + PHP_ME_MAPPING(getTimezone, date_timezone_get, arginfo_date_method_timezone_get, 0) + PHP_ME_MAPPING(getOffset, date_offset_get, arginfo_date_method_offset_get, 0) + PHP_ME_MAPPING(getTimestamp,date_timestamp_get, arginfo_date_method_timestamp_get, 0) + PHP_ME_MAPPING(diff,date_diff, arginfo_date_method_diff, 0) PHP_ME(DateTimeImmutable, modify,arginfo_date_method_modify, 0) PHP_ME(DateTimeImmutable, add, arginfo_date_method_add, 0) PHP_ME(DateTimeImmutable, sub, arginfo_date_method_sub, 0) @@ -540,7 +558,7 @@ PHP_INI_END() /* }}} */ zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, *date_ce_period; -zend_class_entry *date_ce_immutable; +zend_class_entry *date_ce_immutable, *date_ce_interface; PHPAPI zend_class_entry *php_date_get_date_ce(void) @@ -1955,7 +1973,10 @@ zend_object_iterator *date_object_period_get_iterator(zend_class_entry *ce, zval static void date_register_classes(TSRMLS_D) { - zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, ce_period; + zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, ce_period, ce_interface; + + INIT_CLASS_ENTRY(ce_interface, DateTimeInterface, date_funcs_interface); + date_ce_interface = zend_register_internal_interface(ce_interface TSRMLS_CC); INIT_CLASS_ENTRY(ce_date, DateTime, date_funcs_date); ce_date.create_object = date_object_new_date; @@ -1965,6 +1986,7 @@ static void date_register_classes(TSRMLS_D) date_object_handlers_date.compare_objects = date_object_compare_date; date_object_handlers_date.get_properties = date_object_get_properties; date_object_handlers_date.get_gc = date_object_get_gc; + zend_class_implements(date_ce_date TSRMLS_CC, 1, date_ce_interface); #define REGISTER_DATE_CLASS_CONST_STRING(const_name, value) \ zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC); @@ -1983,11 +2005,12 @@ static void date_register_classes(TSRMLS_D) INIT_CLASS_ENTRY(ce_immutable, DateTimeImmutable, date_funcs_immutable);
[PHP-CVS] com php-src: Added the new .c files as well as they are not automatically regenerated.: ext/date/lib/parse_date.c ext/date/lib/parse_iso_intervals.c
Commit:84208d9dc550e7feab7c44d5e4ea3061a5952dab Author:Derick Rethans git...@derickrethans.nl Sun, 31 Mar 2013 10:55:45 +0100 Parents: 58a8013e5ff8174aeac4cb38c50c435de9ea5622 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=84208d9dc550e7feab7c44d5e4ea3061a5952dab Log: Added the new .c files as well as they are not automatically regenerated. Changed paths: M ext/date/lib/parse_date.c M ext/date/lib/parse_iso_intervals.c diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 90622f9..e8f393f 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 */ +/* Generated by re2c 0.13.5 on Sun Mar 31 10:47:54 2013 */ #line 1 ext/date/lib/parse_date.re /* +--+ @@ -170,8 +170,6 @@ typedef struct _timelib_relunit { int multiplier; } timelib_relunit; -#define HOUR(a) (int)(a * 60) - /* The timezone table. */ const static timelib_tz_lookup_table timelib_timezone_lookup[] = { #include timezonemap.h @@ -532,39 +530,6 @@ static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length) return dir * timelib_get_nr(ptr, max_length); } -static long timelib_parse_tz_cor(char **ptr) -{ - char *begin = *ptr, *end; - long tmp; - - while (isdigit(**ptr) || **ptr == ':') { - ++*ptr; - } - end = *ptr; - switch (end - begin) { - case 1: - case 2: - return HOUR(strtol(begin, NULL, 10)); - break; - case 3: - case 4: - if (begin[1] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10); - return tmp; - } else if (begin[2] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } else { - tmp = strtol(begin, NULL, 10); - return HOUR(tmp / 100) + tmp % 100; - } - case 5: - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } - return 0; -} - static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior) { char *word; @@ -871,11 +836,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) std: s-tok = cursor; s-len = 0; -#line 997 ext/date/lib/parse_date.re +#line 962 ext/date/lib/parse_date.re -#line 879 ext/date/lib/parse_date.c +#line 844 ext/date/lib/parse_date.c { YYCTYPE yych; unsigned int yyaccept = 0; @@ -995,7 +960,7 @@ std: } yy2: YYDEBUG(2, *YYCURSOR); -#line 1083 ext/date/lib/parse_date.re +#line 1048 ext/date/lib/parse_date.re { DEBUG_OUTPUT(firstdayof | lastdayof); TIMELIB_INIT; @@ -1011,7 +976,7 @@ yy2: TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 1015 ext/date/lib/parse_date.c +#line 980 ext/date/lib/parse_date.c yy3: YYDEBUG(3, *YYCURSOR); ++YYCURSOR; @@ -1034,7 +999,7 @@ yy3: } yy4: YYDEBUG(4, *YYCURSOR); -#line 1677 ext/date/lib/parse_date.re +#line 1642 ext/date/lib/parse_date.re { int tz_not_found; DEBUG_OUTPUT(tzcorrection | tz); @@ -1047,7 +1012,7 @@ yy4: TIMELIB_DEINIT; return TIMELIB_TIMEZONE; } -#line 1051 ext/date/lib/parse_date.c +#line 1016 ext/date/lib/parse_date.c yy5: YYDEBUG(5, *YYCURSOR); yych = *++YYCURSOR; @@ -1358,12 +1323,12 @@ yy12: if (yych = '9') goto yy1385; yy13: YYDEBUG(13, *YYCURSOR); -#line 1772 ext/date/lib/parse_date.re +#line 1737 ext/date/lib/parse_date.re { add_error(s, Unexpected character); goto std; } -#line 1367 ext/date/lib/parse_date.c +#line 1332 ext/date/lib/parse_date.c yy14: YYDEBUG(14, *YYCURSOR); yych = *++YYCURSOR; @@ -2420,11 +2385,11 @@ yy49: if (yych = '9') goto yy55; yy50: YYDEBUG(50, *YYCURSOR); -#line 1761 ext/date/lib/parse_date.re +#line 1726 ext/date/lib/parse_date.re { goto std; } -#line 2428 ext/date/lib/parse_date.c +#line 2393 ext/date/lib/parse_date.c yy51: YYDEBUG(51, *YYCURSOR); yych = *++YYCURSOR; @@ -2433,12 +2398,12 @@ yy52: YYDEBUG(52, *YYCURSOR); ++YYCURSOR; YYDEBUG(53, *YYCURSOR); -#line 1766 ext/date/lib/parse_date.re +#line 1731 ext/date/lib/parse_date.re { s-pos = cursor; s-line++; goto std; }
[PHP-CVS] com php-src: Rebased to PHP-5.4 Implemented Dmitrys change from df97c3aa0d331be668bd5d8f27fff96d4e3ac1d7 Moved the timelib_parse_tz_cor function to ext/date/lib/timelib.c: ext/date/lib/parse
Commit:58a8013e5ff8174aeac4cb38c50c435de9ea5622 Author:Lonny Kapelushnik lon...@gmail.com Mon, 14 Jan 2013 23:03:52 + Committer: Derick Rethans git...@derickrethans.nl Sun, 31 Mar 2013 10:45:01 +0100 Parents: a4ca01cc2bc18204ad09ac4cc0f886539f8911e0 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=58a8013e5ff8174aeac4cb38c50c435de9ea5622 Log: Rebased to PHP-5.4 Implemented Dmitrys change from df97c3aa0d331be668bd5d8f27fff96d4e3ac1d7 Moved the timelib_parse_tz_cor function to ext/date/lib/timelib.c Changed paths: M ext/date/lib/parse_date.re M ext/date/lib/parse_iso_intervals.re M ext/date/lib/timelib.c M ext/date/lib/timelib.h M ext/date/php_date.c Diff: diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 06ab7e3..f3f5906 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -168,8 +168,6 @@ typedef struct _timelib_relunit { int multiplier; } timelib_relunit; -#define HOUR(a) (int)(a * 60) - /* The timezone table. */ const static timelib_tz_lookup_table timelib_timezone_lookup[] = { #include timezonemap.h @@ -2238,39 +2236,6 @@ const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void) return timelib_timezone_lookup; } -long timelib_parse_tz_cor(char **ptr) -{ - char *begin = *ptr, *end; - long tmp; - - while (isdigit(**ptr) || **ptr == ':') { - ++*ptr; - } - end = *ptr; - switch (end - begin) { - case 1: - case 2: - return HOUR(strtol(begin, NULL, 10)); - break; - case 3: - case 4: - if (begin[1] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10); - return tmp; - } else if (begin[2] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } else { - tmp = strtol(begin, NULL, 10); - return HOUR(tmp / 100) + tmp % 100; - } - case 5: - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } - return 0; -} - #ifdef DEBUG_PARSER_STUB int main(void) { diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re index 56aa34d..e50ab37 100644 --- a/ext/date/lib/parse_iso_intervals.re +++ b/ext/date/lib/parse_iso_intervals.re @@ -102,8 +102,6 @@ typedef struct Scanner { int have_end_date; } Scanner; -#define HOUR(a) (int)(a * 60) - static void add_warning(Scanner *s, char *error) { s-errors-warning_count++; @@ -176,39 +174,6 @@ static timelib_ull timelib_get_unsigned_nr(char **ptr, int max_length) return dir * timelib_get_nr(ptr, max_length); } -static long timelib_parse_tz_cor(char **ptr) -{ - char *begin = *ptr, *end; - long tmp; - - while (isdigit(**ptr) || **ptr == ':') { - ++*ptr; - } - end = *ptr; - switch (end - begin) { - case 1: - case 2: - return HOUR(strtol(begin, NULL, 10)); - break; - case 3: - case 4: - if (begin[1] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 2, NULL, 10); - return tmp; - } else if (begin[2] == ':') { - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } else { - tmp = strtol(begin, NULL, 10); - return HOUR(tmp / 100) + tmp % 100; - } - case 5: - tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, NULL, 10); - return tmp; - } - return 0; -} - static void timelib_eat_spaces(char **ptr) { while (**ptr == ' ' || **ptr == '\t') { diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c index 2f457a9..84354e3 100644 --- a/ext/date/lib/timelib.c +++ b/ext/date/lib/timelib.c @@ -30,6 +30,8 @@ #define TIMELIB_LLABS(y) (y 0 ? (y * -1) : y) +#define HOUR(a) (int)(a * 60) + timelib_time* timelib_time_ctor(void) { timelib_time *t; @@ -284,3 +286,35 @@ void timelib_dump_rel_time(timelib_rel_time *d) printf(\n); } +long timelib_parse_tz_cor(char **ptr) +{ +char *begin = *ptr, *end; +long tmp; + +while (isdigit(**ptr) || **ptr == ':') { +++*ptr; +} +
[PHP-CVS] com php-src: Bug 54567 DateTimeZone serialize/unserialize Make DateTimeZone serializable and implement __set_state: ext/date/php_date.c ext/date/php_date.h ext/date/tests/014.phpt ext/date/t
Commit:30d0ae42b56c62bc441d763dfa8388c43625b83d Author:Lonny Kapelushnik lon...@gmail.com Fri, 28 Sep 2012 12:15:20 + Committer: Derick Rethans git...@derickrethans.nl Sun, 31 Mar 2013 10:45:00 +0100 Parents: 5dd73b9e540206a4b084b915caec1579dfcb19f2 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=30d0ae42b56c62bc441d763dfa8388c43625b83d Log: Bug 54567 DateTimeZone serialize/unserialize Make DateTimeZone serializable and implement __set_state Bugs: https://bugs.php.net/54567 Changed paths: M ext/date/php_date.c M ext/date/php_date.h M ext/date/tests/014.phpt M ext/date/tests/DateTimeZone_clone_basic1.phpt M ext/date/tests/DateTimeZone_clone_basic2.phpt M ext/date/tests/DateTimeZone_clone_basic3.phpt M ext/date/tests/DateTimeZone_construct_basic.phpt M ext/date/tests/DateTimeZone_serialize.phpt M ext/date/tests/DateTimeZone_verify.phpt M ext/date/tests/timezone_open_basic1.phpt diff --git a/ext/date/php_date.c b/ext/date/php_date.c index c61a4d3..16eb6db 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -500,6 +500,8 @@ const zend_function_entry date_funcs_immutable[] = { const zend_function_entry date_funcs_timezone[] = { PHP_ME(DateTimeZone, __construct, arginfo_timezone_open, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(DateTimeZone, __wakeup,NULL, ZEND_ACC_PUBLIC) + PHP_ME(DateTimeZone, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) PHP_ME_MAPPING(getName, timezone_name_get, arginfo_timezone_method_name_get, 0) PHP_ME_MAPPING(getOffset, timezone_offset_get, arginfo_timezone_method_offset_get, 0) PHP_ME_MAPPING(getTransitions,timezone_transitions_get, arginfo_timezone_method_transitions_get, 0) @@ -630,6 +632,7 @@ static HashTable *date_object_get_gc_interval(zval *object, zval ***table, int * static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC); static HashTable *date_object_get_gc_period(zval *object, zval ***table, int *n TSRMLS_DC); static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC); +static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC); zval *date_interval_read_property(zval *object, zval *member, int type, const zend_literal *key TSRMLS_DC); void date_interval_write_property(zval *object, zval *member, zval *value, const zend_literal *key TSRMLS_DC); @@ -2017,6 +2020,7 @@ static void date_register_classes(TSRMLS_D) date_ce_timezone = zend_register_internal_class_ex(ce_timezone, NULL, NULL TSRMLS_CC); memcpy(date_object_handlers_timezone, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); date_object_handlers_timezone.clone_obj = date_object_clone_timezone; + date_object_handlers_timezone.get_properties = date_object_get_properties_timezone; #define REGISTER_TIMEZONE_CLASS_CONST_STRING(const_name, value) \ zend_declare_class_constant_long(date_ce_timezone, const_name, sizeof(const_name)-1, value TSRMLS_CC); @@ -2269,6 +2273,50 @@ static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC) return new_ov; } +static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC) +{ + HashTable *props; + zval *zv; + php_timezone_obj *tzobj; + + + tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC); + + props = zend_std_get_properties(object TSRMLS_CC); + + if (!tzobj-initialized || GC_G(gc_active)) { + return props; + } + + MAKE_STD_ZVAL(zv); + ZVAL_LONG(zv, tzobj-type); + zend_hash_update(props, timezone_type, 14, zv, sizeof(zval), NULL); + + MAKE_STD_ZVAL(zv); + switch (tzobj-type) { + case TIMELIB_ZONETYPE_ID: + ZVAL_STRING(zv, tzobj-tzi.tz-name, 1); + break; + case TIMELIB_ZONETYPE_OFFSET: { + char *tmpstr = emalloc(sizeof(UTC+05:00)); + + snprintf(tmpstr, sizeof(+05:00), %c%02d:%02d, + tzobj-tzi.z.utc_offset 0 ? '-' : '+', + abs(tzobj-tzi.z.utc_offset / 60), + abs((tzobj-tzi.z.utc_offset % 60))); + + ZVAL_STRING(zv, tmpstr, 0); + } + break; + case TIMELIB_ZONETYPE_ABBR: + ZVAL_STRING(zv, tzobj-tzi.tz-timezone_abbr, 1); + break; + } + zend_hash_update(props, timezone, 9, zv, sizeof(zval), NULL); + + return props; +} + static inline zend_object_value date_object_new_interval_ex(zend_class_entry *class_type, php_interval_obj **ptr TSRMLS_DC) { php_interval_obj *intern; @@ -3643,6
[PHP-CVS] com php-src: Fixed the test to use %d instead of an actual number: ext/date/tests/DateTimeZone_verify.phpt
Commit:a1ebd82a29c427455c7ec2938b892727cfada552 Author:Lonny Kapelushnik lon...@gmail.com Sat, 29 Sep 2012 22:10:58 -0400 Committer: Derick Rethans git...@derickrethans.nl Sun, 31 Mar 2013 10:45:00 +0100 Parents: 30d0ae42b56c62bc441d763dfa8388c43625b83d Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a1ebd82a29c427455c7ec2938b892727cfada552 Log: Fixed the test to use %d instead of an actual number Changed paths: M ext/date/tests/DateTimeZone_verify.phpt Diff: diff --git a/ext/date/tests/DateTimeZone_verify.phpt b/ext/date/tests/DateTimeZone_verify.phpt index 1304000..241d91e 100644 --- a/ext/date/tests/DateTimeZone_verify.phpt +++ b/ext/date/tests/DateTimeZone_verify.phpt @@ -35,14 +35,14 @@ array(9) { string(12) DateTimeZone } [1]= - object(ReflectionMethod)#3 (2) { + object(ReflectionMethod)#%d (2) { [name]= string(8) __wakeup [class]= string(12) DateTimeZone } [2]= - object(ReflectionMethod)#4 (2) { + object(ReflectionMethod)#%d (2) { [name]= string(11) __set_state [class]= @@ -122,4 +122,4 @@ array(14) { [PER_COUNTRY]= int(4096) } -===DONE=== \ No newline at end of file +===DONE=== -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Updated test case and added BFN to NEWS.: NEWS ext/date/tests/bug60774.phpt
Commit:503760c9130683a21ffe631fddfb20cc18ee2867 Author:Derick Rethans git...@derickrethans.nl Sun, 31 Mar 2013 11:07:24 +0100 Parents: b07ecb5501bcc07c830b552aee39098439fe2027 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=503760c9130683a21ffe631fddfb20cc18ee2867 Log: Updated test case and added BFN to NEWS. Changed paths: M NEWS M ext/date/tests/bug60774.phpt Diff: diff --git a/NEWS b/NEWS index c8b7116..f0a6b95 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,12 @@ PHP NEWS ||| ?? ??? 20??, PHP 5.5.0 Beta 3 +- DateTime + . Fixed bug #54567 (DateTimeZone serialize/unserialize) (Lonny +Kapelushnik, Derick) + . Fixed bug #60774 (DateInterval::format(%a) is always zero when an +interval is created using the createFromDateString method) (Lonny +Kapelushnik, Derick) 28 Mar 2013, PHP 5.5.0 Beta 2 diff --git a/ext/date/tests/bug60774.phpt b/ext/date/tests/bug60774.phpt index af8f447..865928d 100644 --- a/ext/date/tests/bug60774.phpt +++ b/ext/date/tests/bug60774.phpt @@ -7,8 +7,8 @@ var_dump($i); echo $i-format(%d), \n; echo $i-format(%a), \n; ? ---EXPECT-- -object(DateInterval)#1 (8) { +--EXPECTF-- +object(DateInterval)#1 (%d) { [y]= int(0) [m]= @@ -21,10 +21,24 @@ object(DateInterval)#1 (8) { int(0) [s]= int(0) + [weekday]= + int(0) + [weekday_behavior]= + int(0) + [first_last_day_of]= + int(0) [invert]= int(0) [days]= bool(false) + [special_type]= + int(0) + [special_amount]= + string(1) 0 + [have_weekday_relative]= + int(0) + [have_special_relative]= + int(0) } 2 (unknown) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Bug #60774 (DateInterval::format(%a) is always zero when an interval is created using the createFromDateString method): ext/date/lib/parse_date.c ext/date/lib/parse_date.re ex
Commit:b07ecb5501bcc07c830b552aee39098439fe2027 Author:EC2 Default User ec2-user@ip-10-66-82-148.ec2.internal Sun, 5 Aug 2012 17:14:51 + Committer: Derick Rethans git...@derickrethans.nl Sun, 31 Mar 2013 10:59:21 +0100 Parents: 84208d9dc550e7feab7c44d5e4ea3061a5952dab Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b07ecb5501bcc07c830b552aee39098439fe2027 Log: Bug #60774 (DateInterval::format(%a) is always zero when an interval is created using the createFromDateString method) Bugs: https://bugs.php.net/60774 Changed paths: M ext/date/lib/parse_date.c M ext/date/lib/parse_date.re A ext/date/tests/bug60774.phpt Diff: diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index e8f393f..9f5593d 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -24789,6 +24789,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container in.tzdb = tzdb; in.time-is_localtime = 0; in.time-zone_type = 0; + in.time-relative.days = TIMELIB_UNSET; do { t = scan(in, tz_get_wrapper); diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index f3f5906..8aaa6c3 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -1796,6 +1796,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container in.tzdb = tzdb; in.time-is_localtime = 0; in.time-zone_type = 0; + in.time-relative.days = TIMELIB_UNSET; do { t = scan(in, tz_get_wrapper); diff --git a/ext/date/tests/bug60774.phpt b/ext/date/tests/bug60774.phpt new file mode 100644 index 000..af8f447 --- /dev/null +++ b/ext/date/tests/bug60774.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #60774 (DateInterval::format(%a) is always zero when an interval is created using the createFromDateString method) +--FILE-- +?php +$i= DateInterval::createFromDateString('2 days'); +var_dump($i); +echo $i-format(%d), \n; +echo $i-format(%a), \n; +? +--EXPECT-- +object(DateInterval)#1 (8) { + [y]= + int(0) + [m]= + int(0) + [d]= + int(2) + [h]= + int(0) + [i]= + int(0) + [s]= + int(0) + [invert]= + int(0) + [days]= + bool(false) +} +2 +(unknown) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix typo (it's in DateTime::__wakeup): ext/date/php_date.c
Commit:2f6b9b970c9529c4fa32cd306b69704f55681354 Author:Xinchen Hui larue...@php.net Sun, 31 Mar 2013 20:07:14 +0800 Parents: 503760c9130683a21ffe631fddfb20cc18ee2867 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2f6b9b970c9529c4fa32cd306b69704f55681354 Log: Fix typo (it's in DateTime::__wakeup) Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 0367726..4ef3143 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2842,7 +2842,7 @@ PHP_METHOD(DateTime, __wakeup) myht = Z_OBJPROP_P(object); if (!php_date_initialize_from_hash(return_value, dateobj, myht TSRMLS_CC)) { - php_error(E_ERROR, Invalid serialization data for DateTimeInterface object); + php_error(E_ERROR, Invalid serialization data for DateTime object); } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Skip test when --with-curlwrappers enabled.: ext/standard/tests/streams/bug64433.phpt
Commit:72426a446d7630c37f8337f71c81f508647b4f1b Author:Xinchen Hui larue...@php.net Sun, 31 Mar 2013 21:22:48 +0800 Parents: 1d4fcdff9f8a5b183cd99295f330bb92dbcf1105 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=72426a446d7630c37f8337f71c81f508647b4f1b Log: Skip test when --with-curlwrappers enabled. Changed paths: M ext/standard/tests/streams/bug64433.phpt Diff: diff --git a/ext/standard/tests/streams/bug64433.phpt b/ext/standard/tests/streams/bug64433.phpt index 9f6e410..a1bf219 100644 --- a/ext/standard/tests/streams/bug64433.phpt +++ b/ext/standard/tests/streams/bug64433.phpt @@ -2,10 +2,18 @@ Bug #60180 ($_SERVER[PHP_SELF] incorrect) --SKIPIF-- ?php -if(!file_exists(dirname(__FILE__)./../../../../sapi/cli/tests/php_cli_server.inc)) die(skip); +if(!file_exists(dirname(__FILE__)./../../../../sapi/cli/tests/php_cli_server.inc)) + die(skip could not found cli server script); $res = @include dirname(__FILE__)./../../../../sapi/cli/tests/php_cli_server.inc; if(!$res) { - die(skip); + die(skip could not open cli server script); +} + +ob_start(); +phpinfo(); +$curlwrappers = preg_match(/with-curlwrappers/, ob_get_clean()); +if ($curlwrappers) { + die(skip curl wrappers used); } ? --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix coverage data for the opcache optimizer: Makefile.gcov
Commit:ed54776960414167f4b388597b20461539939a0d Author:Nuno Lopes nlop...@php.net Sun, 31 Mar 2013 15:43:08 -0400 Parents: 971676e859c8d36859cd1b4d7b87d5e32ff9c72a Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ed54776960414167f4b388597b20461539939a0d Log: fix coverage data for the opcache optimizer Changed paths: M Makefile.gcov Diff: diff --git a/Makefile.gcov b/Makefile.gcov index 79d7a6d..37c1b4b 100644 --- a/Makefile.gcov +++ b/Makefile.gcov @@ -14,7 +14,7 @@ php_lcov.info: lcov-test @rm -rf lcov_data/ @$(mkinstalldirs) lcov_data/ @echo - -@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\ + -@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.c -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\ for x in $$files; do \ echo -n . ;\ y=`echo $$x | sed -e 's!\.libs/!!'`; \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: fix coverage data for the opcache optimizer: Makefile.gcov
Commit:586dc07a8a3ea0a1769dc83189a3d2d9a6b77b4a Author:Nuno Lopes nlop...@php.net Sun, 31 Mar 2013 15:43:08 -0400 Parents: ad7c0b19286a4dfa53d03a525ffee77c9ca92e04 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=586dc07a8a3ea0a1769dc83189a3d2d9a6b77b4a Log: fix coverage data for the opcache optimizer Changed paths: M Makefile.gcov Diff: diff --git a/Makefile.gcov b/Makefile.gcov index 79d7a6d..37c1b4b 100644 --- a/Makefile.gcov +++ b/Makefile.gcov @@ -14,7 +14,7 @@ php_lcov.info: lcov-test @rm -rf lcov_data/ @$(mkinstalldirs) lcov_data/ @echo - -@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\ + -@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.c -o -name \*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\ for x in $$files; do \ echo -n . ;\ y=`echo $$x | sed -e 's!\.libs/!!'`; \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php