Re: [PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS Zend/zend_execute_API.c
On Fri, 29 Nov 2013, Dmitry Stogov wrote: > Commit:967abd61537a2c7d0beebac9039aa068d518e4eb > Author:Dmitry Stogov Fri, 29 Nov 2013 12:54:22 > +0400 > Parents: b0d24d3d2001ad3bfe6b9a2e66cb631ae49b4064 > 2d31eadbbf147a157cb4a0c89adaf30fee7371f0 > Branches: PHP-5.5 PHP-5.6 master > > Link: > http://git.php.net/?p=php-src.git;a=commitdiff;h=967abd61537a2c7d0beebac9039aa068d518e4eb > > Log: > Merge branch 'PHP-5.4' into PHP-5.5 > > * PHP-5.4: > Added validation of class names in the autoload process > > Changed paths: > MM NEWS THis seems to have changed/messed up the NEWS file? cheers, Derick > MM Zend/zend_execute_API.c > > > Diff: > diff --cc NEWS > index b3c8adf,f55ff05..d16e8bd > --- a/NEWS > +++ b/NEWS > @@@ -1,16 -1,17 +1,19 @@@ > PHP > NEWS > > ||| > -?? ??? 2013, PHP 5.4.24 > +?? ??? 2013, PHP 5.5.8 > > + - Core: > + . Added validation of class names in the autoload process. (Dmitry) > + > - Date: > . Fixed bug #66060 (Heap buffer over-read in DateInterval). (Remi) > - . Fixed bug #63391 (Incorrect/inconsistent day of week prior to the year > -1600). (Derick, T. Carter) > - . Fixed bug #61599 (Wrong Day of Week). (Derick, T. Carter) > > -?? ??? 2013, PHP 5.4.23 > +?? ??? 2013, PHP 5.5.7 > + > +- CLI server: > + . Added some MIME types to the CLI web server (Chris Jones) > + . Implemented FR #65917 (getallheaders() is not supported by the built-in > web > +server) - also implements apache_response_headers() (Andrea Faulds) > > - Core: > . Fixed bug #66094 (unregister_tick_function tries to cast a Closure to a > > > -- > PHP CVS Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug Posted with an email client that doesn't mangle email: alpine -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Move add/sub to timelib.: ext/date/lib/interval.c ext/date/lib/timelib.h ext/date/php_date.c
Commit:5d0c526199add0e4f054a57db29d882c8ad89a23 Author:Derick Rethans Tue, 16 Apr 2013 16:31:10 +0100 Parents: 324e6a5f82d830cf46e0cf35f82c44253b8bd2cf Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5d0c526199add0e4f054a57db29d882c8ad89a23 Log: Move add/sub to timelib. Changed paths: M ext/date/lib/interval.c M ext/date/lib/timelib.h M ext/date/php_date.c Diff: diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c index e765a42..7fa1fc5 100644 --- a/ext/date/lib/interval.c +++ b/ext/date/lib/interval.c @@ -87,3 +87,59 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) return rt; } + +timelib_time *timelib_add(timelib_time *old_time, timelib_rel_time *interval) +{ + int bias = 1; + timelib_time *t = timelib_time_clone(old_time); + + if (interval->have_weekday_relative || interval->have_special_relative) { + memcpy(&t->relative, interval, sizeof(struct timelib_rel_time)); + } else { + if (interval->invert) { + bias = -1; + } + memset(&t->relative, 0, sizeof(struct timelib_rel_time)); + t->relative.y = interval->y * bias; + t->relative.m = interval->m * bias; + t->relative.d = interval->d * bias; + t->relative.h = interval->h * bias; + t->relative.i = interval->i * bias; + t->relative.s = interval->s * bias; + } + t->have_relative = 1; + t->sse_uptodate = 0; + + timelib_update_ts(t, NULL); + timelib_update_from_sse(t); + t->have_relative = 0; + + return t; +} + +timelib_time *timelib_sub(timelib_time *old_time, timelib_rel_time *interval) +{ + int bias = 1; + timelib_time *t = timelib_time_clone(old_time); + + if (interval->invert) { + bias = -1; + } + + memset(&t->relative, 0, sizeof(struct timelib_rel_time)); + t->relative.y = 0 - (interval->y * bias); + t->relative.m = 0 - (interval->m * bias); + t->relative.d = 0 - (interval->d * bias); + t->relative.h = 0 - (interval->h * bias); + t->relative.i = 0 - (interval->i * bias); + t->relative.s = 0 - (interval->s * bias); + t->have_relative = 1; + t->sse_uptodate = 0; + + timelib_update_ts(t, NULL); + timelib_update_from_sse(t); + + t->have_relative = 0; + + return t; +} diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index 478dec3..2acb765 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -136,5 +136,7 @@ int timelib_astro_rise_set_altitude(timelib_time *time, double lon, double lat, /* from interval.c */ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two); +timelib_time *timelib_add(timelib_time *t, timelib_rel_time *interval); +timelib_time *timelib_sub(timelib_time *t, timelib_rel_time *interval); #endif diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 05ac672..2bb555a 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2889,7 +2889,7 @@ PHP_FUNCTION(date_add) zval *object, *interval; php_date_obj *dateobj; php_interval_obj *intobj; - int bias = 1; + timelib_time *new_time; if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_date, &interval, date_ce_interval) == FAILURE) { RETURN_FALSE; @@ -2899,27 +2899,9 @@ PHP_FUNCTION(date_add) intobj = (php_interval_obj *) zend_object_store_get_object(interval TSRMLS_CC); DATE_CHECK_INITIALIZED(intobj->initialized, DateInterval); - - if (intobj->diff->have_weekday_relative || intobj->diff->have_special_relative) { - memcpy(&dateobj->time->relative, intobj->diff, sizeof(struct timelib_rel_time)); - } else { - if (intobj->diff->invert) { - bias = -1; - } - memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time)); - dateobj->time->relative.y = intobj->diff->y * bias; - dateobj->time->relative.m = intobj->diff->m * bias; - dateobj->time->relative.d = intobj->diff->d * bias; - dateobj->time->relative.h = intobj->diff->h * bias; - dateobj->time->relative.i = intobj->diff->i * bias; - dateobj->time->relative.s = intobj->diff->s * bias; - } - dateobj->time->have_relative = 1; - dateobj->time->sse_uptodate = 0; - - timelib_update_ts(dateobj->time, NULL); - timel
[PHP-CVS] com php-src: Fixed a few DST changeover issues.: ext/date/lib/interval.c ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt ext/date/tests/rfc-datetime_and_daylight_saving_ti
Commit:582f6e529e843b412d582023bf0270e47b1aa468 Author:Derick Rethans Thu, 20 Jun 2013 09:28:23 +0100 Parents: 5d0c526199add0e4f054a57db29d882c8ad89a23 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=582f6e529e843b412d582023bf0270e47b1aa468 Log: Fixed a few DST changeover issues. Changed paths: M ext/date/lib/interval.c M ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt M ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt M ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt M ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt Diff: diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c index 7fa1fc5..dce62f3 100644 --- a/ext/date/lib/interval.c +++ b/ext/date/lib/interval.c @@ -111,6 +111,14 @@ timelib_time *timelib_add(timelib_time *old_time, timelib_rel_time *interval) t->sse_uptodate = 0; timelib_update_ts(t, NULL); + +// printf("%lld %lld %d\n", old_time->dst, t->dst, (t->sse - old_time->sse)); + /* Adjust for backwards DST changeover */ + if (old_time->dst == 1 && t->dst == 0 && !interval->y && !interval->m && !interval->d) { + t->sse -= old_time->z; + t->sse += t->z; + } + timelib_update_from_sse(t); t->have_relative = 0; @@ -137,6 +145,18 @@ timelib_time *timelib_sub(timelib_time *old_time, timelib_rel_time *interval) t->sse_uptodate = 0; timelib_update_ts(t, NULL); + + /* Adjust for backwards DST changeover */ + if (old_time->dst == 1 && t->dst == 0 && !interval->y && !interval->m && !interval->d) { + t->sse -= old_time->z; + t->sse += t->z; + } + /* Adjust for forwards DST changeover */ + if (old_time->dst == 0 && t->dst == 1 && !interval->y && !interval->m && !interval->d ) { + t->sse -= old_time->z; + t->sse += t->z; + } + timelib_update_from_sse(t); t->have_relative = 0; diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt index 45db229..fdbe96d 100644 --- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt @@ -90,7 +90,7 @@ ba4 2010-11-06 04:30:00 EDT America/New_York + PT23H = 2010-11-07 02:30:00 EST A ba5 2010-11-06 04:30:00 EDT America/New_York + PT22H = 2010-11-07 01:30:00 EST America/New_York ba6 2010-11-06 04:30:00 EDT America/New_York + PT21H = 2010-11-07 01:30:00 EDT America/New_York ba7 2010-11-06 01:30:00 EDT America/New_York + P1D = 2010-11-07 01:30:00 EDT America/New_York -ba8 2010-11-06 01:30:00 EDT America/New_York + P1DT1H = 2010-11-07 01:30:00 EST America/New_York +ba8 2010-11-06 01:30:00 EDT America/New_York + P1DT1H = 2010-11-07 02:30:00 EST America/New_York ba9 2010-11-06 04:30:00 EDT America/New_York + PT25H = 2010-11-07 04:30:00 EST America/New_York ba10 2010-11-06 03:30:00 EDT America/New_York + P1D = 2010-11-07 03:30:00 EST America/New_York ba11 2010-11-06 02:30:00 EDT America/New_York + P1D = 2010-11-07 02:30:00 EST America/New_York diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt index c2fe4bf..62dab5d 100644 --- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt @@ -25,7 +25,7 @@ $end = new DateTime('2010-11-07 05:30:00'); $end->setTimeZone($tz); $start = new DateTime('2010-11-06 04:30:59'); echo 'bd0 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n"; + . ' = ' . $start->diff($end)->format('P%dDT%hH%iM%sS') . "\n"; $end = new DateTime('2010-11-07 01:30:00 EST'); $end->setTimeZone($tz); diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt index 0dd384a..138c68f 100644 --- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt @@ -6,6 +6,7 @@ Daniel Convissor http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Marking those two as XFAIL for now.: ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
Commit:aab0b2ce3b8641848e7e92b9e5c4db044004133d Author:Derick Rethans Thu, 28 Nov 2013 14:24:39 + Parents: 582f6e529e843b412d582023bf0270e47b1aa468 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=aab0b2ce3b8641848e7e92b9e5c4db044004133d Log: Marking those two as XFAIL for now. Changed paths: M ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt M ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt Diff: diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt index 62dab5d..fe2e79b 100644 --- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt @@ -2,6 +2,8 @@ RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2) --CREDITS-- Daniel Convissor +--XFAIL-- +Still not quite right --FILE-- +--XFAIL-- +Still not quite right --FILE-- http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed "Forward Transition" construction of DateTime objects.: ext/date/php_date.c ext/date/tests/forward-transition-construction.phpt
Commit:44a9e6b4843de686eab2e2bfa66bdf17ed685d7e Author:Derick Rethans Sun, 31 Mar 2013 18:11:35 +0100 Parents: fb0c2cf2245838cba1bd9318925d67a127c7b085 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=44a9e6b4843de686eab2e2bfa66bdf17ed685d7e Log: Fixed "Forward Transition" construction of DateTime objects. This fixes the issue in https://wiki.php.net/rfc/datetime_and_daylight_saving_time#forward_transitions There is a period during transition to DST where a time (such as 02:30) does not exist. PHP already calculated the correct timestamp for this, but failed to "rounded forward" to the existing correct hour value. Changed paths: M ext/date/php_date.c A ext/date/tests/forward-transition-construction.phpt Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index b7da07c..05ac672 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2487,6 +2487,7 @@ PHPAPI int php_date_initialize(php_date_obj *dateobj, /*const*/ char *time_str, timelib_fill_holes(dateobj->time, now, TIMELIB_NO_CLONE); timelib_update_ts(dateobj->time, tzi); + timelib_update_from_sse(dateobj->time); dateobj->time->have_relative = 0; diff --git a/ext/date/tests/forward-transition-construction.phpt b/ext/date/tests/forward-transition-construction.phpt new file mode 100644 index 000..8f195a5 --- /dev/null +++ b/ext/date/tests/forward-transition-construction.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test for Date/Time construction during a forward DST transition +--FILE-- +format('Y-m-d H:i:s T/e - U') . "\n"; + +$date = new DateTime('2010-03-14 02:00:00'); +echo $date->format('Y-m-d H:i:s T/e - U') . "\n"; + +$date = new DateTime('2010-03-14 02:30:00'); +echo $date->format('Y-m-d H:i:s T/e - U') . "\n"; + +$date = new DateTime('2010-03-14 03:00:00'); +echo $date->format('Y-m-d H:i:s T/e - U') . "\n"; + +$date = new DateTime('2010-03-14 03:30:00'); +echo $date->format('Y-m-d H:i:s T/e - U') . "\n"; +?> +--EXPECT-- +2010-03-14 01:30:00 EST/America/New_York - 1268548200 +2010-03-14 03:00:00 EDT/America/New_York - 126855 +2010-03-14 03:30:00 EDT/America/New_York - 1268551800 +2010-03-14 03:00:00 EDT/America/New_York - 126855 +2010-03-14 03:30:00 EDT/America/New_York - 1268551800 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/date/lib/timelib.h ext/date/php_date.c
Commit:88067b6e60a1813aa6bb97e41c2e33c19019fbf5 Author:Derick Rethans Thu, 28 Nov 2013 14:30:08 + Parents: 4587ef569af91110728ed70c474af46cc88275e1 c1eb219aad2e23db5db27d887b93b06c1537fec9 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=88067b6e60a1813aa6bb97e41c2e33c19019fbf5 Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: ext/date/php_date.c Changed paths: MM ext/date/lib/timelib.h MM ext/date/php_date.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Split up tests into their different categories.: ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd
Commit:aa26ace21f1457bfcc5faf417d9d453b82944aba Author:Derick Rethans Sat, 13 Apr 2013 23:28:59 +0100 Parents: 7a0df7be34d35e91406b9654cb7be1de9b8720c1 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=aa26ace21f1457bfcc5faf417d9d453b82944aba Log: Split up tests into their different categories. Changed paths: A ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt A ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd1.phpt A ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt A ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bs.phpt A ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fa.phpt A ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fd.phpt A ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt D ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt new file mode 100644 index 000..45db229 --- /dev/null +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-ba.phpt @@ -0,0 +1,96 @@ +--TEST-- +RFC: DateTime and Daylight Saving Time Transitions (zone type 3, ba) +--CREDITS-- +Daniel Convissor +--FILE-- +format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'ba2 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'PT24H'; +$interval = new DateInterval($interval_spec); +echo 'ba3 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'PT23H'; +$interval = new DateInterval($interval_spec); +echo 'ba4 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'PT22H'; +$interval = new DateInterval($interval_spec); +echo 'ba5 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'PT21H'; +$interval = new DateInterval($interval_spec); +echo 'ba6 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 01:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'ba7 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 01:30:00'); +$interval_spec = 'P1DT1H'; +$interval = new DateInterval($interval_spec); +echo 'ba8 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 04:30:00'); +$interval_spec = 'PT25H'; +$interval = new DateInterval($interval_spec); +echo 'ba9 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 03:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'ba10 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +$start = new DateTime('2010-11-06 02:30:00'); +$interval_spec = 'P1D'; +$interval = new DateInterval($interval_spec); +echo 'ba11 ' . $start->format($date_format) . " + $interval_spec = " + . $start->add($interval)->format($date_format) . "\n"; + +echo "\n"; + +?> +--EXPECT-- +ba1 2010-11-07 01:59:59 EDT America/New_York + PT1S = 2010-11-07 01:00:00 EST America/New_York +ba2 2010-11-06 04:30:00 EDT America/New_York + P1D = 2010-11-07 04:30:00 EST America/New_York +ba3 2010-11-06 04:30:00 EDT America/New_York + PT24H = 2010-11-07 03:30:00 EST America/New_York +ba4 2010-11-06 04:30:00 EDT
[PHP-CVS] com php-src: Always reset those parameters.: ext/date/lib/unixtime2tm.c
Commit:261c6b31ca748fd97a105314ec78a166b2639db9 Author:Derick Rethans Fri, 12 Apr 2013 11:23:49 +0100 Parents: 44a9e6b4843de686eab2e2bfa66bdf17ed685d7e Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=261c6b31ca748fd97a105314ec78a166b2639db9 Log: Always reset those parameters. Changed paths: M ext/date/lib/unixtime2tm.c Diff: diff --git a/ext/date/lib/unixtime2tm.c b/ext/date/lib/unixtime2tm.c index c177fee..194b3b2 100644 --- a/ext/date/lib/unixtime2tm.c +++ b/ext/date/lib/unixtime2tm.c @@ -137,19 +137,16 @@ void timelib_unixtime2gmt(timelib_time* tm, timelib_sll ts) void timelib_update_from_sse(timelib_time *tm) { timelib_sll sse; + int z = tm->z; + signed int dst = tm->dst; sse = tm->sse; switch (tm->zone_type) { case TIMELIB_ZONETYPE_ABBR: case TIMELIB_ZONETYPE_OFFSET: { - int z = tm->z; - signed int dst = tm->dst; - timelib_unixtime2gmt(tm, tm->sse - (tm->z * 60) + (tm->dst * 3600)); - tm->z = z; - tm->dst = dst; goto cleanup; } @@ -171,6 +168,8 @@ cleanup: tm->sse = sse; tm->is_localtime = 1; tm->have_zone = 1; + tm->z = z; + tm->dst = dst; } void timelib_unixtime2local(timelib_time *tm, timelib_sll ts) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix backwards transition diffs.: ext/date/lib/interval.c
Commit:324e6a5f82d830cf46e0cf35f82c44253b8bd2cf Author:Derick Rethans Sat, 13 Apr 2013 23:47:23 +0100 Parents: aa26ace21f1457bfcc5faf417d9d453b82944aba Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=324e6a5f82d830cf46e0cf35f82c44253b8bd2cf Log: Fix backwards transition diffs. Changed paths: M ext/date/lib/interval.c Diff: diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c index ded5786..e765a42 100644 --- a/ext/date/lib/interval.c +++ b/ext/date/lib/interval.c @@ -65,10 +65,22 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) rt->h += dst_h_corr; rt->i += dst_m_corr; } + rt->days = abs(floor((one->sse - two->sse - (dst_h_corr * 3600) - (dst_m_corr * 60)) / 86400)); timelib_do_rel_normalize(rt->invert ? one : two, rt); + /* We need to do this after normalisation otherwise we can't get "24H" */ + if (one_backup.dst == 1 && two_backup.dst == 0 && two->sse >= one->sse + 86400) { + if (two->sse < one->sse + 86400 - dst_corr) { + rt->d--; + rt->h = 24; + } else { + rt->h += dst_h_corr; + rt->i += dst_m_corr; + } + } + /* Restore old TZ info */ memcpy(one, &one_backup, sizeof(one_backup)); memcpy(two, &two_backup, sizeof(two_backup)); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Group those tests a bit better, as some of the bd ones wanted a "ST" feature that doesn't exist yet.: ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt
Commit:7a0df7be34d35e91406b9654cb7be1de9b8720c1 Author:Derick Rethans Sat, 13 Apr 2013 18:45:51 +0100 Parents: 6e8b2c91c4a9e8ceab5930bbfe6b18cfb9689f3a Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7a0df7be34d35e91406b9654cb7be1de9b8720c1 Log: Group those tests a bit better, as some of the bd ones wanted a "ST" feature that doesn't exist yet. Changed paths: M ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt Diff: diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt index 855fe4e..15bd0b0 100644 --- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt +++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3.phpt @@ -2,8 +2,6 @@ RFC: DateTime and Daylight Saving Time Transitions (zone type 3) --CREDITS-- Daniel Convissor ---XFAIL-- -RFC not implemented yet --FILE-- setTimeZone($tz); -$start = new DateTime('2010-11-07 01:59:59'); +$end = new DateTime('2010-11-07 05:30:00'); +$start = new DateTime('2010-11-06 04:30:00'); echo 'bd1 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n"; + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; $end = new DateTime('2010-11-07 04:30:00'); $start = new DateTime('2010-11-06 04:30:00'); @@ -176,6 +173,19 @@ $start = new DateTime('2010-11-06 04:30:00'); echo 'bd4 ' . $end->format($date_format) . ' - ' . $start->format($date_format) . ' = ' . $start->diff($end)->format($interval_format) . "\n"; +$end = new DateTime('2010-11-07 01:30:00'); +$start = new DateTime('2010-11-06 01:30:00'); +echo 'bd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format($interval_format) . "\n"; + +echo "\n"; + +$end = new DateTime('2010-11-07 05:30:00'); +$end->setTimeZone($tz); +$start = new DateTime('2010-11-06 04:30:59'); +echo 'bd0 ' . $end->format($date_format) . ' - ' . $start->format($date_format) + . ' = ' . $start->diff($end)->format('PT%hH%iM%sS') . "\n"; + $end = new DateTime('2010-11-07 01:30:00 EST'); $end->setTimeZone($tz); $start = new DateTime('2010-11-06 04:30:00'); @@ -188,11 +198,6 @@ $start = new DateTime('2010-11-06 04:30:00'); echo 'bd6 ' . $end->format($date_format) . ' - ' . $start->format($date_format) . ' = ' . $start->diff($end)->format($interval_format) . "\n"; -$end = new DateTime('2010-11-07 01:30:00'); -$start = new DateTime('2010-11-06 01:30:00'); -echo 'bd7 ' . $end->format($date_format) . ' - ' . $start->format($date_format) - . ' = ' . $start->diff($end)->format($interval_format) . "\n"; - $end = new DateTime('2010-11-07 01:30:00 EST'); $end->setTimeZone($tz); $start = new DateTime('2010-11-06 01:30:00'); @@ -366,13 +371,15 @@ fs5 2010-03-14 01:30:00 EST America/New_York - P1D = 2010-03-13 01:30:00 EST Ame fs6 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York fs7 2010-03-15 03:30:00 EDT America/New_York - P1D = 2010-03-14 03:30:00 EDT America/New_York -bd1 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S +bd1 2010-11-07 05:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT1H bd2 2010-11-07 04:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P1DT0H bd3 2010-11-07 03:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT24H bd4 2010-11-07 02:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT23H +bd7 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H + +bd0 2010-11-07 01:00:00 EST America/New_York - 2010-11-07 01:59:59 EDT America/New_York = PT0H0M1S bd5 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT22H bd6 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 04:30:00 EDT America/New_York = P0DT21H -bd7 2010-11-07 01:30:00 EDT America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT0H bd8 2010-11-07 01:30:00 EST America/New_York - 2010-11-06 01:30:00 EDT America/New_York = P1DT1H ba1 2010-11-07 01:59:59 EDT America/New_York + PT1S = 2010-11-07 01:00:00 EST America/New_York -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed forward transitions in diffs.: ext/date/lib/interval.c
Commit:6e8b2c91c4a9e8ceab5930bbfe6b18cfb9689f3a Author:Derick Rethans Fri, 12 Apr 2013 11:24:14 +0100 Parents: 261c6b31ca748fd97a105314ec78a166b2639db9 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6e8b2c91c4a9e8ceab5930bbfe6b18cfb9689f3a Log: Fixed forward transitions in diffs. Changed paths: M ext/date/lib/interval.c Diff: diff --git a/ext/date/lib/interval.c b/ext/date/lib/interval.c index 96867ba..ded5786 100644 --- a/ext/date/lib/interval.c +++ b/ext/date/lib/interval.c @@ -25,7 +25,7 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) { timelib_rel_time *rt; timelib_time *swp; - timelib_sll dst_h_corr = 0, dst_m_corr = 0; + timelib_sll dst_corr = 0 ,dst_h_corr = 0, dst_m_corr = 0; timelib_time one_backup, two_backup; rt = timelib_rel_time_ctor(); @@ -43,8 +43,9 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) && (strcmp(one->tz_info->name, two->tz_info->name) == 0) && (one->z != two->z)) { - dst_h_corr = (two->z - one->z) / 3600; - dst_m_corr = ((two->z - one->z) % 3600) / 60; + dst_corr = two->z - one->z; + dst_h_corr = dst_corr / 3600; + dst_m_corr = (dst_corr % 3600) / 60; } /* Save old TZ info */ @@ -57,9 +58,13 @@ timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two) rt->y = two->y - one->y; rt->m = two->m - one->m; rt->d = two->d - one->d; - rt->h = two->h - one->h + dst_h_corr; - rt->i = two->i - one->i + dst_m_corr; + rt->h = two->h - one->h; + rt->i = two->i - one->i; rt->s = two->s - one->s; + if (one_backup.dst == 0 && two_backup.dst == 1 && two->sse >= one->sse + 86400 - dst_corr) { + rt->h += dst_h_corr; + rt->i += dst_m_corr; + } rt->days = abs(floor((one->sse - two->sse - (dst_h_corr * 3600) - (dst_m_corr * 60)) / 86400)); timelib_do_rel_normalize(rt->invert ? one : two, rt); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/pdo_dblib/dblib_driver.c
Commit:9ef4e5d23d331227cbc3dfed04f9702b8012e1ef Author:Derick Rethans Fri, 27 Sep 2013 10:14:51 +0100 Parents: 5ac7c533a0334f384d1a74eed6172a3c8cc4ef49 ea0f832f1000a47553a483e52633377a0d37800f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9ef4e5d23d331227cbc3dfed04f9702b8012e1ef Log: Merge branch 'PHP-5.5' Changed paths: MM ext/pdo_dblib/dblib_driver.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Updated to version 2013.4 (2013d): ext/date/lib/timezonedb.h
Commit:c7ee677f2f330bbcc8721b6a84dd3a05dc0c5541 Author:Derick Rethans Tue, 9 Jul 2013 09:07:16 +0100 Parents: 79df8cf9c2958eecee58da9859db10ee36af1753 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c7ee677f2f330bbcc8721b6a84dd3a05dc0c5541 Log: - Updated to version 2013.4 (2013d) Changed paths: M ext/date/lib/timezonedb.h diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 2f9d8fe..1e5706c 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -766,8 +766,8 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x1A, 0xB7, 0xA6, 0x00, 0x1E, 0x18, 0x6F, 0xF0, 0x48, 0x41, 0xE6, 0x80, 0x48, 0xBB, 0x22, 0x70, 0x4A, 0x23, 0x1A, 0x00, 0x4A, 0x8D, 0xD5, 0x70, 0x4B, 0xDC, 0xC0, 0x80, 0x4C, 0x5D, 0xE5, 0x70, 0x4D, 0x97, 0xB8, 0x80, 0x4E, 0x34, 0x8C, 0xF0, 0x4F, 0x9C, 0xA0, 0xA0, 0x50, 0x08, 0xBB, 0xA0, -0x50, 0x31, 0x9A, 0x20, 0x50, 0x67, 0xA7, 0xA0, 0x51, 0x7C, 0x82, 0xA0, 0x51, 0xDB, 0x6E, 0xA0, -0x52, 0x02, 0xFB, 0xA0, 0x52, 0x47, 0x89, 0xA0, 0x53, 0x5C, 0x64, 0xA0, 0x53, 0xAF, 0x73, 0x20, +0x50, 0x31, 0x9A, 0x20, 0x50, 0x67, 0xA7, 0xA0, 0x51, 0x7C, 0x82, 0xA0, 0x51, 0xD8, 0xCB, 0xA0, +0x52, 0x05, 0x9E, 0xA0, 0x52, 0x47, 0x89, 0xA0, 0x53, 0x5C, 0x64, 0xA0, 0x53, 0xAF, 0x73, 0x20, 0x53, 0xD7, 0x00, 0x20, 0x54, 0x27, 0x6B, 0xA0, 0x55, 0x3C, 0x46, 0xA0, 0x55, 0x82, 0x26, 0x20, 0x55, 0xA9, 0xB3, 0x20, 0x56, 0x07, 0x4D, 0xA0, 0x57, 0x1C, 0x28, 0xA0, 0x57, 0x56, 0x2A, 0xA0, 0x57, 0x7D, 0xB7, 0xA0, 0x57, 0xE7, 0x2F, 0xA0, 0x59, 0x05, 0x45, 0x20, 0x59, 0x28, 0xDD, 0xA0, @@ -7248,7 +7248,7 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x01, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x08, 0x45, 0x53, 0x54, 0x00, 0x7A, 0x7A, 0x7A, 0x00, 0x4D, 0x49, 0x53, 0x54, 0x00, 0x00, -0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x2B, 0x30, 0x02, +0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x2B, 0x30, 0x02, 0x05, 0x32, 0x58, 0x00, 0x00, 0x00, 0x10, 0x4D, 0x61, 0x63, 0x71, 0x75, 0x61, 0x72, 0x69, 0x65, 0x20, 0x49, 0x73, 0x6C, 0x61, 0x6E, 0x64, @@ -8441,19 +8441,19 @@ const unsigned char timelib_timezone_db_data_builtin[261525] = { 0x46, 0xEC, 0x63, 0xF0, 0x47, 0xEC, 0x35, 0x00, 0x48, 0xE7, 0xF5, 0x70, 0x49, 0xCC, 0x17, 0x00, 0x4A, 0xBE, 0x9C, 0xF0, 0x4B, 0xAB, 0xF9, 0x00, 0x4C, 0x8C, 0x09, 0xF0, 0x4D, 0x95, 0x15, 0x80, 0x4E, 0x87, 0x9B, 0x70, 0x4F, 0x74, 0xF7, 0x80, 0x50, 0x5E, 0x42, 0xF0, 0x51, 0x54, 0xD9, 0x80, -0x52, 0x50, 0x99, 0xF0, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x30, 0x7B, 0xF0, 0x55, 0x14, 0x9D, 0x80, -0x56, 0x10, 0x5D, 0xF0, 0x56, 0xF4, 0x7F, 0x80, 0x57, 0xF0, 0x3F, 0xF0, 0x58, 0xD4, 0x61, 0x80, -0x59, 0xD9, 0x5C, 0x70, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xB9, 0x3E, 0x70, 0x5C, 0x9D, 0x60, 0x00, -0x5D, 0x99, 0x20, 0x70, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x79, 0x02, 0x70, 0x60, 0x5D, 0x24, 0x00, -0x61, 0x58, 0xE4, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x38, 0xC6, 0x70, 0x64, 0x1C, 0xE8, 0x00, -0x65, 0x21, 0xE2, 0xF0, 0x66, 0x06, 0x04, 0x80, 0x67, 0x01, 0xC4, 0xF0, 0x67, 0xE5, 0xE6, 0x80, -0x68, 0xE1, 0xA6, 0xF0, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xC1, 0x88, 0xF0, 0x6B, 0xA5, 0xAA, 0x80, -0x6C, 0xA2, 0xBC, 0x70, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0x8A, 0x87, 0x70, 0x6F, 0x65, 0x6E, 0x80, -0x70, 0x6A, 0x69, 0x70, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x4A, 0x4B, 0x70, 0x73, 0x2E, 0x6D, 0x00, -0x74, 0x2A, 0x2D, 0x70, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x0A, 0x0F, 0x70, 0x76, 0xEE, 0x31, 0x00, -0x77, 0xE9, 0xF1, 0x70, 0x78, 0xCE, 0x13, 0x00, 0x79, 0xD3, 0x0D, 0xF0, 0x7A, 0xAD, 0xF5, 0x00, -0x7B, 0xB2, 0xEF, 0xF0, 0x7C, 0x97, 0x11, 0x80, 0x7D, 0x92, 0xD1, 0xF0, 0x7E, 0x76, 0xF3, 0x80, -0x7F, 0x72, 0xB3, 0xF0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, +0x52, 0x6C, 0x49, 0x70, 0x53, 0x34, 0xBB, 0x80, 0x54, 0x4C, 0x2B, 0x70, 0x55, 0x14, 0x9D, 0x80, +0x56, 0x2C, 0x0D, 0x70, 0x56, 0xF4, 0x7F, 0x80, 0x58, 0x15, 0x29, 0xF0, 0x58, 0xD4, 0x61, 0x80, +0x59, 0xF5, 0x0B, 0xF0, 0x5A, 0xB4, 0x43, 0x80, 0x5B, 0xD4, 0xED, 0xF0, 0x5C, 0x9D, 0x60, 0x00, +0x5D, 0xB4, 0xCF, 0xF0, 0x5E, 0x7D, 0x42, 0x00, 0x5F, 0x94, 0xB1, 0xF0, 0x60, 0x5D, 0x24, 0x00, +0x61, 0x7D, 0xCE, 0x70, 0x62, 0x3D, 0x06, 0x00, 0x63, 0x5D, 0xB0, 0x70, 0x64, 0x1C, 0xE8, 0x00, +0x65, 0x3D, 0x92, 0x70, 0x66, 0x06, 0x04, 0x80, 0x67, 0x1D, 0x74, 0x70, 0x67, 0xE5, 0xE6, 0x80, +0x68, 0xFD, 0x56, 0x70, 0x69, 0xC5, 0xC8, 0x80, 0x6A, 0xDD, 0x38, 0x70, 0x6B, 0xA5, 0xAA, 0x80, +0x6C, 0xC6, 0x54, 0xF0, 0x6D, 0x85, 0x8C, 0x80, 0x6E, 0xA6, 0x36, 0xF0, 0x6F, 0x65, 0x6E, 0x80, +0x70, 0x86, 0x18, 0xF0, 0x71, 0x4E, 0x8B, 0x00, 0x72, 0x65, 0xFA, 0xF0, 0x73, 0x2E, 0x6D, 0x00, +0x74, 0x45, 0xDC, 0xF0, 0x75, 0x0E, 0x4F, 0x00, 0x76, 0x2E, 0xF9
Re: [PHP-CVS] com php-src: split the test for 32 and 64 bit: ext/date/tests/bug53437_var3.phpt ext/date/tests/bug53437_var5.phpt
On Mon, 10 Jun 2013, Anatol Belski wrote: > Commit:ec790753948d190db354cbce97786b4a1aac63fc > Author:Anatol Belski Mon, 10 Jun 2013 22:49:30 > +0200 > Parents: 84e35fb2e0fcd7400d289e06395c975fc7a77816 > Branches: PHP-5.5 master > > Link: > http://git.php.net/?p=php-src.git;a=commitdiff;h=ec790753948d190db354cbce97786b4a1aac63fc > > Log: > split the test for 32 and 64 bit > > Changed paths: > M ext/date/tests/bug53437_var3.phpt > A ext/date/tests/bug53437_var5.phpt > > > Diff: > diff --git a/ext/date/tests/bug53437_var3.phpt > b/ext/date/tests/bug53437_var3.phpt > index da7d0bd..537462e 100644 > --- a/ext/date/tests/bug53437_var3.phpt > +++ b/ext/date/tests/bug53437_var3.phpt > @@ -1,5 +1,10 @@ > --TEST-- > -Bug #53437 DateInterval unserialize bad data > +Bug #53437 DateInterval unserialize bad data, 32 bit > +--SKIPIF-- > + + if (PHP_INT_SIZE != 4) { > + die('skip 32 bit only'); > + } I'd appreciate it if you added the ?> (and perhaps keep the whole thing on one line). Without the ?> you can't simply run the test file with "php ext/date/tests/bug53437_var3.phpt". cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug Posted with an email client that doesn't mangle email: alpine -- 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 Sun, 5 Aug 2012 17:14:51 + Committer: Derick Rethans 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-- +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: Updated test case and added BFN to NEWS.: NEWS ext/date/tests/bug60774.phpt
Commit:503760c9130683a21ffe631fddfb20cc18ee2867 Author:Derick Rethans 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: Fixed the test to use %d instead of an actual number: ext/date/tests/DateTimeZone_verify.phpt
Commit:a1ebd82a29c427455c7ec2938b892727cfada552 Author:Lonny Kapelushnik Sat, 29 Sep 2012 22:10:58 -0400 Committer: Derick Rethans 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: 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 Fri, 28 Sep 2012 12:15:20 + Committer: Derick Rethans 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(ze
[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 Mon, 14 Jan 2013 23:03:52 + Committer: Derick Rethans 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; + +whil
[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 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"
[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 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, "DateTimeImmu
Re: [PHP-CVS] com php-src: Fixed bug #64359 strftime crash with VS2012: NEWS ext/date/php_date.c
On Wed, 6 Mar 2013, Anatol Belski wrote: > +#ifdef PHP_WIN32 > + /* VS2012 has a bug where strftime crash with %z and %Z format when the > +initial buffer is too small. Increasing the buffer size helps in a > +workaround to fixs longer format strings for this VS version. > + > http://connect.microsoft.com/VisualStudio/feedback/details/759720/vs2012-strftime-crash-with-z-formatting-code > + */ > + size_t buf_len = 256; > +#else > + size_t buf_len = 64; > +#endif > + size_t real_len; Why the ifdef? You can just set it to 256 for everything. cheers, Derick -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Rename to create a NEWS file per version to fix the annoying merging issue with NEWS files.: NEWS NEWS-5.5
Commit:1e1de1554f2fb78f9d8fc237e52e42d276a64b6e Author:Derick Rethans Sun, 3 Mar 2013 13:10:24 -0500 Parents: 47ac3ec1f4c2fbad0f72aa76346f96ba52ecf2bc Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1e1de1554f2fb78f9d8fc237e52e42d276a64b6e Log: Rename to create a NEWS file per version to fix the annoying merging issue with NEWS files. Changed paths: D NEWS A NEWS-5.5 diff --git a/NEWS b/NEWS deleted file mode 100644 index d6e40de..000 --- a/NEWS +++ /dev/null @@ -1,341 +0,0 @@ -PHPNEWS -||| -?? ??? 201?, PHP 5.5.0 Beta 1 - -- Core: - . Fixed bug #49348 (Uninitialized ++$foo->bar; does not cause a notice). -(Stas) - -- Sockets: - . Fixed bug #64287 (sendmsg/recvmsg shutdown handler causes segfault). -(Gustavo) - -21 Feb 2013, PHP 5.5.0 Alpha 5 - -- Core: - . Implemented FR #64175 (Added HTTP codes as of RFC 6585). (Jonh Wendell) - . Fixed bug #64135 (Exceptions from set_error_handler are not always -propagated). (Laruence) - . Fixed bug #63830 (Segfault on undefined function call in nested generator). -(Nikita Popov) - . Fixed bug #60833 (self, parent, static behave inconsistently -case-sensitive). (Stas, mario at include-once dot org) - . Implemented FR #60524 (specify temp dir by php.ini). (ALeX Kazik). - . Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi) - . Added ARMv7/v8 versions of various Zend arithmetic functions that are -implemented using inline assembler (Ard Biesheuvel) - . Fix undefined behavior when converting double variables to integers. -The double is now always rounded towards zero, the remainder of its division - by 2^32 or 2^64 (depending on sizeof(long)) is calculated and it's made - signed assuming a two's complement representation. (Gustavo) - -- CLI server: - . Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi) - -- cURL: - . Implemented FR #46439 - added CURLFile for safer file uploads. -(Stas) - -- Intl: - . Cherry-picked UConverter wrapper, which had accidentaly been committed only -to master. - -- mysqli - . Added mysqli_begin_transaction()/mysqli::begin_transaction(). Implemented -all options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT - and ROLLBACK through options to mysqli_commit()/mysqli_rollback() and their - respective OO counterparts. They work in libmysql and mysqlnd mode. (Andrey) - . Added mysqli_savepoint(), mysqli_release_savepoint(). (Andrey) - -- mysqlnd - . Add new begin_transaction() call to the connection object. Implemented all -options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT - and ROLLBACK. (Andrey) - . Added mysqlnd_savepoint(), mysqlnd_release_savepoint(). (Andrey) - -- Sockets: - . Added recvmsg() and sendmsg() wrappers. (Gustavo) -See https://wiki.php.net/rfc/sendrecvmsg - -- Filter: - . Implemented FR #49180 - added MAC address validation. (Martin) - -- Phar: - . Fixed timestamp update on Phar contents modification. (Dmitry) - -- SPL: - . Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence) - . Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS). -(patch by kr...@krizalys.com, Laruence) - . Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended). -(Nikita Popov) - . Fixed bug #52861 (unset fails with ArrayObject and deep arrays). -(Mike Willbanks) - -- SNMP: - . Fixed bug #64124 (IPv6 malformed). (Boris Lytochkin) - -24 Jan 2013, PHP 5.5.0 Alpha 4 - -- Core: - . Fixed bug #63980 (object members get trimmed by zero bytes). (Laruence) - . Implemented RFC for Class Name Resolution As Scalar Via "class" Keyword. -(Ralph Schindler, Nikita Popov, Lars) - -- DateTime - . Added DateTimeImmutable - a variant of DateTime that only returns the -modified state instead of changing itself. (Derick) - -- FPM: - . Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam) - -- pgsql: - . Bug #46408: Locale number format settings can cause pg_query_params to -break with numerics. (asmecher, Lars) - -- dba: - . Bug #62489: dba_insert not working as expected. -(marc-bennewitz at arcor dot de, Lars) - -- Reflection: - . Fixed bug #64007 (There is an ability to create instance of Generator by -hand). (Laruence) - -10 Jan 2013, PHP 5.5.0 Alpha 3 - -- General improvements: - . Fixed bug #63874 (Segfault if php_strip_whitespace has heredoc). (Pierrick) - . Fixed bug #63822 (Crash when using closures with ArrayAccess). -(Nikita Popov) - . Add Generator::throw() method. (Nikita Popov) - . Bug #23955: allow specifying Max-Age attribute in setcookie() (narfbg, Lars) - . Bug #52126: timestamp for mail.log (Martin Jansen, Lars) - -- mysqlnd -
[PHP-CVS] com php-src: Rename to create a NEWS file per version to fix the annoying merging issue with NEWS files.: NEWS NEWS-5.4
Commit:6c2564766f9260ceecf3f963ce79a150cea9b0ac Author:Derick Rethans Sun, 3 Mar 2013 13:09:52 -0500 Parents: 206cce0d8be294c6d2990b46e590d165011b2d42 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6c2564766f9260ceecf3f963ce79a150cea9b0ac Log: Rename to create a NEWS file per version to fix the annoying merging issue with NEWS files. Changed paths: D NEWS A NEWS-5.4 Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Rename to create a NEWS file per version to fix the annoying merging issue with NEWS files.: NEWS NEWS-5.3
Commit:b36df28dca7d07a6b2bdae03c1257498470f8eef Author:Derick Rethans Sun, 3 Mar 2013 13:08:19 -0500 Parents: c134f2a1a5ef56da72dbdc1096eddc91e4f5939e Branches: PHP-5.3 PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b36df28dca7d07a6b2bdae03c1257498470f8eef Log: Rename to create a NEWS file per version to fix the annoying merging issue with NEWS files. Changed paths: D NEWS A NEWS-5.3 Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS
Commit:c596850af6d278b283aaf5b90026d23b348d5fe7 Author:Derick Rethans Sun, 3 Mar 2013 12:58:42 -0500 Parents: 46e612ada4679d6d87fca7581dcd303bf6d9dc42 a3f020a4be1dc5595a55d0e970663e5830ce6aa7 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c596850af6d278b283aaf5b90026d23b348d5fe7 Log: Merge branch 'PHP-5.4' into PHP-5.5 Conflicts: NEWS Changed paths: MM NEWS Diff: diff --cc NEWS index b75c052,7d0d2b6..d6e40de --- a/NEWS +++ b/NEWS @@@ -32,34 -14,37 +32,46 @@@ PH - CLI server: . Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi) -- Mbstring: - . mb_split() can now handle empty matches like preg_split() does. (Moriyoshi) +- cURL: + . Implemented FR #46439 - added CURLFile for safer file uploads. +(Stas) + +- Intl: + . Cherry-picked UConverter wrapper, which had accidentaly been committed only +to master. -- OpenSSL: - . Fixed bug #61930 (openssl corrupts ssl key resource when using -openssl_get_publickey()). (Stas) +- mysqli + . Added mysqli_begin_transaction()/mysqli::begin_transaction(). Implemented +all options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT + and ROLLBACK through options to mysqli_commit()/mysqli_rollback() and their + respective OO counterparts. They work in libmysql and mysqlnd mode. (Andrey) + . Added mysqli_savepoint(), mysqli_release_savepoint(). (Andrey) -- PDO_mysql: - . Fixed bug #60840 (undefined symbol: mysqlnd_debug_std_no_trace_funcs). -(Johannes) +- mysqlnd + . Add new begin_transaction() call to the connection object. Implemented all +options, per MySQL 5.6, which can be used with START TRANSACTION, COMMIT + and ROLLBACK. (Andrey) + . Added mysqlnd_savepoint(), mysqlnd_release_savepoint(). (Andrey) -- Phar: - . Fixed timestamp update on Phar contents modification. (Dmitry) +- Sockets: + . Added recvmsg() and sendmsg() wrappers. (Gustavo) +See https://wiki.php.net/rfc/sendrecvmsg -- SOAP - . Added check that soap.wsdl_cache_dir conforms to open_basedir -(CVE-2013-1635). (Dmitry) - . Disabled external entities loading (CVE-2013-1643). (Dmitry) +- Filter: + . Implemented FR #49180 - added MAC address validation. (Martin) + - Phar: + . Fixed timestamp update on Phar contents modification. (Dmitry) + + - SPL: + . Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence) + . Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS). + (patch by kr...@krizalys.com, Laruence) + . Fixed bug #64106 (Segfault on SplFixedArray[][x] = y when extended). + (Nikita Popov) + . Fixed bug #52861 (unset fails with ArrayObject and deep arrays). + (Mike Willbanks) + - SNMP: . Fixed bug #64124 (IPv6 malformed). (Boris Lytochkin) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: NEWS
Commit:a3f020a4be1dc5595a55d0e970663e5830ce6aa7 Author:Derick Rethans Sun, 3 Mar 2013 12:53:23 -0500 Parents: fe5ce5cb9143ca251dd8c2083a63232d8beea5a9 c134f2a1a5ef56da72dbdc1096eddc91e4f5939e Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a3f020a4be1dc5595a55d0e970663e5830ce6aa7 Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM NEWS Diff: diff --cc NEWS index 4f29a68,6eea516..7d0d2b6 --- a/NEWS +++ b/NEWS @@@ -1,38 -1,12 +1,41 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.3.24 +?? ??? 2012, PHP 5.4.14 -28 Feb 2013, PHP 5.3.23RC1 +?? ??? 2012, PHP 5.4.13 + +- Core: + . Fixed bug #64235 (Insteadof not work for class method in 5.4.11). +(Laruence) + . Implemented FR #64175 (Added HTTP codes as of RFC 6585). (Jonh Wendell) + . Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi) + . Fixed bug #64070 (Inheritance with Traits failed with error). (Dmitry) + +- CLI server: + . Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi) + +- Mbstring: + . mb_split() can now handle empty matches like preg_split() does. (Moriyoshi) + +- OpenSSL: + . Fixed bug #61930 (openssl corrupts ssl key resource when using +openssl_get_publickey()). (Stas) + +- PDO_mysql: + . Fixed bug #60840 (undefined symbol: mysqlnd_debug_std_no_trace_funcs). +(Johannes) + +- Phar: + . Fixed timestamp update on Phar contents modification. (Dmitry) + +- SOAP + . Added check that soap.wsdl_cache_dir conforms to open_basedir +(CVE-2013-1635). (Dmitry) + . Disabled external entities loading (CVE-2013-1643). (Dmitry) + - Phar: + . Fixed timestamp update on Phar contents modification. (Dmitry) + - SPL: . Fixed bug #64264 (SPLFixedArray toArray problem). (Laruence) . Fixed bug #64228 (RecursiveDirectoryIterator always assumes SKIP_DOTS). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Implemented immutable DateTime objects as the DateTimePoint class.: ext/date/php_date.c ext/date/php_date.h
Commit:1cc61f09279b26b9acc82461c7b77051355346ad Author:Derick Rethans Mon, 17 Dec 2012 15:31:23 + Parents: 92965b033afa098945d18080203de1595084d1ac Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1cc61f09279b26b9acc82461c7b77051355346ad Log: Implemented immutable DateTime objects as the DateTimePoint class. Changed paths: M ext/date/php_date.c M ext/date/php_date.h diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 0394cb6..61f6a95 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -385,7 +385,9 @@ const zend_function_entry date_functions[] = { /* Advanced Interface */ PHP_FE(date_create, arginfo_date_create) + PHP_FE(date_create_point, arginfo_date_create) PHP_FE(date_create_from_format, arginfo_date_create_from_format) + PHP_FE(date_create_point_from_format, arginfo_date_create_from_format) PHP_FE(date_parse, arginfo_date_parse) PHP_FE(date_parse_from_format, arginfo_date_parse_from_format) PHP_FE(date_get_last_errors, arginfo_date_get_last_errors) @@ -450,6 +452,20 @@ const zend_function_entry date_funcs_date[] = { PHP_FE_END }; +const zend_function_entry date_funcs_point[] = { + PHP_ME(DateTimePoint, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(DateTimePoint, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(DateTimePoint, modify,arginfo_date_method_modify, 0) + PHP_ME(DateTimePoint, add, arginfo_date_method_add, 0) + PHP_ME(DateTimePoint, sub, arginfo_date_method_sub, 0) + PHP_ME(DateTimePoint, setTimezone, arginfo_date_method_timezone_set, 0) + PHP_ME(DateTimePoint, setTime, arginfo_date_method_time_set, 0) + PHP_ME(DateTimePoint, setDate, arginfo_date_method_date_set, 0) + PHP_ME(DateTimePoint, setISODate,arginfo_date_method_isodate_set, 0) + PHP_ME(DateTimePoint, setTimestamp, arginfo_date_method_timestamp_set, 0) + PHP_FE_END +}; + const zend_function_entry date_funcs_timezone[] = { PHP_ME(DateTimeZone, __construct, arginfo_timezone_open, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) PHP_ME_MAPPING(getName, timezone_name_get, arginfo_timezone_method_name_get, 0) @@ -508,6 +524,7 @@ PHP_INI_END() /* }}} */ zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, *date_ce_period; +zend_class_entry *date_ce_point; PHPAPI zend_class_entry *php_date_get_date_ce(void) @@ -515,12 +532,18 @@ PHPAPI zend_class_entry *php_date_get_date_ce(void) return date_ce_date; } +PHPAPI zend_class_entry *php_date_get_point_ce(void) +{ + return date_ce_point; +} + PHPAPI zend_class_entry *php_date_get_timezone_ce(void) { return date_ce_timezone; } static zend_object_handlers date_object_handlers_date; +static zend_object_handlers date_object_handlers_point; static zend_object_handlers date_object_handlers_timezone; static zend_object_handlers date_object_handlers_interval; static zend_object_handlers date_object_handlers_period; @@ -555,11 +578,13 @@ static void date_object_free_storage_interval(void *object TSRMLS_DC); static void date_object_free_storage_period(void *object TSRMLS_DC); static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC); +static zend_object_value date_object_new_point(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_interval(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_period(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC); +static zend_object_value date_object_clone_point(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_interval(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_period(zval *this_ptr TSRMLS_DC); @@ -1908,7 +1933,7 @@ 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_timezone, ce_interval, ce_period; + zend_class_entry ce_date, ce_point, ce_timezone, ce_interval, ce_period; INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date); ce_date.create_object = date_object_new_date; @@ -1934,6 +1959,13 @@ static void date_register_classes(TSRMLS_D) REGISTER_DATE_CLASS_CONST_STRING("RSS", DATE_FORMAT_RFC1123); REGISTER_DATE_CLASS_CONST_STRING("W3C", DATE_FORMAT_RFC3339); + INIT_CLASS_ENTRY(ce_point, "DateTimePoint", date_funcs_point); + ce_po
[PHP-CVS] com php-src: Added a test case for DateTimePoint.: ext/date/tests/date_time_point.phpt
Commit:45a429200cdf7e918ef3aabc0eb23441f6e8eda3 Author:Derick Rethans Mon, 17 Dec 2012 16:35:52 + Parents: 1cc61f09279b26b9acc82461c7b77051355346ad Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=45a429200cdf7e918ef3aabc0eb23441f6e8eda3 Log: Added a test case for DateTimePoint. Changed paths: A ext/date/tests/date_time_point.phpt Diff: diff --git a/ext/date/tests/date_time_point.phpt b/ext/date/tests/date_time_point.phpt new file mode 100644 index 000..810eeca --- /dev/null +++ b/ext/date/tests/date_time_point.phpt @@ -0,0 +1,167 @@ +--TEST-- +Tests for DateTimePoint. +--INI-- +date.timezone=Europe/London +--FILE-- +format('Y-m-d H:i:s e'), "\n"; + echo 'copy:', $b->format('Y-m-d H:i:s e'), "\n"; + echo 'changed: ', $c->format('Y-m-d H:i:s e'), "\n"; +} + +echo "modify():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->modify("+2 days"); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->modify("+2 days"); +dump($v, $z, $x); + +echo "\nadd():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->add(new DateInterval("P2DT2S")); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->add(new DateInterval("P2DT2S")); +dump($v, $z, $x); + +echo "\nsub():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->sub(new DateInterval("P2DT2S")); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->sub(new DateInterval("P2DT2S")); +dump($v, $z, $x); + +echo "\nsetTimezone():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); +$v = new DateTimePoint($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); + +echo "\nsetTime():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTime(5, 7, 19); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTime(5, 7, 19); +dump($v, $z, $x); + +echo "\nsetDate():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setDate(5, 7, 19); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setDate(5, 7, 19); +dump($v, $z, $x); + +echo "\nsetIsoDate():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setIsoDate(2012, 2, 6); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setIsoDate(2012, 2, 6); +dump($v, $z, $x); + +echo "\nsetTimestamp():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTimestamp(2012234222); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTimestamp(2012234222); +dump($v, $z, $x); +?> +--EXPECT-- +modify(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-29 16:24:08 Europe/London +orig:2012-12-29 16:24:08 Europe/London +copy:2012-12-29 16:24:08 Europe/London +changed: 2012-12-29 16:24:08 Europe/London + +add(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-29 16:24:10 Europe/London +orig:2012-12-29 16:24:10 Europe/London +copy:2012-12-29 16:24:10 Europe/London +changed: 2012-12-29 16:24:10 Europe/London + +sub(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-25 16:24:06 Europe/London +orig:2012-12-25 16:24:06 Europe/London +copy:2012-12-25 16:24:06 Europe/London +changed: 2012-12-25 16:24:06 Europe/London + +setTimezone(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-28 01:24:08 Asia/Tokyo +orig:2012-12-28 01:24:08 Asia/Tokyo +copy:2012-12-28 01:24:08 Asia/Tokyo +changed: 2012-12-28 01:24:08 Asia/Tokyo +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-28 01:24:08 Asia/Tokyo + +setTime(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-27 05:07:19 Europe/London +orig:2012-12-27 05:07:19 Europe/London +copy:2012-12-27 05:07:19 Europe/London +changed: 2012-12-27 05:07:19 Europe/London + +setDate(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 0005-07-19 16:24:08 Europe/London +orig:0005-07-19 16:24:08 Europe/London +copy:0005-07-19 16:24:08 Europe/London +changed: 0005-07-19 16:24:08 Europe/London + +setIsoDate(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-01-14 16:24:08 Europe/London +orig:2012-01-14 16:24:08 Europe/London +copy:2012-01-14 16:24:08 Europe/London +changed: 2
[PHP-CVS] com php-src: Added another test to test the unmodified inherited methods.: ext/date/tests/date_time_point-inherited.phpt
Commit:a0bea9a1de7123d52b0339ad9d883bbe231122d5 Author:Derick Rethans Mon, 17 Dec 2012 16:49:25 + Parents: 3919d0adf734f37d7db7c6d76522cd75ac608250 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a0bea9a1de7123d52b0339ad9d883bbe231122d5 Log: Added another test to test the unmodified inherited methods. Changed paths: A ext/date/tests/date_time_point-inherited.phpt Diff: diff --git a/ext/date/tests/date_time_point-inherited.phpt b/ext/date/tests/date_time_point-inherited.phpt new file mode 100644 index 000..e355407 --- /dev/null +++ b/ext/date/tests/date_time_point-inherited.phpt @@ -0,0 +1,25 @@ +--TEST-- +Tests for DateTimePoint. +--INI-- +date.timezone=Europe/London +--FILE-- +getTimezone(); +var_dump($x->getName()); + +echo "\ngetTimestamp():\n"; +$v = date_create_point($current); +$x = $v->getTimestamp(); +var_dump($x); +?> +--EXPECT-- +getTimezone(): +string(13) "Europe/London" + +getTimestamp(): +int(1356625448) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Added a few missing TSRMLS_DC/TSRMLS_CC.: ext/date/php_date.c
Commit:3919d0adf734f37d7db7c6d76522cd75ac608250 Author:Derick Rethans Mon, 17 Dec 2012 16:49:00 + Parents: 45a429200cdf7e918ef3aabc0eb23441f6e8eda3 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3919d0adf734f37d7db7c6d76522cd75ac608250 Log: Added a few missing TSRMLS_DC/TSRMLS_CC. Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 61f6a95..3fbdaf2 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2883,7 +2883,7 @@ PHP_FUNCTION(date_format) } /* }}} */ -static void php_date_modify(zval *object, char *modify, int modify_len, zval *return_value) +static void php_date_modify(zval *object, char *modify, int modify_len, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; timelib_time *tmp_time; @@ -2952,7 +2952,7 @@ PHP_FUNCTION(date_modify) RETURN_FALSE; } - php_date_modify(object, modify, modify_len, return_value); + php_date_modify(object, modify, modify_len, return_value TSRMLS_CC); RETURN_ZVAL(getThis(), 1, 0); } @@ -2971,13 +2971,13 @@ PHP_METHOD(DateTimePoint, modify) } new_object = date_clone_point(object); - php_date_modify(new_object, modify, modify_len, return_value); + php_date_modify(new_object, modify, modify_len, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } /* }}} */ -static void php_date_add(zval *object, zval *interval, zval *return_value) +static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; php_interval_obj *intobj; @@ -3021,7 +3021,7 @@ PHP_FUNCTION(date_add) RETURN_FALSE; } - php_date_add(object, interval, return_value); + php_date_add(object, interval, return_value TSRMLS_CC); RETURN_ZVAL(object, 1, 0); } @@ -3038,13 +3038,13 @@ PHP_METHOD(DateTimePoint, add) } new_object = date_clone_point(object); - php_date_add(new_object, interval, return_value); + php_date_add(new_object, interval, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } /* }}} */ -static void php_date_sub(zval *object, zval *interval, zval *return_value) +static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; php_interval_obj *intobj; @@ -3091,7 +3091,7 @@ PHP_FUNCTION(date_sub) RETURN_FALSE; } - php_date_sub(object, interval, return_value); + php_date_sub(object, interval, return_value TSRMLS_CC); RETURN_ZVAL(object, 1, 0); } @@ -3108,7 +3108,7 @@ PHP_METHOD(DateTimePoint, sub) } new_object = date_clone_point(object); - php_date_sub(new_object, interval, return_value); + php_date_sub(new_object, interval, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Rename DateTimePoint to DateTimeImmutable.: ext/date/php_date.c ext/date/php_date.h ext/date/tests/date_time_immutable-inherited.phpt ext/date/tests/date_time_immutable.phpt ext
Commit:017b1f7fca09896b05f2602136ffba7585cd4bfe Author:Derick Rethans Wed, 19 Dec 2012 16:24:38 + Parents: a0bea9a1de7123d52b0339ad9d883bbe231122d5 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=017b1f7fca09896b05f2602136ffba7585cd4bfe Log: Rename DateTimePoint to DateTimeImmutable. Changed paths: M ext/date/php_date.c M ext/date/php_date.h A ext/date/tests/date_time_immutable-inherited.phpt A ext/date/tests/date_time_immutable.phpt D ext/date/tests/date_time_point-inherited.phpt D ext/date/tests/date_time_point.phpt diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 3fbdaf2..596a7a9 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -385,9 +385,9 @@ const zend_function_entry date_functions[] = { /* Advanced Interface */ PHP_FE(date_create, arginfo_date_create) - PHP_FE(date_create_point, arginfo_date_create) + PHP_FE(date_create_immutable, arginfo_date_create) PHP_FE(date_create_from_format, arginfo_date_create_from_format) - PHP_FE(date_create_point_from_format, arginfo_date_create_from_format) + PHP_FE(date_create_immutable_from_format, arginfo_date_create_from_format) PHP_FE(date_parse, arginfo_date_parse) PHP_FE(date_parse_from_format, arginfo_date_parse_from_format) PHP_FE(date_get_last_errors, arginfo_date_get_last_errors) @@ -452,17 +452,17 @@ const zend_function_entry date_funcs_date[] = { PHP_FE_END }; -const zend_function_entry date_funcs_point[] = { - PHP_ME(DateTimePoint, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(DateTimePoint, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(DateTimePoint, modify,arginfo_date_method_modify, 0) - PHP_ME(DateTimePoint, add, arginfo_date_method_add, 0) - PHP_ME(DateTimePoint, sub, arginfo_date_method_sub, 0) - PHP_ME(DateTimePoint, setTimezone, arginfo_date_method_timezone_set, 0) - PHP_ME(DateTimePoint, setTime, arginfo_date_method_time_set, 0) - PHP_ME(DateTimePoint, setDate, arginfo_date_method_date_set, 0) - PHP_ME(DateTimePoint, setISODate,arginfo_date_method_isodate_set, 0) - PHP_ME(DateTimePoint, setTimestamp, arginfo_date_method_timestamp_set, 0) +const zend_function_entry date_funcs_immutable[] = { + PHP_ME(DateTimeImmutable, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(DateTimeImmutable, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + 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) + PHP_ME(DateTimeImmutable, setTimezone, arginfo_date_method_timezone_set, 0) + PHP_ME(DateTimeImmutable, setTime, arginfo_date_method_time_set, 0) + PHP_ME(DateTimeImmutable, setDate, arginfo_date_method_date_set, 0) + PHP_ME(DateTimeImmutable, setISODate, arginfo_date_method_isodate_set, 0) + PHP_ME(DateTimeImmutable, setTimestamp, arginfo_date_method_timestamp_set, 0) PHP_FE_END }; @@ -524,7 +524,7 @@ PHP_INI_END() /* }}} */ zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, *date_ce_period; -zend_class_entry *date_ce_point; +zend_class_entry *date_ce_immutable; PHPAPI zend_class_entry *php_date_get_date_ce(void) @@ -532,9 +532,9 @@ PHPAPI zend_class_entry *php_date_get_date_ce(void) return date_ce_date; } -PHPAPI zend_class_entry *php_date_get_point_ce(void) +PHPAPI zend_class_entry *php_date_get_immutable_ce(void) { - return date_ce_point; + return date_ce_immutable; } PHPAPI zend_class_entry *php_date_get_timezone_ce(void) @@ -543,7 +543,7 @@ PHPAPI zend_class_entry *php_date_get_timezone_ce(void) } static zend_object_handlers date_object_handlers_date; -static zend_object_handlers date_object_handlers_point; +static zend_object_handlers date_object_handlers_immutable; static zend_object_handlers date_object_handlers_timezone; static zend_object_handlers date_object_handlers_interval; static zend_object_handlers date_object_handlers_period; @@ -578,13 +578,13 @@ static void date_object_free_storage_interval(void *object TSRMLS_DC); static void date_object_free_storage_period(void *object TSRMLS_DC); static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC); -static zend_object_value date_object_new_point(zend_class_entry *class_type TSRMLS_DC); +static zend_object_value date_object_new_immutable(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_interval(zend_class_entry *class_type TSRMLS_DC); static
[PHP-CVS] com php-src: Fixed crash bug when the non-OO interface was used.: ext/date/php_date.c
Commit:a0618139c9f7aa7859f338a485af161f672be9cd Author:Derick Rethans Wed, 19 Dec 2012 17:40:14 + Parents: 017b1f7fca09896b05f2602136ffba7585cd4bfe Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a0618139c9f7aa7859f338a485af161f672be9cd Log: Fixed crash bug when the non-OO interface was used. Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 596a7a9..fc281ce 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2954,7 +2954,7 @@ PHP_FUNCTION(date_modify) php_date_modify(object, modify, modify_len, return_value TSRMLS_CC); - RETURN_ZVAL(getThis(), 1, 0); + RETURN_ZVAL(object, 1, 0); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Make DatePeriod support DateTimeImmutable as well.: ext/date/php_date.c ext/date/php_date.h ext/date/tests/date_period-immutable.phpt
Commit:c20911a8501ed2a69c6ce9359e8e50d599f99bba Author:Derick Rethans Thu, 20 Dec 2012 13:22:18 + Parents: a0618139c9f7aa7859f338a485af161f672be9cd Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c20911a8501ed2a69c6ce9359e8e50d599f99bba Log: Make DatePeriod support DateTimeImmutable as well. If the start element is a DateTimeImmutable object, then all returned objects are also DateTimeImmutable objects. If the start element is a DateTime object, then all returned objects are DateTime objects. Changed paths: M ext/date/php_date.c M ext/date/php_date.h A ext/date/tests/date_period-immutable.phpt Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index fc281ce..cc83130 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1847,7 +1847,7 @@ static void date_period_it_current_data(zend_object_iterator *iter, zval ***data /* Create new object */ MAKE_STD_ZVAL(iterator->current); - php_date_instantiate(date_ce_date, iterator->current TSRMLS_CC); + php_date_instantiate(object->start_ce, iterator->current TSRMLS_CC); newdateobj = (php_date_obj *) zend_object_store_get_object(iterator->current TSRMLS_CC); newdateobj->time = timelib_time_ctor(); *newdateobj->time = *it_time; @@ -4182,6 +4182,7 @@ PHP_METHOD(DatePeriod, __construct) if (dpobj->end) { timelib_update_ts(dpobj->end, NULL); } + dpobj->start_ce = date_ce_date; } else { /* init */ intobj = (php_interval_obj *) zend_object_store_get_object(interval TSRMLS_CC); @@ -4197,6 +4198,7 @@ PHP_METHOD(DatePeriod, __construct) clone->tz_info = dateobj->time->tz_info; } dpobj->start = clone; + dpobj->start_ce = Z_OBJCE_P(start); /* interval */ dpobj->interval = timelib_rel_time_clone(intobj->diff); diff --git a/ext/date/php_date.h b/ext/date/php_date.h index 19c692b..3af3fa4 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -154,6 +154,7 @@ struct _php_interval_obj { struct _php_period_obj { zend_object std; timelib_time *start; + zend_class_entry *start_ce; timelib_time *current; timelib_time *end; timelib_rel_time *interval; diff --git a/ext/date/tests/date_period-immutable.phpt b/ext/date/tests/date_period-immutable.phpt new file mode 100644 index 000..0ec4b4a --- /dev/null +++ b/ext/date/tests/date_period-immutable.phpt @@ -0,0 +1,56 @@ +--TEST-- +DatePeriod +--FILE-- +format( "l Y-m-d\n" ); +echo $dt->modify( "3 tuesday" )->format( "l Y-m-d\n" ); + echo $dt->format( "l Y-m-d\n\n" ); +} + +foreach ( new DatePeriod( $db2, $di, $de ) as $dt ) +{ + echo get_class( $dt ), "\n"; + echo $dt->format( "l Y-m-d\n" ); +echo $dt->modify( "3 tuesday" )->format( "l Y-m-d\n" ); + echo $dt->format( "l Y-m-d\n\n" ); +} +?> +--EXPECT-- +DateTimeImmutable +Tuesday 2008-01-01 +Tuesday 2008-01-15 +Tuesday 2008-01-01 + +DateTimeImmutable +Friday 2008-02-01 +Tuesday 2008-02-19 +Friday 2008-02-01 + +DateTimeImmutable +Saturday 2008-03-01 +Tuesday 2008-03-18 +Saturday 2008-03-01 + +DateTime +Tuesday 2008-01-01 +Tuesday 2008-01-15 +Tuesday 2008-01-15 + +DateTime +Friday 2008-02-01 +Tuesday 2008-02-19 +Tuesday 2008-02-19 + +DateTime +Saturday 2008-03-01 +Tuesday 2008-03-18 +Tuesday 2008-03-18 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Added NEWS item for DateTimeImmutable: NEWS
Commit:6313fc7e10d4234cc1e80f223c0652240cad4fda Author:Derick Rethans Mon, 14 Jan 2013 20:36:48 + Parents: c20911a8501ed2a69c6ce9359e8e50d599f99bba Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6313fc7e10d4234cc1e80f223c0652240cad4fda Log: Added NEWS item for DateTimeImmutable Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 74c1134..9e8cd85 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,10 @@ PHP NEWS CURLOPT_ACCEPTTIMEOUT_MS, CURLOPT_SSL_OPTIONS, CURLOPT_TCP_KEEPALIVE, CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL. (Pierrick) +- DateTime + . Added DateTimeImmutable - a variant of DateTime that only returns the +modified state instead of changing itself. (Derick) + - pgsql: . Bug #46408: Locale number format settings can cause pg_query_params to break with numerics. (asmecher, Lars) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Implemented immutable DateTime objects as the DateTimePoint class.: ext/date/php_date.c ext/date/php_date.h
Commit:9657591e35b0466b8d86284a78f8cba8bbd4e4b9 Author:Derick Rethans Mon, 17 Dec 2012 15:31:23 + Parents: 52dd0d1c73e6b67eaad256cb1349e314408d2bc8 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9657591e35b0466b8d86284a78f8cba8bbd4e4b9 Log: Implemented immutable DateTime objects as the DateTimePoint class. Changed paths: M ext/date/php_date.c M ext/date/php_date.h diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 0394cb6..61f6a95 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -385,7 +385,9 @@ const zend_function_entry date_functions[] = { /* Advanced Interface */ PHP_FE(date_create, arginfo_date_create) + PHP_FE(date_create_point, arginfo_date_create) PHP_FE(date_create_from_format, arginfo_date_create_from_format) + PHP_FE(date_create_point_from_format, arginfo_date_create_from_format) PHP_FE(date_parse, arginfo_date_parse) PHP_FE(date_parse_from_format, arginfo_date_parse_from_format) PHP_FE(date_get_last_errors, arginfo_date_get_last_errors) @@ -450,6 +452,20 @@ const zend_function_entry date_funcs_date[] = { PHP_FE_END }; +const zend_function_entry date_funcs_point[] = { + PHP_ME(DateTimePoint, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(DateTimePoint, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(DateTimePoint, modify,arginfo_date_method_modify, 0) + PHP_ME(DateTimePoint, add, arginfo_date_method_add, 0) + PHP_ME(DateTimePoint, sub, arginfo_date_method_sub, 0) + PHP_ME(DateTimePoint, setTimezone, arginfo_date_method_timezone_set, 0) + PHP_ME(DateTimePoint, setTime, arginfo_date_method_time_set, 0) + PHP_ME(DateTimePoint, setDate, arginfo_date_method_date_set, 0) + PHP_ME(DateTimePoint, setISODate,arginfo_date_method_isodate_set, 0) + PHP_ME(DateTimePoint, setTimestamp, arginfo_date_method_timestamp_set, 0) + PHP_FE_END +}; + const zend_function_entry date_funcs_timezone[] = { PHP_ME(DateTimeZone, __construct, arginfo_timezone_open, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) PHP_ME_MAPPING(getName, timezone_name_get, arginfo_timezone_method_name_get, 0) @@ -508,6 +524,7 @@ PHP_INI_END() /* }}} */ zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, *date_ce_period; +zend_class_entry *date_ce_point; PHPAPI zend_class_entry *php_date_get_date_ce(void) @@ -515,12 +532,18 @@ PHPAPI zend_class_entry *php_date_get_date_ce(void) return date_ce_date; } +PHPAPI zend_class_entry *php_date_get_point_ce(void) +{ + return date_ce_point; +} + PHPAPI zend_class_entry *php_date_get_timezone_ce(void) { return date_ce_timezone; } static zend_object_handlers date_object_handlers_date; +static zend_object_handlers date_object_handlers_point; static zend_object_handlers date_object_handlers_timezone; static zend_object_handlers date_object_handlers_interval; static zend_object_handlers date_object_handlers_period; @@ -555,11 +578,13 @@ static void date_object_free_storage_interval(void *object TSRMLS_DC); static void date_object_free_storage_period(void *object TSRMLS_DC); static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC); +static zend_object_value date_object_new_point(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_interval(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_period(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC); +static zend_object_value date_object_clone_point(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_interval(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_period(zval *this_ptr TSRMLS_DC); @@ -1908,7 +1933,7 @@ 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_timezone, ce_interval, ce_period; + zend_class_entry ce_date, ce_point, ce_timezone, ce_interval, ce_period; INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date); ce_date.create_object = date_object_new_date; @@ -1934,6 +1959,13 @@ static void date_register_classes(TSRMLS_D) REGISTER_DATE_CLASS_CONST_STRING("RSS", DATE_FORMAT_RFC1123); REGISTER_DATE_CLASS_CONST_STRING("W3C", DATE_FORMAT_RFC3339); + INIT_CLASS_ENTRY(ce_point, "DateTimePoint", date_funcs_point); + ce_po
[PHP-CVS] com php-src: Added a test case for DateTimePoint.: ext/date/tests/date_time_point.phpt
Commit:21d7efef922956a233cc2bfdfba139a88fdc6c4f Author:Derick Rethans Mon, 17 Dec 2012 16:35:52 + Parents: 9657591e35b0466b8d86284a78f8cba8bbd4e4b9 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=21d7efef922956a233cc2bfdfba139a88fdc6c4f Log: Added a test case for DateTimePoint. Changed paths: A ext/date/tests/date_time_point.phpt Diff: diff --git a/ext/date/tests/date_time_point.phpt b/ext/date/tests/date_time_point.phpt new file mode 100644 index 000..810eeca --- /dev/null +++ b/ext/date/tests/date_time_point.phpt @@ -0,0 +1,167 @@ +--TEST-- +Tests for DateTimePoint. +--INI-- +date.timezone=Europe/London +--FILE-- +format('Y-m-d H:i:s e'), "\n"; + echo 'copy:', $b->format('Y-m-d H:i:s e'), "\n"; + echo 'changed: ', $c->format('Y-m-d H:i:s e'), "\n"; +} + +echo "modify():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->modify("+2 days"); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->modify("+2 days"); +dump($v, $z, $x); + +echo "\nadd():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->add(new DateInterval("P2DT2S")); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->add(new DateInterval("P2DT2S")); +dump($v, $z, $x); + +echo "\nsub():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->sub(new DateInterval("P2DT2S")); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->sub(new DateInterval("P2DT2S")); +dump($v, $z, $x); + +echo "\nsetTimezone():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); +$v = new DateTimePoint($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); + +echo "\nsetTime():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTime(5, 7, 19); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTime(5, 7, 19); +dump($v, $z, $x); + +echo "\nsetDate():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setDate(5, 7, 19); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setDate(5, 7, 19); +dump($v, $z, $x); + +echo "\nsetIsoDate():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setIsoDate(2012, 2, 6); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setIsoDate(2012, 2, 6); +dump($v, $z, $x); + +echo "\nsetTimestamp():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTimestamp(2012234222); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTimestamp(2012234222); +dump($v, $z, $x); +?> +--EXPECT-- +modify(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-29 16:24:08 Europe/London +orig:2012-12-29 16:24:08 Europe/London +copy:2012-12-29 16:24:08 Europe/London +changed: 2012-12-29 16:24:08 Europe/London + +add(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-29 16:24:10 Europe/London +orig:2012-12-29 16:24:10 Europe/London +copy:2012-12-29 16:24:10 Europe/London +changed: 2012-12-29 16:24:10 Europe/London + +sub(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-25 16:24:06 Europe/London +orig:2012-12-25 16:24:06 Europe/London +copy:2012-12-25 16:24:06 Europe/London +changed: 2012-12-25 16:24:06 Europe/London + +setTimezone(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-28 01:24:08 Asia/Tokyo +orig:2012-12-28 01:24:08 Asia/Tokyo +copy:2012-12-28 01:24:08 Asia/Tokyo +changed: 2012-12-28 01:24:08 Asia/Tokyo +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-28 01:24:08 Asia/Tokyo + +setTime(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-27 05:07:19 Europe/London +orig:2012-12-27 05:07:19 Europe/London +copy:2012-12-27 05:07:19 Europe/London +changed: 2012-12-27 05:07:19 Europe/London + +setDate(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 0005-07-19 16:24:08 Europe/London +orig:0005-07-19 16:24:08 Europe/London +copy:0005-07-19 16:24:08 Europe/London +changed: 0005-07-19 16:24:08 Europe/London + +setIsoDate(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-01-14 16:24:08 Europe/London +orig:2012-01-14 16:24:08 Europe/London +copy:2012-01-14 16:24:08 Europe/London +changed: 2
[PHP-CVS] com php-src: Added a few missing TSRMLS_DC/TSRMLS_CC.: ext/date/php_date.c
Commit:99e7d1dca2f7e6cd05a955a42c38792a694cc836 Author:Derick Rethans Mon, 17 Dec 2012 16:49:00 + Parents: 21d7efef922956a233cc2bfdfba139a88fdc6c4f Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=99e7d1dca2f7e6cd05a955a42c38792a694cc836 Log: Added a few missing TSRMLS_DC/TSRMLS_CC. Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 61f6a95..3fbdaf2 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2883,7 +2883,7 @@ PHP_FUNCTION(date_format) } /* }}} */ -static void php_date_modify(zval *object, char *modify, int modify_len, zval *return_value) +static void php_date_modify(zval *object, char *modify, int modify_len, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; timelib_time *tmp_time; @@ -2952,7 +2952,7 @@ PHP_FUNCTION(date_modify) RETURN_FALSE; } - php_date_modify(object, modify, modify_len, return_value); + php_date_modify(object, modify, modify_len, return_value TSRMLS_CC); RETURN_ZVAL(getThis(), 1, 0); } @@ -2971,13 +2971,13 @@ PHP_METHOD(DateTimePoint, modify) } new_object = date_clone_point(object); - php_date_modify(new_object, modify, modify_len, return_value); + php_date_modify(new_object, modify, modify_len, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } /* }}} */ -static void php_date_add(zval *object, zval *interval, zval *return_value) +static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; php_interval_obj *intobj; @@ -3021,7 +3021,7 @@ PHP_FUNCTION(date_add) RETURN_FALSE; } - php_date_add(object, interval, return_value); + php_date_add(object, interval, return_value TSRMLS_CC); RETURN_ZVAL(object, 1, 0); } @@ -3038,13 +3038,13 @@ PHP_METHOD(DateTimePoint, add) } new_object = date_clone_point(object); - php_date_add(new_object, interval, return_value); + php_date_add(new_object, interval, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } /* }}} */ -static void php_date_sub(zval *object, zval *interval, zval *return_value) +static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; php_interval_obj *intobj; @@ -3091,7 +3091,7 @@ PHP_FUNCTION(date_sub) RETURN_FALSE; } - php_date_sub(object, interval, return_value); + php_date_sub(object, interval, return_value TSRMLS_CC); RETURN_ZVAL(object, 1, 0); } @@ -3108,7 +3108,7 @@ PHP_METHOD(DateTimePoint, sub) } new_object = date_clone_point(object); - php_date_sub(new_object, interval, return_value); + php_date_sub(new_object, interval, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Added another test to test the unmodified inherited methods.: ext/date/tests/date_time_point-inherited.phpt
Commit:0f679b926cb39f642ca051cb3ae6d7ab55db21fc Author:Derick Rethans Mon, 17 Dec 2012 16:49:25 + Parents: 99e7d1dca2f7e6cd05a955a42c38792a694cc836 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0f679b926cb39f642ca051cb3ae6d7ab55db21fc Log: Added another test to test the unmodified inherited methods. Changed paths: A ext/date/tests/date_time_point-inherited.phpt Diff: diff --git a/ext/date/tests/date_time_point-inherited.phpt b/ext/date/tests/date_time_point-inherited.phpt new file mode 100644 index 000..e355407 --- /dev/null +++ b/ext/date/tests/date_time_point-inherited.phpt @@ -0,0 +1,25 @@ +--TEST-- +Tests for DateTimePoint. +--INI-- +date.timezone=Europe/London +--FILE-- +getTimezone(); +var_dump($x->getName()); + +echo "\ngetTimestamp():\n"; +$v = date_create_point($current); +$x = $v->getTimestamp(); +var_dump($x); +?> +--EXPECT-- +getTimezone(): +string(13) "Europe/London" + +getTimestamp(): +int(1356625448) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Rename DateTimePoint to DateTimeImmutable.: ext/date/php_date.c ext/date/php_date.h ext/date/tests/date_time_immutable-inherited.phpt ext/date/tests/date_time_immutable.phpt ext
Commit:8b9d23c0cfcdfaa39f0a7d097cc471143cd4f4d2 Author:Derick Rethans Wed, 19 Dec 2012 16:24:38 + Parents: 0f679b926cb39f642ca051cb3ae6d7ab55db21fc Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8b9d23c0cfcdfaa39f0a7d097cc471143cd4f4d2 Log: Rename DateTimePoint to DateTimeImmutable. Changed paths: M ext/date/php_date.c M ext/date/php_date.h A ext/date/tests/date_time_immutable-inherited.phpt A ext/date/tests/date_time_immutable.phpt D ext/date/tests/date_time_point-inherited.phpt D ext/date/tests/date_time_point.phpt diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 3fbdaf2..596a7a9 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -385,9 +385,9 @@ const zend_function_entry date_functions[] = { /* Advanced Interface */ PHP_FE(date_create, arginfo_date_create) - PHP_FE(date_create_point, arginfo_date_create) + PHP_FE(date_create_immutable, arginfo_date_create) PHP_FE(date_create_from_format, arginfo_date_create_from_format) - PHP_FE(date_create_point_from_format, arginfo_date_create_from_format) + PHP_FE(date_create_immutable_from_format, arginfo_date_create_from_format) PHP_FE(date_parse, arginfo_date_parse) PHP_FE(date_parse_from_format, arginfo_date_parse_from_format) PHP_FE(date_get_last_errors, arginfo_date_get_last_errors) @@ -452,17 +452,17 @@ const zend_function_entry date_funcs_date[] = { PHP_FE_END }; -const zend_function_entry date_funcs_point[] = { - PHP_ME(DateTimePoint, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(DateTimePoint, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(DateTimePoint, modify,arginfo_date_method_modify, 0) - PHP_ME(DateTimePoint, add, arginfo_date_method_add, 0) - PHP_ME(DateTimePoint, sub, arginfo_date_method_sub, 0) - PHP_ME(DateTimePoint, setTimezone, arginfo_date_method_timezone_set, 0) - PHP_ME(DateTimePoint, setTime, arginfo_date_method_time_set, 0) - PHP_ME(DateTimePoint, setDate, arginfo_date_method_date_set, 0) - PHP_ME(DateTimePoint, setISODate,arginfo_date_method_isodate_set, 0) - PHP_ME(DateTimePoint, setTimestamp, arginfo_date_method_timestamp_set, 0) +const zend_function_entry date_funcs_immutable[] = { + PHP_ME(DateTimeImmutable, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(DateTimeImmutable, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + 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) + PHP_ME(DateTimeImmutable, setTimezone, arginfo_date_method_timezone_set, 0) + PHP_ME(DateTimeImmutable, setTime, arginfo_date_method_time_set, 0) + PHP_ME(DateTimeImmutable, setDate, arginfo_date_method_date_set, 0) + PHP_ME(DateTimeImmutable, setISODate, arginfo_date_method_isodate_set, 0) + PHP_ME(DateTimeImmutable, setTimestamp, arginfo_date_method_timestamp_set, 0) PHP_FE_END }; @@ -524,7 +524,7 @@ PHP_INI_END() /* }}} */ zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, *date_ce_period; -zend_class_entry *date_ce_point; +zend_class_entry *date_ce_immutable; PHPAPI zend_class_entry *php_date_get_date_ce(void) @@ -532,9 +532,9 @@ PHPAPI zend_class_entry *php_date_get_date_ce(void) return date_ce_date; } -PHPAPI zend_class_entry *php_date_get_point_ce(void) +PHPAPI zend_class_entry *php_date_get_immutable_ce(void) { - return date_ce_point; + return date_ce_immutable; } PHPAPI zend_class_entry *php_date_get_timezone_ce(void) @@ -543,7 +543,7 @@ PHPAPI zend_class_entry *php_date_get_timezone_ce(void) } static zend_object_handlers date_object_handlers_date; -static zend_object_handlers date_object_handlers_point; +static zend_object_handlers date_object_handlers_immutable; static zend_object_handlers date_object_handlers_timezone; static zend_object_handlers date_object_handlers_interval; static zend_object_handlers date_object_handlers_period; @@ -578,13 +578,13 @@ static void date_object_free_storage_interval(void *object TSRMLS_DC); static void date_object_free_storage_period(void *object TSRMLS_DC); static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC); -static zend_object_value date_object_new_point(zend_class_entry *class_type TSRMLS_DC); +static zend_object_value date_object_new_immutable(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_interval(zend_class_entry *class_type TSRMLS_DC); static
[PHP-CVS] com php-src: Fixed crash bug when the non-OO interface was used.: ext/date/php_date.c
Commit:793b52b576e7af8823ae24622c6a331fd473e149 Author:Derick Rethans Wed, 19 Dec 2012 17:40:14 + Parents: 8b9d23c0cfcdfaa39f0a7d097cc471143cd4f4d2 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=793b52b576e7af8823ae24622c6a331fd473e149 Log: Fixed crash bug when the non-OO interface was used. Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 596a7a9..fc281ce 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2954,7 +2954,7 @@ PHP_FUNCTION(date_modify) php_date_modify(object, modify, modify_len, return_value TSRMLS_CC); - RETURN_ZVAL(getThis(), 1, 0); + RETURN_ZVAL(object, 1, 0); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Make DatePeriod support DateTimeImmutable as well.: ext/date/php_date.c ext/date/php_date.h ext/date/tests/date_period-immutable.phpt
Commit:62129f31a758e86f62410262bb6096f1b2584363 Author:Derick Rethans Thu, 20 Dec 2012 13:22:18 + Parents: 793b52b576e7af8823ae24622c6a331fd473e149 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=62129f31a758e86f62410262bb6096f1b2584363 Log: Make DatePeriod support DateTimeImmutable as well. If the start element is a DateTimeImmutable object, then all returned objects are also DateTimeImmutable objects. If the start element is a DateTime object, then all returned objects are DateTime objects. Changed paths: M ext/date/php_date.c M ext/date/php_date.h A ext/date/tests/date_period-immutable.phpt Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index fc281ce..cc83130 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1847,7 +1847,7 @@ static void date_period_it_current_data(zend_object_iterator *iter, zval ***data /* Create new object */ MAKE_STD_ZVAL(iterator->current); - php_date_instantiate(date_ce_date, iterator->current TSRMLS_CC); + php_date_instantiate(object->start_ce, iterator->current TSRMLS_CC); newdateobj = (php_date_obj *) zend_object_store_get_object(iterator->current TSRMLS_CC); newdateobj->time = timelib_time_ctor(); *newdateobj->time = *it_time; @@ -4182,6 +4182,7 @@ PHP_METHOD(DatePeriod, __construct) if (dpobj->end) { timelib_update_ts(dpobj->end, NULL); } + dpobj->start_ce = date_ce_date; } else { /* init */ intobj = (php_interval_obj *) zend_object_store_get_object(interval TSRMLS_CC); @@ -4197,6 +4198,7 @@ PHP_METHOD(DatePeriod, __construct) clone->tz_info = dateobj->time->tz_info; } dpobj->start = clone; + dpobj->start_ce = Z_OBJCE_P(start); /* interval */ dpobj->interval = timelib_rel_time_clone(intobj->diff); diff --git a/ext/date/php_date.h b/ext/date/php_date.h index 19c692b..3af3fa4 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -154,6 +154,7 @@ struct _php_interval_obj { struct _php_period_obj { zend_object std; timelib_time *start; + zend_class_entry *start_ce; timelib_time *current; timelib_time *end; timelib_rel_time *interval; diff --git a/ext/date/tests/date_period-immutable.phpt b/ext/date/tests/date_period-immutable.phpt new file mode 100644 index 000..0ec4b4a --- /dev/null +++ b/ext/date/tests/date_period-immutable.phpt @@ -0,0 +1,56 @@ +--TEST-- +DatePeriod +--FILE-- +format( "l Y-m-d\n" ); +echo $dt->modify( "3 tuesday" )->format( "l Y-m-d\n" ); + echo $dt->format( "l Y-m-d\n\n" ); +} + +foreach ( new DatePeriod( $db2, $di, $de ) as $dt ) +{ + echo get_class( $dt ), "\n"; + echo $dt->format( "l Y-m-d\n" ); +echo $dt->modify( "3 tuesday" )->format( "l Y-m-d\n" ); + echo $dt->format( "l Y-m-d\n\n" ); +} +?> +--EXPECT-- +DateTimeImmutable +Tuesday 2008-01-01 +Tuesday 2008-01-15 +Tuesday 2008-01-01 + +DateTimeImmutable +Friday 2008-02-01 +Tuesday 2008-02-19 +Friday 2008-02-01 + +DateTimeImmutable +Saturday 2008-03-01 +Tuesday 2008-03-18 +Saturday 2008-03-01 + +DateTime +Tuesday 2008-01-01 +Tuesday 2008-01-15 +Tuesday 2008-01-15 + +DateTime +Friday 2008-02-01 +Tuesday 2008-02-19 +Tuesday 2008-02-19 + +DateTime +Saturday 2008-03-01 +Tuesday 2008-03-18 +Tuesday 2008-03-18 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] del php-src: NEWS TSRM/tsrm_nw.c TSRM/tsrm_nw.h TSRM/tsrm_virtual_cwd.c TSRM/tsrm_virtual_cwd.h TSRM/tsrm_win32.c TSRM/tsrm_win32.h Zend/tests/bug63882.phpt Zend/tests/generators/clone_after
Branch: immutable-date Deleted commits count: 7 User: Derick Rethans Sat, 12 Jan 2013 16:42:57 + M NEWS M TSRM/tsrm_nw.c M TSRM/tsrm_nw.h M TSRM/tsrm_virtual_cwd.c M TSRM/tsrm_virtual_cwd.h M TSRM/tsrm_win32.c M TSRM/tsrm_win32.h A Zend/tests/bug63882.phpt A Zend/tests/generators/clone_after_object_call.phpt A Zend/tests/generators/throw_already_closed.phpt A Zend/tests/generators/throw_caught.phpt A Zend/tests/generators/throw_not_an_exception.phpt A Zend/tests/generators/throw_rethrow.phpt A Zend/tests/generators/throw_uncaught.phpt A Zend/tests/generators/yield_closure.phpt M Zend/tests/traits/bug60153.phpt M Zend/tests/traits/bug60217b.phpt M Zend/tests/traits/bug60217c.phpt M Zend/tests/traits/bugs/abstract-methods05.phpt M Zend/tests/traits/bugs/abstract-methods06.phpt M Zend/tests/traits/error_010.phpt M Zend/tests/traits/inheritance003.phpt A Zend/tests/traits/language014.phpt A Zend/tests/traits/language015.phpt A Zend/tests/traits/language016.phpt A Zend/tests/traits/language017.phpt A Zend/tests/traits/language018.phpt A Zend/tests/traits/language019.phpt M Zend/zend.c M Zend/zend.h M Zend/zend_API.c M Zend/zend_API.h M Zend/zend_alloc.c M Zend/zend_alloc.h M Zend/zend_build.h M Zend/zend_builtin_functions.c M Zend/zend_builtin_functions.h M Zend/zend_closures.c M Zend/zend_closures.h M Zend/zend_compile.c M Zend/zend_compile.h M Zend/zend_config.nw.h M Zend/zend_config.w32.h M Zend/zend_constants.c M Zend/zend_constants.h M Zend/zend_default_classes.c M Zend/zend_dynamic_array.c M Zend/zend_dynamic_array.h M Zend/zend_errors.h M Zend/zend_exceptions.c M Zend/zend_exceptions.h M Zend/zend_execute.c M Zend/zend_execute.h M Zend/zend_execute_API.c M Zend/zend_extensions.c M Zend/zend_extensions.h M Zend/zend_float.c M Zend/zend_float.h M Zend/zend_gc.c M Zend/zend_gc.h M Zend/zend_generators.c M Zend/zend_generators.h M Zend/zend_globals.h M Zend/zend_globals_macros.h M Zend/zend_hash.c M Zend/zend_hash.h M Zend/zend_highlight.c M Zend/zend_highlight.h M Zend/zend_indent.c M Zend/zend_indent.h M Zend/zend_ini.c M Zend/zend_ini.h M Zend/zend_ini_parser.y M Zend/zend_ini_scanner.c M Zend/zend_ini_scanner.h M Zend/zend_ini_scanner.l M Zend/zend_interfaces.c M Zend/zend_interfaces.h M Zend/zend_istdiostream.h M Zend/zend_iterators.c M Zend/zend_iterators.h M Zend/zend_language_parser.y M Zend/zend_language_scanner.c M Zend/zend_language_scanner.h M Zend/zend_language_scanner.l M Zend/zend_list.c M Zend/zend_list.h M Zend/zend_llist.c M Zend/zend_llist.h M Zend/zend_modules.h M Zend/zend_multibyte.c M Zend/zend_multibyte.h M Zend/zend_multiply.h M Zend/zend_object_handlers.c M Zend/zend_object_handlers.h M Zend/zend_objects.c M Zend/zend_objects.h M Zend/zend_objects_API.c M Zend/zend_objects_API.h M Zend/zend_opcode.c M Zend/zend_operators.c M Zend/zend_operators.h M Zend/zend_ptr_stack.c M Zend/zend_ptr_stack.h M Zend/zend_qsort.c M Zend/zend_qsort.h M Zend/zend_sprintf.c M Zend/zend_stack.c M Zend/zend_stack.h M Zend/zend_static_allocator.c M Zend/zend_static_allocator.h M Zend/zend_stream.c M Zend/zend_stream.h M Zend/zend_string.c M Zend/zend_string.h M Zend/zend_strtod.h M Zend/zend_ts_hash.c M Zend/zend_ts_hash.h M Zend/zend_types.h M Zend/zend_variables.c M Zend/zend_variables.h M Zend/zend_vm.h M Zend/zend_vm_def.h M Zend/zend_vm_execute.h M Zend/zend_vm_gen.php M Zend/zend_vm_opcodes.h M ext/bcmath/bcmath.c M ext/bcmath/php_bcmath.h M ext/bz2/bz2.c M ext/bz2/bz2_filter.c M ext/bz2/php_bz2.h M ext/calendar/cal_unix.c M ext/calendar/calendar.c M ext/calendar/easter.c M ext/com_dotnet/com_com.c M ext/com_dotnet/com_dotnet.c M ext/com_dotnet/com_extension.c M ext/com_dotnet/com_handlers.c M ext/com_dotnet/com_iterator.c M ext/com_dotnet/com_misc.c M ext/com_dotnet/com_olechar.c M ext/com_dotnet/com_persist.c M ext/com_dotnet/com_saproxy.c M ext/com_dotnet/com_typeinfo.c M ext/com_dotnet/com_variant.c M ext/com_dotnet/com_wrapper.c M ext/com_dotnet/php_com_dotnet.h M ext/com_dotnet/php_com_dotnet_internal.h M ext/ctype/ctype.c M ext/ctype/php_ctype.h M ext/curl/interface.c M ext/curl/multi.c M ext/curl/php_curl.h M ext/curl/share.c M ext/curl/streams.c M ext/curl/tests/bug63363.phpt A ext/curl/tests/bug63795.phpt A ext/curl/tests/curl_multi_segfault.phpt A ext/curl/tests/curl_multi_setopt_basic001.phpt A ext/curl/tests/curl_multi_strerror_001.phpt A ext/curl/tests/curl_share_setopt_basic001.phpt A ext/curl/tests/curl_strerror_001.phpt M ext/date/lib/astro.c M ext/date/lib/dow.c M ext/date/lib
Re: [PHP-CVS] svn: /SVNROOT/ global_avail
On Fri, 11 Jan 2013, Ferenc Kovacs wrote: > just to make sure: did you really wanted to give remi, jorton and vdanen > web karma? > I have never heard or seen anything related to that (maybe they requested > off list?) and they didn't showed any interest in this area. They're on security@, and Rasmus volunteerd them (;-)) to help us to better communicate about security issues. cheers, Derick -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/date/php_date.c
Commit:4ff088d061ed3d4e15d38d0ed3f2fd10346c634c Author:Derick Rethans Sun, 6 Jan 2013 15:07:25 + Parents: 9934efff5fa174b3ae87f3e6295a2fe48f7ebd6f ba35ae32b7e9858e6590a616c4d5c2f0020cc7ab Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4ff088d061ed3d4e15d38d0ed3f2fd10346c634c Log: Merge branch 'PHP-5.4' into PHP-5.5 Changed paths: MM ext/date/php_date.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/date/php_date.c
Commit:ba35ae32b7e9858e6590a616c4d5c2f0020cc7ab Author:Derick Rethans Sun, 6 Jan 2013 15:07:13 + Parents: d7da1aa694a9a29ca7ec772e5d51d96b6dc8dda0 ff9c1b12ff9c9533367d0d6200eb39189ad0124c Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ba35ae32b7e9858e6590a616c4d5c2f0020cc7ab Log: Merge branch 'PHP-5.3' into PHP-5.4 Changed paths: MM ext/date/php_date.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update news with new bug fix.: NEWS
Commit:67c662a0a2615d52215dccc4805e8eb989df7eab Author:Derick Rethans Sun, 6 Jan 2013 15:08:26 + Parents: ff9c1b12ff9c9533367d0d6200eb39189ad0124c Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=67c662a0a2615d52215dccc4805e8eb989df7eab Log: Update news with new bug fix. Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 0b5c207..ee76efb 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,10 @@ PHP NEWS . Fixed bug #55438 (Curlwapper is not sending http header randomly). (php...@lostreality.org, Pierrick) +- Date: + . Fixed bug #55397 (comparsion of incomplete DateTime causes SIGSEGV). +(Laruence, Derick) + 20 Dec 2012, PHP 5.3.20 - Zend Engine: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fixed bug #55397: Comparsion of incomplete DateTime causes SIGSEGV.: ext/date/php_date.c ext/date/tests/bug55397.phpt
Commit:ff9c1b12ff9c9533367d0d6200eb39189ad0124c Author:Derick Rethans Sun, 6 Jan 2013 13:38:22 + Parents: bc11e6fdbbafbd0969fc47fa087c2245317cd31f Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ff9c1b12ff9c9533367d0d6200eb39189ad0124c Log: Fixed bug #55397: Comparsion of incomplete DateTime causes SIGSEGV. Bugs: https://bugs.php.net/55397 Changed paths: M ext/date/php_date.c A ext/date/tests/bug55397.phpt Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 2b4b4b5..2e616b1 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2079,7 +2079,11 @@ static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) { php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC); php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC); - + + if (!o1->time || !o2->time) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime object"); + return 1; + } if (!o1->time->sse_uptodate) { timelib_update_ts(o1->time, o1->time->tz_info); } diff --git a/ext/date/tests/bug55397.phpt b/ext/date/tests/bug55397.phpt new file mode 100644 index 000..efc09b5 --- /dev/null +++ b/ext/date/tests/bug55397.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #55397 (comparsion of incomplete DateTime causes SIGSEGV) +--INI-- +--FILE-- + +--EXPECTF-- +Warning: %s: Trying to compare an incomplete DateTime object in %s on line %d +bool(false) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Make DatePeriod support DateTimeImmutable as well.: ext/date/php_date.c ext/date/php_date.h ext/date/tests/date_period-immutable.phpt
Commit:042ddf371e84fbb7ba1326e7bd45888e63fb30ef Author:Derick Rethans Thu, 20 Dec 2012 13:22:18 + Parents: b1c68330161f7ccf4fdb4786ac1b0b28778d3f55 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=042ddf371e84fbb7ba1326e7bd45888e63fb30ef Log: Make DatePeriod support DateTimeImmutable as well. If the start element is a DateTimeImmutable object, then all returned objects are also DateTimeImmutable objects. If the start element is a DateTime object, then all returned objects are DateTime objects. Changed paths: M ext/date/php_date.c M ext/date/php_date.h A ext/date/tests/date_period-immutable.phpt Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 08a473d..d60cc42 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1820,7 +1820,7 @@ static void date_period_it_current_data(zend_object_iterator *iter, zval ***data /* Create new object */ MAKE_STD_ZVAL(iterator->current); - php_date_instantiate(date_ce_date, iterator->current TSRMLS_CC); + php_date_instantiate(object->start_ce, iterator->current TSRMLS_CC); newdateobj = (php_date_obj *) zend_object_store_get_object(iterator->current TSRMLS_CC); newdateobj->time = timelib_time_ctor(); *newdateobj->time = *it_time; @@ -4151,6 +4151,7 @@ PHP_METHOD(DatePeriod, __construct) if (dpobj->end) { timelib_update_ts(dpobj->end, NULL); } + dpobj->start_ce = date_ce_date; } else { /* init */ intobj = (php_interval_obj *) zend_object_store_get_object(interval TSRMLS_CC); @@ -4166,6 +4167,7 @@ PHP_METHOD(DatePeriod, __construct) clone->tz_info = dateobj->time->tz_info; } dpobj->start = clone; + dpobj->start_ce = Z_OBJCE_P(start); /* interval */ dpobj->interval = timelib_rel_time_clone(intobj->diff); diff --git a/ext/date/php_date.h b/ext/date/php_date.h index fb12dbc..8c4ca00 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -154,6 +154,7 @@ struct _php_interval_obj { struct _php_period_obj { zend_object std; timelib_time *start; + zend_class_entry *start_ce; timelib_time *current; timelib_time *end; timelib_rel_time *interval; diff --git a/ext/date/tests/date_period-immutable.phpt b/ext/date/tests/date_period-immutable.phpt new file mode 100644 index 000..0ec4b4a --- /dev/null +++ b/ext/date/tests/date_period-immutable.phpt @@ -0,0 +1,56 @@ +--TEST-- +DatePeriod +--FILE-- +format( "l Y-m-d\n" ); +echo $dt->modify( "3 tuesday" )->format( "l Y-m-d\n" ); + echo $dt->format( "l Y-m-d\n\n" ); +} + +foreach ( new DatePeriod( $db2, $di, $de ) as $dt ) +{ + echo get_class( $dt ), "\n"; + echo $dt->format( "l Y-m-d\n" ); +echo $dt->modify( "3 tuesday" )->format( "l Y-m-d\n" ); + echo $dt->format( "l Y-m-d\n\n" ); +} +?> +--EXPECT-- +DateTimeImmutable +Tuesday 2008-01-01 +Tuesday 2008-01-15 +Tuesday 2008-01-01 + +DateTimeImmutable +Friday 2008-02-01 +Tuesday 2008-02-19 +Friday 2008-02-01 + +DateTimeImmutable +Saturday 2008-03-01 +Tuesday 2008-03-18 +Saturday 2008-03-01 + +DateTime +Tuesday 2008-01-01 +Tuesday 2008-01-15 +Tuesday 2008-01-15 + +DateTime +Friday 2008-02-01 +Tuesday 2008-02-19 +Tuesday 2008-02-19 + +DateTime +Saturday 2008-03-01 +Tuesday 2008-03-18 +Tuesday 2008-03-18 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Added a test case for DateTimePoint.: ext/date/tests/date_time_point.phpt
Commit:7c74531e884aaa0a0bf6db76adb0e203cdb81c02 Author:Derick Rethans Mon, 17 Dec 2012 16:35:52 + Parents: d4acb579df4c78acaaff3e90698277e62aac Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7c74531e884aaa0a0bf6db76adb0e203cdb81c02 Log: Added a test case for DateTimePoint. Changed paths: A ext/date/tests/date_time_point.phpt Diff: diff --git a/ext/date/tests/date_time_point.phpt b/ext/date/tests/date_time_point.phpt new file mode 100644 index 000..810eeca --- /dev/null +++ b/ext/date/tests/date_time_point.phpt @@ -0,0 +1,167 @@ +--TEST-- +Tests for DateTimePoint. +--INI-- +date.timezone=Europe/London +--FILE-- +format('Y-m-d H:i:s e'), "\n"; + echo 'copy:', $b->format('Y-m-d H:i:s e'), "\n"; + echo 'changed: ', $c->format('Y-m-d H:i:s e'), "\n"; +} + +echo "modify():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->modify("+2 days"); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->modify("+2 days"); +dump($v, $z, $x); + +echo "\nadd():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->add(new DateInterval("P2DT2S")); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->add(new DateInterval("P2DT2S")); +dump($v, $z, $x); + +echo "\nsub():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->sub(new DateInterval("P2DT2S")); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->sub(new DateInterval("P2DT2S")); +dump($v, $z, $x); + +echo "\nsetTimezone():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); +$v = new DateTimePoint($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); + +echo "\nsetTime():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTime(5, 7, 19); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTime(5, 7, 19); +dump($v, $z, $x); + +echo "\nsetDate():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setDate(5, 7, 19); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setDate(5, 7, 19); +dump($v, $z, $x); + +echo "\nsetIsoDate():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setIsoDate(2012, 2, 6); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setIsoDate(2012, 2, 6); +dump($v, $z, $x); + +echo "\nsetTimestamp():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTimestamp(2012234222); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTimestamp(2012234222); +dump($v, $z, $x); +?> +--EXPECT-- +modify(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-29 16:24:08 Europe/London +orig:2012-12-29 16:24:08 Europe/London +copy:2012-12-29 16:24:08 Europe/London +changed: 2012-12-29 16:24:08 Europe/London + +add(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-29 16:24:10 Europe/London +orig:2012-12-29 16:24:10 Europe/London +copy:2012-12-29 16:24:10 Europe/London +changed: 2012-12-29 16:24:10 Europe/London + +sub(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-25 16:24:06 Europe/London +orig:2012-12-25 16:24:06 Europe/London +copy:2012-12-25 16:24:06 Europe/London +changed: 2012-12-25 16:24:06 Europe/London + +setTimezone(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-28 01:24:08 Asia/Tokyo +orig:2012-12-28 01:24:08 Asia/Tokyo +copy:2012-12-28 01:24:08 Asia/Tokyo +changed: 2012-12-28 01:24:08 Asia/Tokyo +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-28 01:24:08 Asia/Tokyo + +setTime(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-27 05:07:19 Europe/London +orig:2012-12-27 05:07:19 Europe/London +copy:2012-12-27 05:07:19 Europe/London +changed: 2012-12-27 05:07:19 Europe/London + +setDate(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 0005-07-19 16:24:08 Europe/London +orig:0005-07-19 16:24:08 Europe/London +copy:0005-07-19 16:24:08 Europe/London +changed: 0005-07-19 16:24:08 Europe/London + +setIsoDate(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-01-14 16:24:08 Europe/London +orig:2012-01-14 16:24:08 Europe/London +copy:2012-01-14 16:24:08 Europe/London +changed: 2
[PHP-CVS] com php-src: Added a few missing TSRMLS_DC/TSRMLS_CC.: ext/date/php_date.c
Commit:11718f7447349e7a4191a3473fc3a2738948d18c Author:Derick Rethans Mon, 17 Dec 2012 16:49:00 + Parents: 7c74531e884aaa0a0bf6db76adb0e203cdb81c02 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=11718f7447349e7a4191a3473fc3a2738948d18c Log: Added a few missing TSRMLS_DC/TSRMLS_CC. Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 2d3ba8e..d028c30 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2852,7 +2852,7 @@ PHP_FUNCTION(date_format) } /* }}} */ -static void php_date_modify(zval *object, char *modify, int modify_len, zval *return_value) +static void php_date_modify(zval *object, char *modify, int modify_len, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; timelib_time *tmp_time; @@ -2921,7 +2921,7 @@ PHP_FUNCTION(date_modify) RETURN_FALSE; } - php_date_modify(object, modify, modify_len, return_value); + php_date_modify(object, modify, modify_len, return_value TSRMLS_CC); RETURN_ZVAL(getThis(), 1, 0); } @@ -2940,13 +2940,13 @@ PHP_METHOD(DateTimePoint, modify) } new_object = date_clone_point(object); - php_date_modify(new_object, modify, modify_len, return_value); + php_date_modify(new_object, modify, modify_len, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } /* }}} */ -static void php_date_add(zval *object, zval *interval, zval *return_value) +static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; php_interval_obj *intobj; @@ -2990,7 +2990,7 @@ PHP_FUNCTION(date_add) RETURN_FALSE; } - php_date_add(object, interval, return_value); + php_date_add(object, interval, return_value TSRMLS_CC); RETURN_ZVAL(object, 1, 0); } @@ -3007,13 +3007,13 @@ PHP_METHOD(DateTimePoint, add) } new_object = date_clone_point(object); - php_date_add(new_object, interval, return_value); + php_date_add(new_object, interval, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } /* }}} */ -static void php_date_sub(zval *object, zval *interval, zval *return_value) +static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; php_interval_obj *intobj; @@ -3060,7 +3060,7 @@ PHP_FUNCTION(date_sub) RETURN_FALSE; } - php_date_sub(object, interval, return_value); + php_date_sub(object, interval, return_value TSRMLS_CC); RETURN_ZVAL(object, 1, 0); } @@ -3077,7 +3077,7 @@ PHP_METHOD(DateTimePoint, sub) } new_object = date_clone_point(object); - php_date_sub(new_object, interval, return_value); + php_date_sub(new_object, interval, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Added another test to test the unmodified inherited methods.: ext/date/tests/date_time_point-inherited.phpt
Commit:c69921f76e738b8512b91a198e9c4a144f462a11 Author:Derick Rethans Mon, 17 Dec 2012 16:49:25 + Parents: 11718f7447349e7a4191a3473fc3a2738948d18c Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c69921f76e738b8512b91a198e9c4a144f462a11 Log: Added another test to test the unmodified inherited methods. Changed paths: A ext/date/tests/date_time_point-inherited.phpt Diff: diff --git a/ext/date/tests/date_time_point-inherited.phpt b/ext/date/tests/date_time_point-inherited.phpt new file mode 100644 index 000..e355407 --- /dev/null +++ b/ext/date/tests/date_time_point-inherited.phpt @@ -0,0 +1,25 @@ +--TEST-- +Tests for DateTimePoint. +--INI-- +date.timezone=Europe/London +--FILE-- +getTimezone(); +var_dump($x->getName()); + +echo "\ngetTimestamp():\n"; +$v = date_create_point($current); +$x = $v->getTimestamp(); +var_dump($x); +?> +--EXPECT-- +getTimezone(): +string(13) "Europe/London" + +getTimestamp(): +int(1356625448) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Rename DateTimePoint to DateTimeImmutable.: ext/date/php_date.c ext/date/php_date.h ext/date/tests/date_time_immutable-inherited.phpt ext/date/tests/date_time_immutable.phpt ext
Commit:6b48ae4580a0e97f7df4f1733eca345755110b96 Author:Derick Rethans Wed, 19 Dec 2012 16:24:38 + Parents: c69921f76e738b8512b91a198e9c4a144f462a11 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6b48ae4580a0e97f7df4f1733eca345755110b96 Log: Rename DateTimePoint to DateTimeImmutable. Changed paths: M ext/date/php_date.c M ext/date/php_date.h A ext/date/tests/date_time_immutable-inherited.phpt A ext/date/tests/date_time_immutable.phpt D ext/date/tests/date_time_point-inherited.phpt D ext/date/tests/date_time_point.phpt diff --git a/ext/date/php_date.c b/ext/date/php_date.c index d028c30..db0bbe8 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -385,9 +385,9 @@ const zend_function_entry date_functions[] = { /* Advanced Interface */ PHP_FE(date_create, arginfo_date_create) - PHP_FE(date_create_point, arginfo_date_create) + PHP_FE(date_create_immutable, arginfo_date_create) PHP_FE(date_create_from_format, arginfo_date_create_from_format) - PHP_FE(date_create_point_from_format, arginfo_date_create_from_format) + PHP_FE(date_create_immutable_from_format, arginfo_date_create_from_format) PHP_FE(date_parse, arginfo_date_parse) PHP_FE(date_parse_from_format, arginfo_date_parse_from_format) PHP_FE(date_get_last_errors, arginfo_date_get_last_errors) @@ -452,17 +452,17 @@ const zend_function_entry date_funcs_date[] = { PHP_FE_END }; -const zend_function_entry date_funcs_point[] = { - PHP_ME(DateTimePoint, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) - PHP_ME(DateTimePoint, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) - PHP_ME(DateTimePoint, modify,arginfo_date_method_modify, 0) - PHP_ME(DateTimePoint, add, arginfo_date_method_add, 0) - PHP_ME(DateTimePoint, sub, arginfo_date_method_sub, 0) - PHP_ME(DateTimePoint, setTimezone, arginfo_date_method_timezone_set, 0) - PHP_ME(DateTimePoint, setTime, arginfo_date_method_time_set, 0) - PHP_ME(DateTimePoint, setDate, arginfo_date_method_date_set, 0) - PHP_ME(DateTimePoint, setISODate,arginfo_date_method_isodate_set, 0) - PHP_ME(DateTimePoint, setTimestamp, arginfo_date_method_timestamp_set, 0) +const zend_function_entry date_funcs_immutable[] = { + PHP_ME(DateTimeImmutable, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(DateTimeImmutable, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + 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) + PHP_ME(DateTimeImmutable, setTimezone, arginfo_date_method_timezone_set, 0) + PHP_ME(DateTimeImmutable, setTime, arginfo_date_method_time_set, 0) + PHP_ME(DateTimeImmutable, setDate, arginfo_date_method_date_set, 0) + PHP_ME(DateTimeImmutable, setISODate, arginfo_date_method_isodate_set, 0) + PHP_ME(DateTimeImmutable, setTimestamp, arginfo_date_method_timestamp_set, 0) PHP_FE_END }; @@ -522,7 +522,7 @@ PHP_INI_END() /* }}} */ zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, *date_ce_period; -zend_class_entry *date_ce_point; +zend_class_entry *date_ce_immutable; PHPAPI zend_class_entry *php_date_get_date_ce(void) @@ -530,9 +530,9 @@ PHPAPI zend_class_entry *php_date_get_date_ce(void) return date_ce_date; } -PHPAPI zend_class_entry *php_date_get_point_ce(void) +PHPAPI zend_class_entry *php_date_get_immutable_ce(void) { - return date_ce_point; + return date_ce_immutable; } PHPAPI zend_class_entry *php_date_get_timezone_ce(void) @@ -541,7 +541,7 @@ PHPAPI zend_class_entry *php_date_get_timezone_ce(void) } static zend_object_handlers date_object_handlers_date; -static zend_object_handlers date_object_handlers_point; +static zend_object_handlers date_object_handlers_immutable; static zend_object_handlers date_object_handlers_timezone; static zend_object_handlers date_object_handlers_interval; static zend_object_handlers date_object_handlers_period; @@ -576,13 +576,13 @@ static void date_object_free_storage_interval(void *object TSRMLS_DC); static void date_object_free_storage_period(void *object TSRMLS_DC); static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC); -static zend_object_value date_object_new_point(zend_class_entry *class_type TSRMLS_DC); +static zend_object_value date_object_new_immutable(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_interval(zend_class_entry *class_type TSRMLS_DC); static
[PHP-CVS] com php-src: Implemented immutable DateTime objects as the DateTimePoint class.: ext/date/php_date.c ext/date/php_date.h
Commit:d4acb579df4c78acaaff3e90698277e62aac Author:Derick Rethans Mon, 17 Dec 2012 15:31:23 + Parents: 1ee8c3d9a25b88d4a075f78377188ad71f5b2e84 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d4acb579df4c78acaaff3e90698277e62aac Log: Implemented immutable DateTime objects as the DateTimePoint class. Changed paths: M ext/date/php_date.c M ext/date/php_date.h diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 1b07404..2d3ba8e 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -385,7 +385,9 @@ const zend_function_entry date_functions[] = { /* Advanced Interface */ PHP_FE(date_create, arginfo_date_create) + PHP_FE(date_create_point, arginfo_date_create) PHP_FE(date_create_from_format, arginfo_date_create_from_format) + PHP_FE(date_create_point_from_format, arginfo_date_create_from_format) PHP_FE(date_parse, arginfo_date_parse) PHP_FE(date_parse_from_format, arginfo_date_parse_from_format) PHP_FE(date_get_last_errors, arginfo_date_get_last_errors) @@ -450,6 +452,20 @@ const zend_function_entry date_funcs_date[] = { PHP_FE_END }; +const zend_function_entry date_funcs_point[] = { + PHP_ME(DateTimePoint, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(DateTimePoint, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(DateTimePoint, modify,arginfo_date_method_modify, 0) + PHP_ME(DateTimePoint, add, arginfo_date_method_add, 0) + PHP_ME(DateTimePoint, sub, arginfo_date_method_sub, 0) + PHP_ME(DateTimePoint, setTimezone, arginfo_date_method_timezone_set, 0) + PHP_ME(DateTimePoint, setTime, arginfo_date_method_time_set, 0) + PHP_ME(DateTimePoint, setDate, arginfo_date_method_date_set, 0) + PHP_ME(DateTimePoint, setISODate,arginfo_date_method_isodate_set, 0) + PHP_ME(DateTimePoint, setTimestamp, arginfo_date_method_timestamp_set, 0) + PHP_FE_END +}; + const zend_function_entry date_funcs_timezone[] = { PHP_ME(DateTimeZone, __construct, arginfo_timezone_open, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) PHP_ME_MAPPING(getName, timezone_name_get, arginfo_timezone_method_name_get, 0) @@ -506,6 +522,7 @@ PHP_INI_END() /* }}} */ zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, *date_ce_period; +zend_class_entry *date_ce_point; PHPAPI zend_class_entry *php_date_get_date_ce(void) @@ -513,12 +530,18 @@ PHPAPI zend_class_entry *php_date_get_date_ce(void) return date_ce_date; } +PHPAPI zend_class_entry *php_date_get_point_ce(void) +{ + return date_ce_point; +} + PHPAPI zend_class_entry *php_date_get_timezone_ce(void) { return date_ce_timezone; } static zend_object_handlers date_object_handlers_date; +static zend_object_handlers date_object_handlers_point; static zend_object_handlers date_object_handlers_timezone; static zend_object_handlers date_object_handlers_interval; static zend_object_handlers date_object_handlers_period; @@ -553,11 +576,13 @@ static void date_object_free_storage_interval(void *object TSRMLS_DC); static void date_object_free_storage_period(void *object TSRMLS_DC); static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC); +static zend_object_value date_object_new_point(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_interval(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_period(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC); +static zend_object_value date_object_clone_point(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_interval(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_period(zval *this_ptr TSRMLS_DC); @@ -1881,7 +1906,7 @@ 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_timezone, ce_interval, ce_period; + zend_class_entry ce_date, ce_point, ce_timezone, ce_interval, ce_period; INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date); ce_date.create_object = date_object_new_date; @@ -1907,6 +1932,13 @@ static void date_register_classes(TSRMLS_D) REGISTER_DATE_CLASS_CONST_STRING("RSS", DATE_FORMAT_RFC1123); REGISTER_DATE_CLASS_CONST_STRING("W3C", DATE_FORMAT_RFC3339); + INIT_CLASS_ENTRY(ce_point, "DateTimePoint", date_funcs_point); + ce_po
[PHP-CVS] com php-src: Fixed crash bug when the non-OO interface was used.: ext/date/php_date.c
Commit:b1c68330161f7ccf4fdb4786ac1b0b28778d3f55 Author:Derick Rethans Wed, 19 Dec 2012 17:40:14 + Parents: 6b48ae4580a0e97f7df4f1733eca345755110b96 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b1c68330161f7ccf4fdb4786ac1b0b28778d3f55 Log: Fixed crash bug when the non-OO interface was used. Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index db0bbe8..08a473d 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2923,7 +2923,7 @@ PHP_FUNCTION(date_modify) php_date_modify(object, modify, modify_len, return_value TSRMLS_CC); - RETURN_ZVAL(getThis(), 1, 0); + RETURN_ZVAL(object, 1, 0); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] del php-src: .gitignore Makefile.frag Makefile.global NEWS UPGRADING Zend/Makefile.am Zend/tests/bug63635.phpt Zend/tests/bug63741.phpt Zend/tests/bug63762.phpt Zend/tests/catch_finally_006.
Branch: immutable-date Deleted commits count: 4 User: Derick Rethans Wed, 19 Dec 2012 17:56:08 + Changed paths: M .gitignore M Makefile.frag M Makefile.global M NEWS M UPGRADING M Zend/Makefile.am A Zend/tests/bug63635.phpt A Zend/tests/bug63741.phpt A Zend/tests/bug63762.phpt M Zend/tests/catch_finally_006.phpt A Zend/tests/generators/bug63066.phpt A Zend/tests/generators/finally/finally_ran_on_close.phpt A Zend/tests/generators/finally/return_return.phpt A Zend/tests/generators/finally/return_yield.phpt A Zend/tests/generators/finally/throw_yield.phpt A Zend/tests/generators/finally/yield_return.phpt A Zend/tests/generators/finally/yield_throw.phpt A Zend/tests/generators/finally/yield_yield.phpt D Zend/tests/generators/finally_ran_on_close.phpt D Zend/tests/generators/finally_uninterrupted.phpt D Zend/tests/generators/finally_with_return.phpt A Zend/tests/generators/ignored_send_leak.phpt M Zend/tests/try_catch_finally_003.phpt A Zend/tests/try_finally_010.phpt M Zend/zend.c M Zend/zend.h M Zend/zend_API.c M Zend/zend_compile.c M Zend/zend_compile.h M Zend/zend_dtrace.c M Zend/zend_dtrace.h M Zend/zend_exceptions.c M Zend/zend_execute.c M Zend/zend_execute.h M Zend/zend_execute_API.c M Zend/zend_extensions.h M Zend/zend_gc.c M Zend/zend_generators.c M Zend/zend_generators.h M Zend/zend_globals.h M Zend/zend_ini_scanner.c M Zend/zend_ini_scanner_defs.h M Zend/zend_language_parser.y M Zend/zend_language_scanner.c M Zend/zend_language_scanner_defs.h M Zend/zend_modules.h M Zend/zend_object_handlers.c M Zend/zend_opcode.c M Zend/zend_ptr_stack.c M Zend/zend_ptr_stack.h M Zend/zend_vm_def.h M Zend/zend_vm_execute.h M Zend/zend_vm_execute.skl M Zend/zend_vm_gen.php M Zend/zend_vm_opcodes.h M acinclude.m4 M ext/date/lib/parse_date.c M ext/date/lib/parse_iso_intervals.c M ext/date/php_date.c M ext/date/php_date.h M ext/date/tests/bug45554.phpt A ext/date/tests/bug63435.phpt A ext/date/tests/date_time_immutable-inherited.phpt A ext/date/tests/date_time_immutable.phpt D ext/date/tests/date_time_point-inherited.phpt D ext/date/tests/date_time_point.phpt M ext/dba/libinifile/inifile.c M ext/fileinfo/libmagic.patch M ext/fileinfo/libmagic/apprentice.c D ext/fileinfo/tests/finfo_file_regex-win32.phpt M ext/fileinfo/tests/finfo_file_regex.phpt D ext/fileinfo/tests/finfo_open_error-win32.phpt M ext/fileinfo/tests/finfo_open_error.phpt M ext/imap/php_imap.c A ext/imap/tests/bug63126.phpt M ext/json/config.m4 M ext/json/config.w32 M ext/json/json.c A ext/json/tests/bug63737.phpt D ext/json/utf8_to_utf16.c D ext/json/utf8_to_utf16.h M ext/libxml/libxml.c M ext/mysql/php_mysql.c M ext/mysql/tests/001.phpt M ext/mysql/tests/002.phpt M ext/mysql/tests/003.phpt M ext/mysql/tests/bug47438.phpt M ext/mysql/tests/bug48754.phpt M ext/mysql/tests/bug51242.phpt M ext/mysql/tests/bug53649.phpt M ext/mysql/tests/bug55473.phpt M ext/mysql/tests/mysql_affected_rows.phpt M ext/mysql/tests/mysql_client_encoding.phpt M ext/mysql/tests/mysql_close.phpt M ext/mysql/tests/mysql_connect.phpt M ext/mysql/tests/mysql_constants.phpt M ext/mysql/tests/mysql_create_db.phpt M ext/mysql/tests/mysql_data_seek.phpt M ext/mysql/tests/mysql_db_name.phpt M ext/mysql/tests/mysql_db_query.phpt M ext/mysql/tests/mysql_deprecated_api.phpt M ext/mysql/tests/mysql_drop_db.phpt M ext/mysql/tests/mysql_errno.phpt M ext/mysql/tests/mysql_error.phpt M ext/mysql/tests/mysql_fetch_array.phpt M ext/mysql/tests/mysql_fetch_assoc.phpt M ext/mysql/tests/mysql_fetch_field.phpt M ext/mysql/tests/mysql_fetch_lengths.phpt M ext/mysql/tests/mysql_fetch_object.phpt M ext/mysql/tests/mysql_fetch_row.phpt M ext/mysql/tests/mysql_field_flags.phpt M ext/mysql/tests/mysql_field_len.phpt M ext/mysql/tests/mysql_field_name.phpt M ext/mysql/tests/mysql_field_seek.phpt M ext/mysql/tests/mysql_field_table.phpt M ext/mysql/tests/mysql_field_type.phpt M ext/mysql/tests/mysql_free_result.phpt M ext/mysql/tests/mysql_get_host_info.phpt M ext/mysql/tests/mysql_get_proto_info.phpt M ext/mysql/tests/mysql_get_server_info.phpt M ext/mysql/tests/mysql_info.phpt M ext/mysql/tests/mysql_insert_id.phpt M ext/mysql/tests/mysql_list_dbs.phpt M ext/mysql/tests/mysql_list_fields.phpt M ext/mysql/tests/mysql_list_processes.phpt M ext/mysql/tests/mysql_list_tables.phpt M ext/mysql/tests/mysql_max_links.phpt M ext/mysql/tests/mysql_max_persistent.phpt M ext/mysql/tests/mysql_mysqlnd_read_timeout_long.phpt M ext/mysql/tests/mysql_num_fields.phpt M ext/mysql/tests/mysql_num_rows.phpt M ext/mysql/tests/mysql_pconn_disable.phpt M ext/mysql/tests/mysql_pconn_kill.phpt M ext/mysql/tests
[PHP-CVS] com php-src: Added a few missing TSRMLS_DC/TSRMLS_CC.: ext/date/php_date.c
Commit:f65a5597d33ffc12b8c1afc941cb77899481b4cd Author:Derick Rethans Mon, 17 Dec 2012 16:49:00 + Parents: 86c0ac9e759aa615683d3b396813e1922911e4a6 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f65a5597d33ffc12b8c1afc941cb77899481b4cd Log: Added a few missing TSRMLS_DC/TSRMLS_CC. Changed paths: M ext/date/php_date.c Diff: diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 37ec792..d4adf54 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2829,7 +2829,7 @@ PHP_FUNCTION(date_format) } /* }}} */ -static void php_date_modify(zval *object, char *modify, int modify_len, zval *return_value) +static void php_date_modify(zval *object, char *modify, int modify_len, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; timelib_time *tmp_time; @@ -2898,7 +2898,7 @@ PHP_FUNCTION(date_modify) RETURN_FALSE; } - php_date_modify(object, modify, modify_len, return_value); + php_date_modify(object, modify, modify_len, return_value TSRMLS_CC); RETURN_ZVAL(getThis(), 1, 0); } @@ -2917,13 +2917,13 @@ PHP_METHOD(DateTimePoint, modify) } new_object = date_clone_point(object); - php_date_modify(new_object, modify, modify_len, return_value); + php_date_modify(new_object, modify, modify_len, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } /* }}} */ -static void php_date_add(zval *object, zval *interval, zval *return_value) +static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; php_interval_obj *intobj; @@ -2967,7 +2967,7 @@ PHP_FUNCTION(date_add) RETURN_FALSE; } - php_date_add(object, interval, return_value); + php_date_add(object, interval, return_value TSRMLS_CC); RETURN_ZVAL(object, 1, 0); } @@ -2984,13 +2984,13 @@ PHP_METHOD(DateTimePoint, add) } new_object = date_clone_point(object); - php_date_add(new_object, interval, return_value); + php_date_add(new_object, interval, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } /* }}} */ -static void php_date_sub(zval *object, zval *interval, zval *return_value) +static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS_DC) { php_date_obj *dateobj; php_interval_obj *intobj; @@ -3037,7 +3037,7 @@ PHP_FUNCTION(date_sub) RETURN_FALSE; } - php_date_sub(object, interval, return_value); + php_date_sub(object, interval, return_value TSRMLS_CC); RETURN_ZVAL(object, 1, 0); } @@ -3054,7 +3054,7 @@ PHP_METHOD(DateTimePoint, sub) } new_object = date_clone_point(object); - php_date_sub(new_object, interval, return_value); + php_date_sub(new_object, interval, return_value TSRMLS_CC); RETURN_ZVAL(new_object, 0, 1); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Added another test to test the unmodified inherited methods.: ext/date/tests/date_time_point-inherited.phpt
Commit:400502e3f9a3477877daebd84707f4bac9645019 Author:Derick Rethans Mon, 17 Dec 2012 16:49:25 + Parents: f65a5597d33ffc12b8c1afc941cb77899481b4cd Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=400502e3f9a3477877daebd84707f4bac9645019 Log: Added another test to test the unmodified inherited methods. Changed paths: A ext/date/tests/date_time_point-inherited.phpt Diff: diff --git a/ext/date/tests/date_time_point-inherited.phpt b/ext/date/tests/date_time_point-inherited.phpt new file mode 100644 index 000..e355407 --- /dev/null +++ b/ext/date/tests/date_time_point-inherited.phpt @@ -0,0 +1,25 @@ +--TEST-- +Tests for DateTimePoint. +--INI-- +date.timezone=Europe/London +--FILE-- +getTimezone(); +var_dump($x->getName()); + +echo "\ngetTimestamp():\n"; +$v = date_create_point($current); +$x = $v->getTimestamp(); +var_dump($x); +?> +--EXPECT-- +getTimezone(): +string(13) "Europe/London" + +getTimestamp(): +int(1356625448) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Added a test case for DateTimePoint.: ext/date/tests/date_time_point.phpt
Commit:86c0ac9e759aa615683d3b396813e1922911e4a6 Author:Derick Rethans Mon, 17 Dec 2012 16:35:52 + Parents: db554e1c6504fe0ed0845ea637e0d7064014ad31 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=86c0ac9e759aa615683d3b396813e1922911e4a6 Log: Added a test case for DateTimePoint. Changed paths: A ext/date/tests/date_time_point.phpt Diff: diff --git a/ext/date/tests/date_time_point.phpt b/ext/date/tests/date_time_point.phpt new file mode 100644 index 000..810eeca --- /dev/null +++ b/ext/date/tests/date_time_point.phpt @@ -0,0 +1,167 @@ +--TEST-- +Tests for DateTimePoint. +--INI-- +date.timezone=Europe/London +--FILE-- +format('Y-m-d H:i:s e'), "\n"; + echo 'copy:', $b->format('Y-m-d H:i:s e'), "\n"; + echo 'changed: ', $c->format('Y-m-d H:i:s e'), "\n"; +} + +echo "modify():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->modify("+2 days"); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->modify("+2 days"); +dump($v, $z, $x); + +echo "\nadd():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->add(new DateInterval("P2DT2S")); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->add(new DateInterval("P2DT2S")); +dump($v, $z, $x); + +echo "\nsub():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->sub(new DateInterval("P2DT2S")); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->sub(new DateInterval("P2DT2S")); +dump($v, $z, $x); + +echo "\nsetTimezone():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); +$v = new DateTimePoint($current); +$z = $v; +$x = $z->setTimezone($tz); +dump($v, $z, $x); + +echo "\nsetTime():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTime(5, 7, 19); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTime(5, 7, 19); +dump($v, $z, $x); + +echo "\nsetDate():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setDate(5, 7, 19); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setDate(5, 7, 19); +dump($v, $z, $x); + +echo "\nsetIsoDate():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setIsoDate(2012, 2, 6); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setIsoDate(2012, 2, 6); +dump($v, $z, $x); + +echo "\nsetTimestamp():\n"; +$v = date_create_point($current); +$z = $v; +$x = $z->setTimestamp(2012234222); +dump($v, $z, $x); +$v = date_create($current); +$z = $v; +$x = $z->setTimestamp(2012234222); +dump($v, $z, $x); +?> +--EXPECT-- +modify(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-29 16:24:08 Europe/London +orig:2012-12-29 16:24:08 Europe/London +copy:2012-12-29 16:24:08 Europe/London +changed: 2012-12-29 16:24:08 Europe/London + +add(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-29 16:24:10 Europe/London +orig:2012-12-29 16:24:10 Europe/London +copy:2012-12-29 16:24:10 Europe/London +changed: 2012-12-29 16:24:10 Europe/London + +sub(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-25 16:24:06 Europe/London +orig:2012-12-25 16:24:06 Europe/London +copy:2012-12-25 16:24:06 Europe/London +changed: 2012-12-25 16:24:06 Europe/London + +setTimezone(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-28 01:24:08 Asia/Tokyo +orig:2012-12-28 01:24:08 Asia/Tokyo +copy:2012-12-28 01:24:08 Asia/Tokyo +changed: 2012-12-28 01:24:08 Asia/Tokyo +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-28 01:24:08 Asia/Tokyo + +setTime(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-12-27 05:07:19 Europe/London +orig:2012-12-27 05:07:19 Europe/London +copy:2012-12-27 05:07:19 Europe/London +changed: 2012-12-27 05:07:19 Europe/London + +setDate(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 0005-07-19 16:24:08 Europe/London +orig:0005-07-19 16:24:08 Europe/London +copy:0005-07-19 16:24:08 Europe/London +changed: 0005-07-19 16:24:08 Europe/London + +setIsoDate(): +orig:2012-12-27 16:24:08 Europe/London +copy:2012-12-27 16:24:08 Europe/London +changed: 2012-01-14 16:24:08 Europe/London +orig:2012-01-14 16:24:08 Europe/London +copy:2012-01-14 16:24:08 Europe/London +changed: 2
[PHP-CVS] com php-src: Implemented immutable DateTime objects as the DateTimePoint class.: ext/date/php_date.c ext/date/php_date.h
Commit:db554e1c6504fe0ed0845ea637e0d7064014ad31 Author:Derick Rethans Mon, 17 Dec 2012 15:31:23 + Parents: a213caf4c3c9872db1f53be80b8bf4cb4a74a1c0 Branches: immutable-date Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=db554e1c6504fe0ed0845ea637e0d7064014ad31 Log: Implemented immutable DateTime objects as the DateTimePoint class. Changed paths: M ext/date/php_date.c M ext/date/php_date.h diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 1b36894..37ec792 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -385,7 +385,9 @@ const zend_function_entry date_functions[] = { /* Advanced Interface */ PHP_FE(date_create, arginfo_date_create) + PHP_FE(date_create_point, arginfo_date_create) PHP_FE(date_create_from_format, arginfo_date_create_from_format) + PHP_FE(date_create_point_from_format, arginfo_date_create_from_format) PHP_FE(date_parse, arginfo_date_parse) PHP_FE(date_parse_from_format, arginfo_date_parse_from_format) PHP_FE(date_get_last_errors, arginfo_date_get_last_errors) @@ -450,6 +452,20 @@ const zend_function_entry date_funcs_date[] = { PHP_FE_END }; +const zend_function_entry date_funcs_point[] = { + PHP_ME(DateTimePoint, __construct, arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) + PHP_ME(DateTimePoint, __set_state, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) + PHP_ME(DateTimePoint, modify,arginfo_date_method_modify, 0) + PHP_ME(DateTimePoint, add, arginfo_date_method_add, 0) + PHP_ME(DateTimePoint, sub, arginfo_date_method_sub, 0) + PHP_ME(DateTimePoint, setTimezone, arginfo_date_method_timezone_set, 0) + PHP_ME(DateTimePoint, setTime, arginfo_date_method_time_set, 0) + PHP_ME(DateTimePoint, setDate, arginfo_date_method_date_set, 0) + PHP_ME(DateTimePoint, setISODate,arginfo_date_method_isodate_set, 0) + PHP_ME(DateTimePoint, setTimestamp, arginfo_date_method_timestamp_set, 0) + PHP_FE_END +}; + const zend_function_entry date_funcs_timezone[] = { PHP_ME(DateTimeZone, __construct, arginfo_timezone_open, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC) PHP_ME_MAPPING(getName, timezone_name_get, arginfo_timezone_method_name_get, 0) @@ -506,6 +522,7 @@ PHP_INI_END() /* }}} */ zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, *date_ce_period; +zend_class_entry *date_ce_point; PHPAPI zend_class_entry *php_date_get_date_ce(void) @@ -513,12 +530,18 @@ PHPAPI zend_class_entry *php_date_get_date_ce(void) return date_ce_date; } +PHPAPI zend_class_entry *php_date_get_point_ce(void) +{ + return date_ce_point; +} + PHPAPI zend_class_entry *php_date_get_timezone_ce(void) { return date_ce_timezone; } static zend_object_handlers date_object_handlers_date; +static zend_object_handlers date_object_handlers_point; static zend_object_handlers date_object_handlers_timezone; static zend_object_handlers date_object_handlers_interval; static zend_object_handlers date_object_handlers_period; @@ -553,11 +576,13 @@ static void date_object_free_storage_interval(void *object TSRMLS_DC); static void date_object_free_storage_period(void *object TSRMLS_DC); static zend_object_value date_object_new_date(zend_class_entry *class_type TSRMLS_DC); +static zend_object_value date_object_new_point(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_timezone(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_interval(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_new_period(zend_class_entry *class_type TSRMLS_DC); static zend_object_value date_object_clone_date(zval *this_ptr TSRMLS_DC); +static zend_object_value date_object_clone_point(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_interval(zval *this_ptr TSRMLS_DC); static zend_object_value date_object_clone_period(zval *this_ptr TSRMLS_DC); @@ -1875,7 +1900,7 @@ 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_timezone, ce_interval, ce_period; + zend_class_entry ce_date, ce_point, ce_timezone, ce_interval, ce_period; INIT_CLASS_ENTRY(ce_date, "DateTime", date_funcs_date); ce_date.create_object = date_object_new_date; @@ -1900,6 +1925,13 @@ static void date_register_classes(TSRMLS_D) REGISTER_DATE_CLASS_CONST_STRING("RSS", DATE_FORMAT_RFC1123); REGISTER_DATE_CLASS_CONST_STRING("W3C", DATE_FORMAT_RFC3339); + INIT_CLASS_ENTRY(ce_point, "DateTimePoint", date_funcs_point); + ce_po
[PHP-CVS] com php-src: - Updated to version 2012.9 (2012i): ext/date/lib/timezonedb.h
Commit:1784279be07f1ea18baff67646d9d75896cae36f Author:Derick Rethans Sun, 4 Nov 2012 16:23:58 + Parents: b5344e267a5866717cd3e36f9d4c428ec701adda Branches: PHP-5.3 PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1784279be07f1ea18baff67646d9d75896cae36f Log: - Updated to version 2012.9 (2012i) Changed paths: M ext/date/lib/timezonedb.h Diff: diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 143b5e1..450b304 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -3468,20 +3468,20 @@ const unsigned char timelib_timezone_db_data_builtin[258453] = { 0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x45, 0x44, 0x35, 0x50, 0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x24, 0x17, 0x50, 0x47, 0xDC, 0xA9, 0x50, 0x49, 0x03, 0xF9, 0x50, 0x49, 0xB3, 0x50, 0xD0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0x9C, 0x6D, 0x50, 0x4C, 0xCC, 0xF7, 0xD0, -0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xBF, 0x4E, 0xD0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x8C, 0xBB, 0xD0, -0x51, 0x3C, 0x13, 0x50, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x1B, 0xF5, 0x50, 0x54, 0x4C, 0x7F, 0xD0, -0x54, 0xFB, 0xD7, 0x50, 0x56, 0x2C, 0x61, 0xD0, 0x56, 0xE4, 0xF3, 0xD0, 0x58, 0x15, 0x7E, 0x50, -0x58, 0xC4, 0xD5, 0xD0, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xA4, 0xB7, 0xD0, 0x5B, 0xD5, 0x42, 0x50, -0x5C, 0x84, 0x99, 0xD0, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x64, 0x7B, 0xD0, 0x5F, 0x95, 0x06, 0x50, -0x60, 0x4D, 0x98, 0x50, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x2D, 0x7A, 0x50, 0x63, 0x5E, 0x04, 0xD0, -0x64, 0x0D, 0x5C, 0x50, 0x65, 0x3D, 0xE6, 0xD0, 0x65, 0xED, 0x3E, 0x50, 0x67, 0x1D, 0xC8, 0xD0, -0x67, 0xCD, 0x20, 0x50, 0x68, 0xFD, 0xAA, 0xD0, 0x69, 0xAD, 0x02, 0x50, 0x6A, 0xDD, 0x8C, 0xD0, -0x6B, 0x96, 0x1E, 0xD0, 0x6C, 0xC6, 0xA9, 0x50, 0x6D, 0x76, 0x00, 0xD0, 0x6E, 0xA6, 0x8B, 0x50, -0x6F, 0x55, 0xE2, 0xD0, 0x70, 0x86, 0x6D, 0x50, 0x71, 0x35, 0xC4, 0xD0, 0x72, 0x66, 0x4F, 0x50, -0x73, 0x15, 0xA6, 0xD0, 0x74, 0x46, 0x31, 0x50, 0x74, 0xFE, 0xC3, 0x50, 0x76, 0x2F, 0x4D, 0xD0, -0x76, 0xDE, 0xA5, 0x50, 0x78, 0x0F, 0x2F, 0xD0, 0x78, 0xBE, 0x87, 0x50, 0x79, 0xEF, 0x11, 0xD0, -0x7A, 0x9E, 0x69, 0x50, 0x7B, 0xCE, 0xF3, 0xD0, 0x7C, 0x7E, 0x4B, 0x50, 0x7D, 0xAE, 0xD5, 0xD0, -0x7E, 0x5E, 0x2D, 0x50, 0x7F, 0x8E, 0xB7, 0xD0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, +0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xBF, 0x4E, 0xD0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x95, 0xF6, 0x50, +0x51, 0x3C, 0x13, 0x50, 0x52, 0x75, 0xD8, 0x50, 0x53, 0x1B, 0xF5, 0x50, 0x54, 0x55, 0xBA, 0x50, +0x54, 0xFB, 0xD7, 0x50, 0x56, 0x35, 0x9C, 0x50, 0x56, 0xE4, 0xF3, 0xD0, 0x58, 0x1E, 0xB8, 0xD0, +0x58, 0xC4, 0xD5, 0xD0, 0x59, 0xFE, 0x9A, 0xD0, 0x5A, 0xA4, 0xB7, 0xD0, 0x5B, 0xDE, 0x7C, 0xD0, +0x5C, 0x84, 0x99, 0xD0, 0x5D, 0xBE, 0x5E, 0xD0, 0x5E, 0x64, 0x7B, 0xD0, 0x5F, 0x9E, 0x40, 0xD0, +0x60, 0x4D, 0x98, 0x50, 0x61, 0x87, 0x5D, 0x50, 0x62, 0x2D, 0x7A, 0x50, 0x63, 0x67, 0x3F, 0x50, +0x64, 0x0D, 0x5C, 0x50, 0x65, 0x47, 0x21, 0x50, 0x65, 0xED, 0x3E, 0x50, 0x67, 0x27, 0x03, 0x50, +0x67, 0xCD, 0x20, 0x50, 0x69, 0x06, 0xE5, 0x50, 0x69, 0xAD, 0x02, 0x50, 0x6A, 0xE6, 0xC7, 0x50, +0x6B, 0x96, 0x1E, 0xD0, 0x6C, 0xCF, 0xE3, 0xD0, 0x6D, 0x76, 0x00, 0xD0, 0x6E, 0xAF, 0xC5, 0xD0, +0x6F, 0x55, 0xE2, 0xD0, 0x70, 0x8F, 0xA7, 0xD0, 0x71, 0x35, 0xC4, 0xD0, 0x72, 0x6F, 0x89, 0xD0, +0x73, 0x15, 0xA6, 0xD0, 0x74, 0x4F, 0x6B, 0xD0, 0x74, 0xFE, 0xC3, 0x50, 0x76, 0x38, 0x88, 0x50, +0x76, 0xDE, 0xA5, 0x50, 0x78, 0x18, 0x6A, 0x50, 0x78, 0xBE, 0x87, 0x50, 0x79, 0xF8, 0x4C, 0x50, +0x7A, 0x9E, 0x69, 0x50, 0x7B, 0xD8, 0x2E, 0x50, 0x7C, 0x7E, 0x4B, 0x50, 0x7D, 0xB8, 0x10, 0x50, +0x7E, 0x5E, 0x2D, 0x50, 0x7F, 0x97, 0xF2, 0x50, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, @@ -11766,20 +11766,20 @@ const unsigned char timelib_timezone_db_data_builtin[258453] = { 0x3E, 0x8F, 0xB4, 0x50, 0x3F, 0x9B, 0x54, 0xD0, 0x40, 0x6F, 0x96, 0x50, 0x45, 0x44, 0x35, 0x50, 0x45, 0xF3, 0x8C, 0xD0, 0x47, 0x24, 0x17, 0x50, 0x47, 0xDC, 0xA9, 0x50, 0x49, 0x03, 0xF9, 0x50, 0x49, 0xB3, 0x50, 0xD0, 0x4A, 0xE3, 0xDB, 0x50, 0x4B, 0x9C, 0x6D, 0x50, 0x4C, 0xCC, 0xF7, 0xD0, -0x4D, 0x85, 0x89, 0xD0, 0x4E, 0xBF, 0x4E, 0xD0, 0x4F, 0x77, 0xE0, 0xD0, 0x50, 0x8C, 0xBB, 0xD0, -0x51, 0x3C, 0x13, 0x50, 0x52, 0x6C, 0x9D, 0xD0, 0x53, 0x1B, 0xF5, 0x50, 0x54, 0x4C, 0x7F, 0xD0, -0x54, 0xFB, 0xD7, 0x50, 0x56, 0x2C, 0x61, 0xD0, 0x56, 0xE4, 0xF3, 0xD0, 0x58, 0x15, 0x7E, 0x50, -0x58, 0xC4, 0xD5, 0xD0, 0x59, 0xF5, 0x60, 0x50, 0x5A, 0xA4, 0xB7, 0xD0, 0x5B, 0xD5, 0x42, 0x50, -0x5C, 0x84, 0x99, 0xD0, 0x5D, 0xB5, 0x24, 0x50, 0x5E, 0x64, 0x7B, 0xD0, 0x5F, 0x95, 0x06, 0x50, -0x60, 0x4D, 0x98, 0x50, 0x61, 0x7E, 0x22, 0xD0, 0x62, 0x2D, 0x7A, 0x50, 0x63, 0x5E, 0x04
[PHP-CVS] svn: /SVNROOT/ global_avail
derick Sat, 10 Nov 2012 17:18:35 + Revision: http://svn.php.net/viewvc?view=revision&revision=328300 Log: Give ssh2 extension maintainers phpdoc karma. Changed paths: U SVNROOT/global_avail Modified: SVNROOT/global_avail === --- SVNROOT/global_avail2012-11-10 15:52:47 UTC (rev 328299) +++ SVNROOT/global_avail2012-11-10 17:18:35 UTC (rev 328300) @@ -314,7 +314,7 @@ avail|jawed,datibbaw|pecl/oauth avail|sean|pecl/parsekit avail|magicaltux|pecl/proctitle,php-src.git/ext/wddx -avail|mikesul,langemeijer,aguptagoa|pecl/ssh2 +avail|mikesul,langemeijer,aguptagoa|pecl/ssh2,phpdoc avail|rjcarroll|pecl/fuse avail|kristina,jmikola|pecl/mongo,phpdoc avail|kaigai|pecl/selinux,phpdoc -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: - Updated to version 2012.7 (2012g): ext/date/lib/timezonedb.h
Commit:8f7a6c3029bd1f5731492aa9897c26f421961191 Author:Derick Rethans Thu, 18 Oct 2012 21:53:03 +0100 Parents: 7aed21c55753d2cfb5dc66e47b1a7396333e566f Branches: PHP-5.3 PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8f7a6c3029bd1f5731492aa9897c26f421961191 Log: - Updated to version 2012.7 (2012g) Changed paths: M ext/date/lib/timezonedb.h diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index cee077b..6f52cbf 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -507,77 +507,77 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[576] = { { "NZ", 0x038F1A }, { "NZ-CHAT" , 0x039298 }, { "Pacific/Apia" , 0x039580 }, - { "Pacific/Auckland" , 0x03961D }, - { "Pacific/Chatham" , 0x0399A9 }, - { "Pacific/Chuuk" , 0x039CA0 }, - { "Pacific/Easter", 0x039CF9 }, - { "Pacific/Efate" , 0x03A057 }, - { "Pacific/Enderbury" , 0x03A11D }, - { "Pacific/Fakaofo" , 0x03A18B }, - { "Pacific/Fiji" , 0x03A1DC }, - { "Pacific/Funafuti" , 0x03A36F }, - { "Pacific/Galapagos" , 0x03A3B3 }, - { "Pacific/Gambier" , 0x03A42B }, - { "Pacific/Guadalcanal" , 0x03A490 }, - { "Pacific/Guam" , 0x03A4E5 }, - { "Pacific/Honolulu" , 0x03A53B }, - { "Pacific/Johnston" , 0x03A5B2 }, - { "Pacific/Kiritimati", 0x03A604 }, - { "Pacific/Kosrae", 0x03A66F }, - { "Pacific/Kwajalein" , 0x03A6CC }, - { "Pacific/Majuro", 0x03A738 }, - { "Pacific/Marquesas" , 0x03A797 }, - { "Pacific/Midway", 0x03A7FE }, - { "Pacific/Nauru" , 0x03A888 }, - { "Pacific/Niue" , 0x03A900 }, - { "Pacific/Norfolk" , 0x03A95E }, - { "Pacific/Noumea", 0x03A9B3 }, - { "Pacific/Pago_Pago" , 0x03AA43 }, - { "Pacific/Palau" , 0x03AACC }, - { "Pacific/Pitcairn" , 0x03AB10 }, - { "Pacific/Pohnpei" , 0x03AB65 }, - { "Pacific/Ponape", 0x03ABBA }, - { "Pacific/Port_Moresby" , 0x03ABFF }, - { "Pacific/Rarotonga" , 0x03AC43 }, - { "Pacific/Saipan", 0x03AD1F }, - { "Pacific/Samoa" , 0x03AD82 }, - { "Pacific/Tahiti", 0x03AE0B }, - { "Pacific/Tarawa", 0x03AE70 }, - { "Pacific/Tongatapu" , 0x03AEC4 }, - { "Pacific/Truk" , 0x03AF50 }, - { "Pacific/Wake" , 0x03AF95 }, - { "Pacific/Wallis", 0x03AFE5 }, - { "Pacific/Yap" , 0x03B029 }, - { "Poland", 0x03B06E }, - { "Portugal" , 0x03B44F }, - { "PRC" , 0x03B94B }, - { "PST8PDT" , 0x03B9FC }, - { "ROC" , 0x03BD4D }, - { "ROK" , 0x03BE65 }, - { "Singapore" , 0x03BF09 }, - { "Turkey", 0x03BFC0 }, - { "UCT" , 0x03C3AD }, - { "Universal" , 0x03C3F1 }, - { "US/Alaska" , 0x03C435 }, - { "US/Aleutian" , 0x03C79E }, - { "US/Arizona", 0x03CB04 }, - { "US/Central", 0x03CB92 }, - { "US/East-Indiana" , 0x03D59C }, - { "US/Eastern", 0x03D09D }, - { "US/Hawaii" , 0x03D806 }, - { "US/Indiana-Starke" , 0x03D877 }, -
[PHP-CVS] com php-src: SUpport newer bisons.: Zend/acinclude.m4
Commit:7aed21c55753d2cfb5dc66e47b1a7396333e566f Author:Derick Rethans Thu, 18 Oct 2012 17:53:21 +0100 Parents: 0d7965f0a32dc967a1665d274cdc0e39d44c87bb Branches: PHP-5.3 PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7aed21c55753d2cfb5dc66e47b1a7396333e566f Log: SUpport newer bisons. Changed paths: M Zend/acinclude.m4 Diff: diff --git a/Zend/acinclude.m4 b/Zend/acinclude.m4 index 97d5d64..136d2d8 100644 --- a/Zend/acinclude.m4 +++ b/Zend/acinclude.m4 @@ -4,7 +4,7 @@ dnl This file contains local autoconf functions. AC_DEFUN([LIBZEND_BISON_CHECK],[ # we only support certain bison versions - bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5" + bison_version_list="1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.5.1 2.6 2.6.1 2.6.2" # for standalone build of Zend Engine test -z "$SED" && SED=sed -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: update news: NEWS
On Tue, 18 Sep 2012, Ferenc Kovacs wrote: > On Tue, Sep 18, 2012 at 12:45 PM, Pierre Joye wrote: > > > On Tue, Sep 18, 2012 at 12:58 AM, Stanislav Malyshev wrote: > > > > > + . Support building PHP with the native client toolchain. (Stuart > > Langley) > > > > What's that? The chronium one or something else? :) > > > > > http://git.php.net/?p=php-src.git;a=commit;h=2e24d9a2b3cc5becafb0fd3805a22cd87daa1f18 That still doesn't explain what the "native client toolchain" is - and NEWS should be understandable without context. cheers, Derick -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Fixed Bug #62500 (Segfault in DateInterval class when extended): NEWS ext/date/php_date.c ext/date/tests/bug62500.phpt
On Sun, 8 Jul 2012, Xinchen Hui wrote: > Commit:e3b9b1e6dc016d9128ac5e9ed95aa5b1a5065e5f > Author:Xinchen Hui Mon, 9 Jul 2012 00:25:48 > +0800 > Parents: a213c10ef2125ac2da7a71ddb668d6f0aea8a05c > Branches: PHP-5.4 Why is this not in PHP 5.3 and master? cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: - Updated to version 2012.3 (2012c): ext/date/lib/timezonedb.h
On Wed, 4 Apr 2012, Johannes Schlüter wrote: > On Mon, 2012-04-02 at 09:40 +0000, Derick Rethans wrote: > > Commit:0e53ac49e60b4a58a918aa311bbca405e9185fcf > > Author: Derick Rethans Mon, 2 Apr 2012 > > 10:40:01 +0100 > > Parents: 66b3b44fd50df88139851760a2b58a8bb33ffabe > > Branches: PHP-5.3 PHP-5.4 master > > > > Link: > > http://git.php.net/?p=php-src.git;a=commitdiff;h=0e53ac49e60b4a58a918aa311bbca405e9185fcf > > > > Log: > > - Updated to version 2012.3 (2012c) > > > > Changed paths: > > M ext/date/lib/timezonedb.h > > No NEWS? We've never put this in NEWS AFAIK. It's like a transient thing that happens all the time. Every PHP release should always have the latest timezonedb as of that moment as well. Also, adding it to NEWS is difficult to automate :-) cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: Fold author and committer if they're the same and align items.: lib/Git/PostReceiveHook.php
Commit: 14bb87dbb769d3795797921014e4b9cc14da412f Author: Derick Rethans Tue, 20 Mar 2012 09:41:04 + Committer: Derick Rethans Tue, 20 Mar 2012 09:41:04 + Parents: 01fda1b87d24f4e1a51c4ca7c6f55a60f63c4ab2 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=14bb87dbb769d3795797921014e4b9cc14da412f Log: Fold author and committer if they're the same and align items. Changed paths: M lib/Git/PostReceiveHook.php Diff: 14bb87dbb769d3795797921014e4b9cc14da412f diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 60c0a33..16ef70a 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -150,11 +150,13 @@ class PostReceiveHook extends ReceiveHook foreach ($revisions as $revision) { $commitInfo = $this->getCommitInfo($revision); -$logString .= 'Commit: ' . $revision . "\n"; -$logString .= 'Author: ' . $commitInfo['author'] . ' <' . $commitInfo['author_email'] . '> ' . $commitInfo['author_date'] . "\n"; -$logString .= 'Committer: ' . $commitInfo['committer'] . ' <' . $commitInfo['committer_email'] . '> ' . $commitInfo['committer_date'] . "\n"; -$logString .= "Link: http://git.php.net/?p="; . $this->getRepositoryName() . ";a=commitdiff;h=" . $revision . "\n"; -$logString .= "Shortlog: " . $commitInfo['subject'] . "\n"; +$logString .= 'Commit:' . $revision . "\n"; +$logString .= 'Author:' . $commitInfo['author'] . ' <' . $commitInfo['author_email'] . '> ' . $commitInfo['author_date'] . "\n"; +if (($commitInfo['author'] != $commitInfo['committer']) || ($commitInfo['author_email'] != $commitInfo['committer_email'])) { +$logString .= 'Committer: ' . $commitInfo['committer'] . ' <' . $commitInfo['committer_email'] . '> ' . $commitInfo['committer_date'] . "\n"; +} +$logString .= 'Link: http://git.php.net/?p=' . $this->getRepositoryName() . ";a=commitdiff;h=" . $revision . "\n"; +$logString .= 'Shortlog: ' . $commitInfo['subject'] . "\n"; $logString .= "\n"; } @@ -274,8 +276,8 @@ class PostReceiveHook extends ReceiveHook } if ($info['annotated']) { -$message .= 'Tag: ' . $info['revision'] . "\n"; -$message .= 'Tagger: ' . $info['tagger'] . ' <' . $info['tagger_email'] . '> ' . $info['tagger_date'] . "\n"; +$message .= 'Tag: ' . $info['revision'] . "\n"; +$message .= 'Tagger: ' . $info['tagger'] . ' <' . $info['tagger_email'] . '> ' . $info['tagger_date'] . "\n"; $message .= "Log:\n" . $info['log'] . "\n"; } @@ -283,9 +285,11 @@ class PostReceiveHook extends ReceiveHook $message .= "Link: http://git.php.net/?p="; . $this->getRepositoryName() . ";a=tag;h=" . $info['revision'] . "\n"; $message .= "\n"; -$message .= 'Target: ' . $info['target'] . "\n"; -$message .= 'Author: ' . $targetInfo['author'] . ' <' . $targetInfo['author_email'] . '> ' . $targetInfo['author_date'] . "\n"; -$message .= 'Committer: ' . $targetInfo['committer'] . ' <' . $targetInfo['committer_email'] . '> ' . $targetInfo['committer_date'] . "\n"; +$message .= 'Target: ' . $info['target'] . "\n"; +$message .= 'Author: ' . $targetInfo['author'] . ' <' . $targetInfo['author_email'] . '> ' . $targetInfo['author_date'] . "\n"; +if (($targetInfo['author'] != $targetInfo['committer']) || ($targetInfo[&
[PHP-CVS] push karma: update branch master
Branch master in karma.git was updated Date: Tue, 20 Mar 2012 09:41:27 + Link: http://git.php.net/?p=karma.git;a=log;h=14bb87dbb769d3795797921014e4b9cc14da412f;hp=01fda1b87d24f4e1a51c4ca7c6f55a60f63c4ab2 Log: Commit: 14bb87dbb769d3795797921014e4b9cc14da412f Author: Derick Rethans Tue, 20 Mar 2012 09:41:04 + Committer: Derick Rethans Tue, 20 Mar 2012 09:41:04 + Link: http://git.php.net/?p=karma.git;a=commitdiff;h=14bb87dbb769d3795797921014e4b9cc14da412f Shortlog: Fold author and committer if they're the same and align items. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com karma: Use author/email format that can be copied and pasted for use in e-mail clients.: lib/Git/PostReceiveHook.php
On Tue, 20 Mar 2012, Stefan Marr wrote: > Hi: > > On 20 Mar 2012, at 10:05, Derick Rethans wrote: > > > Commit: f05ac19fc6481815958655f483ef8d0d4fbc3bbe > > Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 > > 08:57:53 + > > Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 > > 09:05:42 + > > Parents: 20a4cccd338af8b1e20ceae4339e563907b4195c > > > > Link: > > http://git.php.net/?p=karma.git;a=commitdiff;h=f05ac19fc6481815958655f483ef8d0d4fbc3bbe > > > > Log: > > Use author/email format that can be copied and pasted for use in e-mail > > clients. > > > While you guys are doing all these nice little improvements, would it > be possible to fold the author and committer line if the authors > match? (to be less verbose) Sure, will fix. > And, in the push emails, could the line with the short log go first in > every block? That seems to be the most important information in there > to me. Can do, but it's the emails subject now. Is that not good enough? > Here I was also wondering whether the commit hash could be left out to > reduce verbosity even more. It is still included in the link. I think it should be retained. cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: Use author/email format that can be copied and pasted for use in e-mail clients.: lib/Git/PostReceiveHook.php
Commit: f05ac19fc6481815958655f483ef8d0d4fbc3bbe Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:57:53 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 09:05:42 + Parents: 20a4cccd338af8b1e20ceae4339e563907b4195c Link: http://git.php.net/?p=karma.git;a=commitdiff;h=f05ac19fc6481815958655f483ef8d0d4fbc3bbe Log: Use author/email format that can be copied and pasted for use in e-mail clients. Changed paths: M lib/Git/PostReceiveHook.php Diff: f05ac19fc6481815958655f483ef8d0d4fbc3bbe diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 5b31f1e..6fd1a2f 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -151,8 +151,8 @@ class PostReceiveHook extends ReceiveHook foreach ($revisions as $revision) { $commitInfo = $this->getCommitInfo($revision); $logString .= 'Commit: ' . $revision . "\n"; -$logString .= 'Author: ' . $commitInfo['author'] . '(' . $commitInfo['author_email'] . ') ' . $commitInfo['author_date'] . "\n"; -$logString .= 'Committer: ' . $commitInfo['committer'] . '(' . $commitInfo['committer_email'] . ') ' . $commitInfo['committer_date'] . "\n"; +$logString .= 'Author: ' . $commitInfo['author'] . ' <' . $commitInfo['author_email'] . '> ' . $commitInfo['author_date'] . "\n"; +$logString .= 'Committer: ' . $commitInfo['committer'] . ' <' . $commitInfo['committer_email'] . '> ' . $commitInfo['committer_date'] . "\n"; $logString .= "Link: http://git.php.net/?p="; . $this->getRepositoryName() . ";a=commitdiff;h=" . $revision . "\n"; $logString .= "Shortlog: " . $commitInfo['subject'] . "\n"; $logString .= "\n"; @@ -274,7 +274,7 @@ class PostReceiveHook extends ReceiveHook if ($info['annotated']) { $message .= 'Tag: ' . $info['revision'] . "\n"; -$message .= 'Tagger: ' . $info['tagger'] . '(' . $info['tagger_email'] . ') ' . $info['tagger_date'] . "\n"; +$message .= 'Tagger: ' . $info['tagger'] . ' <' . $info['tagger_email'] . '> ' . $info['tagger_date'] . "\n"; $message .= "Log:\n" . $info['log'] . "\n"; } @@ -283,8 +283,8 @@ class PostReceiveHook extends ReceiveHook $message .= "\n"; $message .= 'Target: ' . $info['target'] . "\n"; -$message .= 'Author: ' . $targetInfo['author'] . '(' . $targetInfo['author_email'] . ') ' . $targetInfo['author_date'] . "\n"; -$message .= 'Committer: ' . $targetInfo['committer'] . '(' . $targetInfo['committer_email'] . ') ' . $targetInfo['committer_date'] . "\n"; +$message .= 'Author: ' . $targetInfo['author'] . ' <' . $targetInfo['author_email'] . '> ' . $targetInfo['author_date'] . "\n"; +$message .= 'Committer: ' . $targetInfo['committer'] . ' <' . $targetInfo['committer_email'] . '> ' . $targetInfo['committer_date'] . "\n"; if ($targetInfo['parents']) $message .= 'Parents: ' . $targetInfo['parents'] . "\n"; $message .= "Target link: http://git.php.net/?p="; . $this->getRepositoryName() . ";a=commitdiff;h=" . $info['target'] . "\n"; $message .= "Target log:\n" . $targetInfo['log'] . "\n"; @@ -505,8 +505,8 @@ class PostReceiveHook extends ReceiveHook $message = ''; $message .= 'Commit: ' . $revision . "\n"; -$message .= 'Author: ' . $info['author'] . '(' . $info['author_email'] . ') ' . $info['author_date'] . "\n"; -$message .= 'Committer: ' . $info['committer'] . '(' . $info['committer_email'] . ') ' . $info['committer_date'] . "\n"; +$message .= 'Author: ' . $info['author'] . ' <' . $info['author_email'] . '> ' . $info['author_date'] . "\n"; +$message .= 'Committer: ' . $info['committer'] . ' <' . $info['committer_email'] . '> ' . $info['committer_date'] . "\n"; if ($info['parents']) $message .= 'Parents: ' . $info['parents'] . "\n"; $message .= "\n" . "Link: http://git.php.net/?p="; . $this->getRepositoryName() . ";a=commitdiff;h=" . $revision . "\n"; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma: Use the author/tagged date as timestamp to go into the e-mail header.: lib/Git/PostReceiveHook.php lib/Mail.php
Commit: 01fda1b87d24f4e1a51c4ca7c6f55a60f63c4ab2 Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 09:04:29 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 09:05:42 + Parents: f05ac19fc6481815958655f483ef8d0d4fbc3bbe Link: http://git.php.net/?p=karma.git;a=commitdiff;h=01fda1b87d24f4e1a51c4ca7c6f55a60f63c4ab2 Log: Use the author/tagged date as timestamp to go into the e-mail header. This makes the emails appear in chronological order in the threads. Changed paths: M lib/Git/PostReceiveHook.php M lib/Mail.php Diff: 01fda1b87d24f4e1a51c4ca7c6f55a60f63c4ab2 diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 6fd1a2f..60c0a33 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -258,6 +258,7 @@ class PostReceiveHook extends ReceiveHook $shortname = str_replace('refs/tags/', '', $name); $mail = new \Mail(); $mail->setSubject($this->emailPrefix . 'tag ' . $this->getRepositoryShortName() . ': ' . $status[$changeType] . ' tag ' . $shortname); +$mail->setTimestamp(strtotime($info['tagger_date'])); $message = 'Tag ' . $shortname . ' in ' . $this->getRepositoryName() . ' was ' . $status[$changeType] . 'd' . (($changeType != self::TYPE_CREATED) ? ' from ' . $oldrev : '' ) . "\n"; @@ -501,6 +502,7 @@ class PostReceiveHook extends ReceiveHook $mail = new \Mail(); $mail->setSubject($this->emailPrefix . 'com ' . $this->getRepositoryShortName() . ': ' . $info['subject'] . ': '. implode(' ', array_keys($paths))); +$mail->setTimestamp(strtotime($info['author_date'])); $message = ''; diff --git a/lib/Mail.php b/lib/Mail.php index 15b90e8..7c63a41 100644 --- a/lib/Mail.php +++ b/lib/Mail.php @@ -12,6 +12,7 @@ class Mail private $boundary = ''; private $uniqId = ''; private $replyTo = []; +private $timestamp = null; const CRLF = "\r\n"; @@ -100,6 +101,15 @@ class Mail } /** + * Set timestamp + * @param string $timestamp timestamp + */ +public function setTimestamp($timestamp) +{ +$this->timestamp = trim($timestamp); +} + +/** * Set mail body text * @param string $message body text */ @@ -157,7 +167,7 @@ class Mail $headers[] = $this->makeHeader('In-Reply-To', $replyTo); } $headers[] = $this->makeHeader('MIME-Version', '1.0'); -$headers[] = $this->makeHeader('Date', date(DATE_RFC2822, time())); +$headers[] = $this->makeHeader('Date', date(DATE_RFC2822, $this->timestamp ?: time())); if ($this->multipart) { $this->boundary = sha1($this->uniqId); $headers[] = $this->makeHeader('Content-Type', 'multipart/mixed; boundary="' . $this->boundary . '"'); @@ -212,4 +222,4 @@ class Mail return mail($receivers, $subject, $body, $headers); } -} \ 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] push karma: update branch master
Branch master in karma.git was updated Date: Tue, 20 Mar 2012 09:05:48 + Link: http://git.php.net/?p=karma.git;a=log;h=01fda1b87d24f4e1a51c4ca7c6f55a60f63c4ab2;hp=20a4cccd338af8b1e20ceae4339e563907b4195c Log: Commit: 01fda1b87d24f4e1a51c4ca7c6f55a60f63c4ab2 Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 09:04:29 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 09:05:42 + Link: http://git.php.net/?p=karma.git;a=commitdiff;h=01fda1b87d24f4e1a51c4ca7c6f55a60f63c4ab2 Shortlog: Use the author/tagged date as timestamp to go into the e-mail header. Commit: f05ac19fc6481815958655f483ef8d0d4fbc3bbe Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:57:53 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 09:05:42 + Link: http://git.php.net/?p=karma.git;a=commitdiff;h=f05ac19fc6481815958655f483ef8d0d4fbc3bbe Shortlog: Use author/email format that can be copied and pasted for use in e-mail clients. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma.git: Fixed typo in variable name.: hooks/post-receive.mail
Commit: 80086eabcfb6ca1d83c09c66657ce05d1a3c9125 Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:45:52 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:47:10 + Parents: a4725e5a641dcbf29b7392d0e3918c5b4ac77a80 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=80086eabcfb6ca1d83c09c66657ce05d1a3c9125 Log: Fixed typo in variable name. Changed paths: M hooks/post-receive.mail Diff: 80086eabcfb6ca1d83c09c66657ce05d1a3c9125 diff --git a/hooks/post-receive.mail b/hooks/post-receive.mail index de24b77..56a45d3 100755 --- a/hooks/post-receive.mail +++ b/hooks/post-receive.mail @@ -31,8 +31,8 @@ include 'Git/PostReceiveHook.php'; $recipients = exec('git config hooks.mailinglist'); $emailPrefix = exec('git config hooks.emailprefix'); -if ($emailprefix != '') { - $emailprefix . ' '; +if ($emailPrefix != '') { + $emailPrefix . ' '; } $user = null; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] branch karma.git: update branch master
Branch master in karma.git was updated Date: Tue, 20 Mar 2012 08:59:11 + Link: http://git.php.net/?p=karma.git;a=log;h=6d6e9738bca87657c5f8bffc1a90b1dcefa57b9a;hp=a4725e5a641dcbf29b7392d0e3918c5b4ac77a80 Log: Commit: 6d6e9738bca87657c5f8bffc1a90b1dcefa57b9a Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:46:33 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:47:54 + Link: http://git.php.net/?p=karma.git;a=commitdiff;h=6d6e9738bca87657c5f8bffc1a90b1dcefa57b9a Shortlog: Switch to getRepositoryShortName otherwise it breaks the karma system. Commit: 80086eabcfb6ca1d83c09c66657ce05d1a3c9125 Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:45:52 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:47:10 + Link: http://git.php.net/?p=karma.git;a=commitdiff;h=80086eabcfb6ca1d83c09c66657ce05d1a3c9125 Shortlog: Fixed typo in variable name. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com karma.git: Switch to getRepositoryShortName otherwise it breaks the karma system.: lib/Git/PostReceiveHook.php lib/Git/ReceiveHook.php
Commit: 6d6e9738bca87657c5f8bffc1a90b1dcefa57b9a Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:46:33 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:47:54 + Parents: 80086eabcfb6ca1d83c09c66657ce05d1a3c9125 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=6d6e9738bca87657c5f8bffc1a90b1dcefa57b9a Log: Switch to getRepositoryShortName otherwise it breaks the karma system. Changed paths: M lib/Git/PostReceiveHook.php M lib/Git/ReceiveHook.php Diff: 6d6e9738bca87657c5f8bffc1a90b1dcefa57b9a diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 4201508..209565c 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -162,7 +162,7 @@ class PostReceiveHook extends ReceiveHook } $mail = new \Mail(); -$mail->setSubject($this->emailPrefix . 'branch ' . $this->getRepositoryName() . ': ' . $status[$changeType] . ' branch ' . $shortname); +$mail->setSubject($this->emailPrefix . 'branch ' . $this->getRepositoryShortName() . ': ' . $status[$changeType] . ' branch ' . $shortname); $message = 'Branch ' . $shortname . ' in ' . $this->getRepositoryName() . ' was ' . $status[$changeType] . 'd' . "\n"; $message .= 'Date: ' . date('r') . "\n"; @@ -257,7 +257,7 @@ class PostReceiveHook extends ReceiveHook $status = [self::TYPE_UPDATED => 'update', self::TYPE_CREATED => 'create', self::TYPE_DELETED => 'delete']; $shortname = str_replace('refs/tags/', '', $name); $mail = new \Mail(); -$mail->setSubject($this->emailPrefix . 'tag ' . $this->getRepositoryName() . ': ' . $status[$changeType] . ' tag ' . $shortname); +$mail->setSubject($this->emailPrefix . 'tag ' . $this->getRepositoryShortName() . ': ' . $status[$changeType] . ' tag ' . $shortname); $message = 'Tag ' . $shortname . ' in ' . $this->getRepositoryName() . ' was ' . $status[$changeType] . 'd' . (($changeType != self::TYPE_CREATED) ? ' from ' . $oldrev : '' ) . "\n"; @@ -500,7 +500,7 @@ class PostReceiveHook extends ReceiveHook $diff = \Git::gitExec('diff-tree -c -p %s', escapeshellarg($revision)); $mail = new \Mail(); -$mail->setSubject($this->emailPrefix . 'com ' . $this->getRepositoryName() . ': ' . $info['subject'] . ': '. implode(' ', array_keys($paths))); +$mail->setSubject($this->emailPrefix . 'com ' . $this->getRepositoryShortName() . ': ' . $info['subject'] . ': '. implode(' ', array_keys($paths))); $message = ''; diff --git a/lib/Git/ReceiveHook.php b/lib/Git/ReceiveHook.php index b526e9a..d7df7b8 100644 --- a/lib/Git/ReceiveHook.php +++ b/lib/Git/ReceiveHook.php @@ -40,8 +40,7 @@ abstract class ReceiveHook /** * Returns the repository name. * - * A repository name is the path to the repository without the .git. - * e.g. php-src.git -> php-src + * A repository name is the path to the repository with the .git. * * @return string */ @@ -51,6 +50,19 @@ abstract class ReceiveHook } /** + * Returns the short repository name. + * + * A short repository name is the path to the repository without the .git. + * e.g. php-src.git -> php-src + * + * @return string + */ +public function getRepositoryShortName() +{ +return preg_replace('@\.git$@', '', $this->repositoryName); +} + +/** * Return array with changed paths as keys and change type as values * If commit is merge commit change type will have more than one char * (for example "MM") -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] commit karma.git: hooks/post-receive.mail lib/Git/PostReceiveHook.php
Commit: eb514083bf2a6ddaa0f2404da3d4347d2747a22e Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:50:06 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:54:58 + Parents: 42d233ae4752adbce2709553cef0cd456b92a2e0 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=eb514083bf2a6ddaa0f2404da3d4347d2747a22e Log: Don't use an email prefix unless specifically configured. This gets rid of the superfluous "[git] " in every mail subject to PHP-CVS. Changed paths: M hooks/post-receive.mail M lib/Git/PostReceiveHook.php Diff: eb514083bf2a6ddaa0f2404da3d4347d2747a22e diff --git a/hooks/post-receive.mail b/hooks/post-receive.mail index 7d47619..de24b77 100755 --- a/hooks/post-receive.mail +++ b/hooks/post-receive.mail @@ -30,7 +30,10 @@ include 'Git/PostReceiveHook.php'; $recipients = exec('git config hooks.mailinglist'); -$emailPrefix = exec('git config hooks.emailprefix') ?: '[git]'; +$emailPrefix = exec('git config hooks.emailprefix'); +if ($emailprefix != '') { + $emailprefix . ' '; +} $user = null; if (getenv('REMOTE_USER')) { diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index bd3be9b..4aec7b7 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -229,7 +229,7 @@ class PostReceiveHook extends ReceiveHook $mail = new \Mail(); -$mail->setSubject($this->emailPrefix . ' branch ' . $this->getRepositoryName() . ': ' . $status[$changeType] . ' branch ' . $shortname); +$mail->setSubject($this->emailPrefix . 'branch ' . $this->getRepositoryName() . ': ' . $status[$changeType] . ' branch ' . $shortname); $message = 'Branch ' . $shortname . ' in ' . $this->getRepositoryName() . ' was ' . $status[$changeType] . 'd' . "\n"; $message .= 'Date: ' . date('r') . "\n"; @@ -567,7 +567,7 @@ class PostReceiveHook extends ReceiveHook $diff = \Git::gitExec('diff-tree -c -p %s', escapeshellarg($revision)); $mail = new \Mail(); -$mail->setSubject($this->emailPrefix . ' commit ' . $this->getRepositoryName() . ': ' . implode(' ', array_keys($paths))); +$mail->setSubject($this->emailPrefix . 'commit ' . $this->getRepositoryName() . ': ' . implode(' ', array_keys($paths))); $message = ''; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] commit karma.git: lib/Git/ReceiveHook.php
Commit: 3586d1c6652ce0f202daa2894d7862ff4e698140 Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:55:09 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:55:09 + Parents: eb514083bf2a6ddaa0f2404da3d4347d2747a22e Link: http://git.php.net/?p=karma.git;a=commitdiff;h=3586d1c6652ce0f202daa2894d7862ff4e698140 Log: Removed the .git part of the repository name as specified by the methods docblock. This also gets rid of the superfluous ".git" in email subjects. Changed paths: M lib/Git/ReceiveHook.php Diff: 3586d1c6652ce0f202daa2894d7862ff4e698140 diff --git a/lib/Git/ReceiveHook.php b/lib/Git/ReceiveHook.php index b526e9a..294bb27 100644 --- a/lib/Git/ReceiveHook.php +++ b/lib/Git/ReceiveHook.php @@ -47,7 +47,7 @@ abstract class ReceiveHook */ public function getRepositoryName() { -return $this->repositoryName; +return preg_replace('@\.git$@', '', $this->repositoryName); } /** -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] commit karma.git: lib/Git/PostReceiveHook.php
Commit: bdcf0e849a28c2b06017f225dd488bd26366bf88 Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:59:37 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:59:37 + Parents: 3586d1c6652ce0f202daa2894d7862ff4e698140 Link: http://git.php.net/?p=karma.git;a=commitdiff;h=bdcf0e849a28c2b06017f225dd488bd26366bf88 Log: Add commit message "subject" and change "commit" to "com" to save space. Changed paths: M lib/Git/PostReceiveHook.php Diff: bdcf0e849a28c2b06017f225dd488bd26366bf88 diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php index 4aec7b7..b05feca 100644 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@ -567,7 +567,7 @@ class PostReceiveHook extends ReceiveHook $diff = \Git::gitExec('diff-tree -c -p %s', escapeshellarg($revision)); $mail = new \Mail(); -$mail->setSubject($this->emailPrefix . 'commit ' . $this->getRepositoryName() . ': ' . implode(' ', array_keys($paths))); +$mail->setSubject($this->emailPrefix . 'com ' . $this->getRepositoryName() . ': ' . $info['subject'] . ': '. implode(' ', array_keys($paths))); $message = ''; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] commit karma.git: lib/Git/PostReceiveHook.php
Commit: 3bacfbd956538305c8f604271071d839ecb1f559 Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:25:38 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:25:38 + Parents: bdcf0e849a28c2b06017f225dd488bd26366bf88 11bc19461cfada676edd5852edc529532ef7a3ac Link: http://git.php.net/?p=karma.git;a=commitdiff;h=3bacfbd956538305c8f604271071d839ecb1f559 Log: Merge branch 'master' of git.php.net:/karma Changed paths: MM lib/Git/PostReceiveHook.php Diff: 3bacfbd956538305c8f604271071d839ecb1f559 diff --combined lib/Git/PostReceiveHook.php index b05feca,ee3aab7..4201508 --- a/lib/Git/PostReceiveHook.php +++ b/lib/Git/PostReceiveHook.php @@@ -39,70 -39,6 +39,6 @@@ class PostReceiveHook extends ReceiveHo $this->allBranches = $this->getAllBranches(); } - - public function getReceivedMessages() - { - $this->hookInput(); - - $paths = array_map( - function ($input) { - return $this->getReceivedMessagesForRange($input['old'], $input['new']); - }, - $this->refs); - - /* remove empty lines, and flattern the array */ - $flattend = array_reduce($paths, 'array_merge', []); - $paths= array_filter($flattend); - - return array_unique($paths); - } - - /** - * Returns an array of commit messages between revision $old and $new. - * - * @param string $old The old revison number. - * @parma string $new The new revison umber. - * - * @return array - */ - private function getReceivedMessagesForRange($old, $new) - { - $repourl = \Git::getRepositoryPath(); - $output = []; - - if ($old == '') { - $cmd = sprintf( - "%s --git-dir=%s for-each-ref --format='%%(refname)' 'refs/heads/*'", - self::GIT_EXECUTABLE, - $repourl - ); - exec($cmd, $output); - - /* do we have heads? otherwise it's a new repo! */ - $heads = implode(' ', $output); - $not = count($output) > 0 ? sprintf('--not %s', escapeshellarg($heads)) : ''; - $cmd = sprintf( - '%s --git-dir=%s log --pretty=format:"[%%ae] %%H %%s" %s %s', - \Git::GIT_EXECUTABLE, - $repourl, - $not, - escapeshellarg($new) - ); - exec($cmd, $output); - } else { - $cmd = sprintf( - '%s --git-dir=%s log --pretty=format:"[%%ae] %%H %%s" %s..%s', - \Git::GIT_EXECUTABLE, - $repourl, - escapeshellarg($old), - escapeshellarg($new) - ); - exec($cmd, $output); - } - - return $output; - } - /** * Find user name by nickname in users data file * @param string $user user nickname @@@ -225,11 -161,8 +161,8 @@@ } } - - - $mail = new \Mail(); -$mail->setSubject($this->emailPrefix . ' branch ' . $this->getRepositoryName() . ': ' . $status[$changeType] . ' branch ' . $shortname); +$mail->setSubject($this->emailPrefix . 'branch ' . $this->getRepositoryName() . ': ' . $status[$changeType] . ' branch ' . $shortname); $message = 'Branch ' . $shortname . ' in ' . $this->getRepositoryName() . ' was ' . $status[$changeType] . 'd' . "\n"; $message .= 'Date: ' . date('r') . "\n"; @@@ -567,7 -500,7 +500,7 @@@ $diff = \Git::gitExec('diff-tree -c -p %s', escapeshellarg($revision)); $mail = new \Mail(); -$mail->setSubject($this->emailPrefix . ' commit ' . $this->getRepositoryName() . ': ' . implode(' ', array_keys($paths))); +$mail->setSubject($this->emailPrefix . 'com ' . $this->getRepositoryName() . ': ' . $info['subject'] . ': '. implode(' ', array_keys($paths))); $message = ''; @@@ -585,7 -518,9 +518,9 @@@ } - if (strlen($pathsString) < 8192) { + if ($pathsString == '') { + $message .= "\nTrivial merge\n"; + } elseif (strlen($pathsString) < 8192) { // inline changed paths $message .= "\nChanged paths:\n" . $pathsString . "\n"; if ((strlen($pathsString) + strlen($diff)) < 8192) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] [git] branch karma.git: update branch master
Branch master in karma.git was updated Date: Tue, 20 Mar 2012 08:42:51 + Link: http://git.php.net/?p=karma.git;a=log;h=3bacfbd956538305c8f604271071d839ecb1f559;hp=11bc19461cfada676edd5852edc529532ef7a3ac Log: Commit: 3bacfbd956538305c8f604271071d839ecb1f559 Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:25:38 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 08:25:38 + Link: http://git.php.net/?p=karma.git;a=commitdiff;h=3bacfbd956538305c8f604271071d839ecb1f559 Shortlog: Merge branch 'master' of git.php.net:/karma Commit: bdcf0e849a28c2b06017f225dd488bd26366bf88 Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:59:37 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:59:37 + Link: http://git.php.net/?p=karma.git;a=commitdiff;h=bdcf0e849a28c2b06017f225dd488bd26366bf88 Shortlog: Add commit message "subject" and change "commit" to "com" to save space. Commit: 3586d1c6652ce0f202daa2894d7862ff4e698140 Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:55:09 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:55:09 + Link: http://git.php.net/?p=karma.git;a=commitdiff;h=3586d1c6652ce0f202daa2894d7862ff4e698140 Shortlog: Removed the .git part of the repository name as specified by the methods docblock. Commit: eb514083bf2a6ddaa0f2404da3d4347d2747a22e Author: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:50:06 + Committer: Derick Rethans(git...@derickrethans.nl) Tue, 20 Mar 2012 07:54:58 + Link: http://git.php.net/?p=karma.git;a=commitdiff;h=eb514083bf2a6ddaa0f2404da3d4347d2747a22e Shortlog: Don't use an email prefix unless specifically configured. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /SVNROOT/ global_avail
derick Tue, 20 Mar 2012 08:30:43 + Revision: http://svn.php.net/viewvc?view=revision&revision=324379 Log: Give myself karma so I can do some work on making commit mails more useful. Changed paths: U SVNROOT/global_avail Modified: SVNROOT/global_avail === --- SVNROOT/global_avail2012-03-20 07:58:19 UTC (rev 324378) +++ SVNROOT/global_avail2012-03-20 08:30:43 UTC (rev 324379) @@ -9,7 +9,7 @@ avail||playground.git # People that have access to the Karma implementation that is usedon git.php.net -avail|dsp,irker|karma.git +avail|dsp,irker,derick|karma.git # Some people also have access to the configuration files in the SVNROOT. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3/Zend/ README.ZEND_MM zend_API.c
On Tue, 6 Mar 2012, Stas Malyshev wrote: > > +Since PHP 5.4 it is possible to prevent shared extensions from unloading > > so > > Since 5.4 doesn't look right in 5.3 upgrading :) ITYM since 5.3.11? Fixed, thanks :-) Derick -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/README.ZEND_MM branches/PHP_5_4/Zend/README.ZEND_MM trunk/Zend/README.ZEND_MM
derick Tue, 06 Mar 2012 18:34:10 + Revision: http://svn.php.net/viewvc?view=revision&revision=323962 Log: Fixed version numbers. Changed paths: U php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM U php/php-src/branches/PHP_5_4/Zend/README.ZEND_MM U php/php-src/trunk/Zend/README.ZEND_MM Modified: php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM === --- php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM2012-03-06 18:25:55 UTC (rev 323961) +++ php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM2012-03-06 18:34:10 UTC (rev 323962) @@ -27,7 +27,7 @@ Shared extensions: -- -Since PHP 5.4 it is possible to prevent shared extensions from unloading so +Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so that valgrind can correctly track the memory leaks in shared extensions. For this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then DL_UNLOAD() is skipped during the shutdown of shared extensions. Modified: php/php-src/branches/PHP_5_4/Zend/README.ZEND_MM === --- php/php-src/branches/PHP_5_4/Zend/README.ZEND_MM2012-03-06 18:25:55 UTC (rev 323961) +++ php/php-src/branches/PHP_5_4/Zend/README.ZEND_MM2012-03-06 18:34:10 UTC (rev 323962) @@ -27,7 +27,7 @@ Shared extensions: -- -Since PHP 5.4 it is possible to prevent shared extensions from unloading so +Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so that valgrind can correctly track the memory leaks in shared extensions. For this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then DL_UNLOAD() is skipped during the shutdown of shared extensions. Modified: php/php-src/trunk/Zend/README.ZEND_MM === --- php/php-src/trunk/Zend/README.ZEND_MM 2012-03-06 18:25:55 UTC (rev 323961) +++ php/php-src/trunk/Zend/README.ZEND_MM 2012-03-06 18:34:10 UTC (rev 323962) @@ -27,7 +27,7 @@ Shared extensions: -- -Since PHP 5.4 it is possible to prevent shared extensions from unloading so +Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so that valgrind can correctly track the memory leaks in shared extensions. For this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then DL_UNLOAD() is skipped during the shutdown of shared extensions. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/Zend/ README.ZEND_MM zend_API.c
derick Tue, 06 Mar 2012 18:25:55 + Revision: http://svn.php.net/viewvc?view=revision&revision=323961 Log: Add the ZEND_DONT_UNLOAD_MODULES environment variable for debugging to 5.3 as well. Changed paths: U php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM U php/php-src/branches/PHP_5_3/Zend/zend_API.c Modified: php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM === --- php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM2012-03-06 17:42:59 UTC (rev 323960) +++ php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM2012-03-06 18:25:55 UTC (rev 323961) @@ -24,6 +24,14 @@ $ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();' +Shared extensions: +-- + +Since PHP 5.4 it is possible to prevent shared extensions from unloading so +that valgrind can correctly track the memory leaks in shared extensions. For +this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then +DL_UNLOAD() is skipped during the shutdown of shared extensions. + Tweaking: - Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c === --- php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-03-06 17:42:59 UTC (rev 323960) +++ php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-03-06 18:25:55 UTC (rev 323961) @@ -2137,7 +2137,7 @@ #if HAVE_LIBDL #if !(defined(NETWARE) && defined(APACHE_1_BUILD)) - if (module->handle) { + if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) { DL_UNLOAD(module->handle); } #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/lib/timezonedb.h branches/PHP_5_4/ext/date/lib/timezonedb.h trunk/ext/date/lib/timezonedb.h
derick Thu, 01 Mar 2012 15:09:49 + Revision: http://svn.php.net/viewvc?view=revision&revision=323706 Log: - Updated to version 2012.1 (2012a) Changed paths: U php/php-src/branches/PHP_5_3/ext/date/lib/timezonedb.h U php/php-src/branches/PHP_5_4/ext/date/lib/timezonedb.h U php/php-src/trunk/ext/date/lib/timezonedb.h -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c
On Mon, 27 Feb 2012, Laruence wrote: > On Mon, Feb 27, 2012 at 4:31 PM, Laruence wrote: > > On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov wrote: > >> > >> The attached patch looks wired. The patch on top of it (r323563) makes it > >> better. However, in my opinion it fixes a common problem just in a single > >> place. Each call to __toString() that makes "side effects" may cause the > >> similar problem. It would be great to make a "right" fix in > >> zend_std_cast_object_tostring() itself, but probably it would require API > > Hi: > > before this fix, I thought about the same idea of that. > > > > but, you know, such change will need all exts who implmented > > their own cast_object handler change there codes too. > > > > for now, I exam the usage of std_cast_object_tostring, most of > > them do the similar things like this fix to avoid this issues(like > > ZEND_CAST handler). > > > > so I think, maybe it's okey for a temporary fix :) > > what I mean temporary is, apply this fix to 5.3 and 5.4 > > then do the "right" fix which you said to 5.4.1 :) You can't break extension APIs between 5.4.0 and 5.4.1 either, API changes can only into trunk. cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/zend_execute_API.c trunk/Zend/zend_execute_API.c
derick Sun, 29 Jan 2012 15:25:40 + Revision: http://svn.php.net/viewvc?view=revision&revision=322922 Log: - Reinstated correct return values after David's fix for #60218. Bug: https://bugs.php.net/60218 (Closed) instantiating unknown class leads to memory leak in cli Changed paths: U php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c U php/php-src/trunk/Zend/zend_execute_API.c Modified: php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c === --- php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c2012-01-29 11:17:07 UTC (rev 322921) +++ php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c2012-01-29 15:25:40 UTC (rev 322922) @@ -1195,8 +1195,11 @@ } CG(interactive) = 0; + retval = SUCCESS; zend_try { - zend_execute(new_op_array TSRMLS_CC); + zend_execute(new_op_array TSRMLS_CC); + } zend_catch { + retval = FAILURE; } zend_end_try(); CG(interactive) = orig_interactive; @@ -1218,7 +1221,6 @@ destroy_op_array(new_op_array TSRMLS_CC); efree(new_op_array); EG(return_value_ptr_ptr) = original_return_value_ptr_ptr; - retval = SUCCESS; } else { retval = FAILURE; } Modified: php/php-src/trunk/Zend/zend_execute_API.c === --- php/php-src/trunk/Zend/zend_execute_API.c 2012-01-29 11:17:07 UTC (rev 322921) +++ php/php-src/trunk/Zend/zend_execute_API.c 2012-01-29 15:25:40 UTC (rev 322922) @@ -1195,8 +1195,11 @@ } CG(interactive) = 0; + retval = SUCCESS; zend_try { zend_execute(new_op_array TSRMLS_CC); + } zend_catch { + retval = FAILURE; } zend_end_try(); CG(interactive) = orig_interactive; @@ -1218,7 +1221,6 @@ destroy_op_array(new_op_array TSRMLS_CC); efree(new_op_array); EG(return_value_ptr_ptr) = original_return_value_ptr_ptr; - retval = SUCCESS; } else { retval = FAILURE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_alloc.c
derick Sun, 29 Jan 2012 11:17:07 + Revision: http://svn.php.net/viewvc?view=revision&revision=322921 Log: CS fixes. Changed paths: U php/php-src/trunk/Zend/zend_alloc.c Modified: php/php-src/trunk/Zend/zend_alloc.c === --- php/php-src/trunk/Zend/zend_alloc.c 2012-01-29 09:20:28 UTC (rev 322920) +++ php/php-src/trunk/Zend/zend_alloc.c 2012-01-29 11:17:07 UTC (rev 322921) @@ -1882,7 +1882,7 @@ size_t segment_size; zend_mm_segment *segment; int keep_rest = 0; -#ifdef ZEND_SIGNALS +#ifdef ZEND_SIGNALS TSRMLS_FETCH(); #endif @@ -2058,7 +2058,7 @@ zend_mm_block *mm_block; zend_mm_block *next_block; size_t size; -#ifdef ZEND_SIGNALS +#ifdef ZEND_SIGNALS TSRMLS_FETCH(); #endif if (!ZEND_MM_VALID_PTR(p)) { @@ -2548,7 +2548,7 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { void *p; -#ifdef ZEND_SIGNALS +#ifdef ZEND_SIGNALS TSRMLS_FETCH(); #endif HANDLE_BLOCK_INTERRUPTIONS(); @@ -2567,7 +2567,7 @@ { int length; char *p; -#ifdef ZEND_SIGNALS +#ifdef ZEND_SIGNALS TSRMLS_FETCH(); #endif @@ -2587,7 +2587,7 @@ ZEND_API char *_estrndup(const char *s, uint length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) { char *p; -#ifdef ZEND_SIGNALS +#ifdef ZEND_SIGNALS TSRMLS_FETCH(); #endif @@ -2608,7 +2608,7 @@ ZEND_API char *zend_strndup(const char *s, uint length) { char *p; -#ifdef ZEND_SIGNALS +#ifdef ZEND_SIGNALS TSRMLS_FETCH(); #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/date/tests/ DateTime_add-fall-type2-type2.phpt
On Tue, 27 Dec 2011, Daniel Convissor wrote: > > Why are you only changing this in the 5.4 branch? > > There are still more changes to be made and I'll merge them all to > trunk and 5.3. Please make those changes in *one* commit in the future. Right now there are inconsistencies between tests (again). cheers, Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/date/tests/ DateTime_add-fall-type2-type2.phpt
On Tue, 27 Dec 2011, Daniel Convissor wrote: > danielc Tue, 27 Dec 2011 02:13:55 + > > Revision: http://svn.php.net/viewvc?view=revision&revision=321419 > > Log: > One less xfail since Bug 55253 was fixed. > > Bug: https://bugs.php.net/55253 (Closed) DateTime::add() and sub() result -1 > hour on objects with time zone type 2 > > Changed paths: > U > php/php-src/branches/PHP_5_4/ext/date/tests/DateTime_add-fall-type2-type2.phpt Why are you only changing this in the 5.4 branch? Derick -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/tests/DateInterval_format_a.phpt branches/PHP_5_4/ext/date/tests/DateInterval_format_a.phpt trunk/ext/date/tests/DateInterval_format_a.phpt
derick Mon, 12 Dec 2011 12:57:46 + Revision: http://svn.php.net/viewvc?view=revision&revision=320890 Log: This test should no longer fail, and is perfectly okay for Linux to test on too. Changed paths: U php/php-src/branches/PHP_5_3/ext/date/tests/DateInterval_format_a.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format_a.phpt U php/php-src/trunk/ext/date/tests/DateInterval_format_a.phpt Modified: php/php-src/branches/PHP_5_3/ext/date/tests/DateInterval_format_a.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/DateInterval_format_a.phpt 2011-12-12 10:56:09 UTC (rev 320889) +++ php/php-src/branches/PHP_5_3/ext/date/tests/DateInterval_format_a.phpt 2011-12-12 12:57:46 UTC (rev 320890) @@ -8,10 +8,7 @@ --SKIPIF-- ---XFAIL-- -Windows VC6 libs' floor()/ceil() choke on floats --FILE-- ---XFAIL-- -Windows VC6 libs' floor()/ceil() choke on floats --FILE-- ---XFAIL-- -Windows VC6 libs' floor()/ceil() choke on floats --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/tests/bug48476.phpt branches/PHP_5_3/ext/date/tests/bug48678.phpt branches/PHP_5_3/ext/date/tests/bug50392.phpt branches/PHP_5_3/ext/date/tests/b
derick Wed, 07 Dec 2011 19:42:44 + Revision: http://svn.php.net/viewvc?view=revision&revision=320605 Log: Test cosmetics. Changed paths: U php/php-src/branches/PHP_5_3/ext/date/tests/bug48476.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug50392.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug51096.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug52062-64bit.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug52113.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug53437.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug53502.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug54597.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug54851.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug55253.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug60236.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug48476.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug48678.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug50392.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug51096.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug52062-64bit.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug52062.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug52113.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug53437.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug53502.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug54597.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug54851.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug55253.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug60236.phpt U php/php-src/trunk/ext/date/tests/bug48476.phpt U php/php-src/trunk/ext/date/tests/bug48678.phpt U php/php-src/trunk/ext/date/tests/bug50392.phpt U php/php-src/trunk/ext/date/tests/bug51096.phpt U php/php-src/trunk/ext/date/tests/bug52062-64bit.phpt U php/php-src/trunk/ext/date/tests/bug52062.phpt U php/php-src/trunk/ext/date/tests/bug52113.phpt U php/php-src/trunk/ext/date/tests/bug53437.phpt U php/php-src/trunk/ext/date/tests/bug53502.phpt U php/php-src/trunk/ext/date/tests/bug54597.phpt U php/php-src/trunk/ext/date/tests/bug54851.phpt U php/php-src/trunk/ext/date/tests/bug55253.phpt U php/php-src/trunk/ext/date/tests/bug60236.phpt Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug48476.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/bug48476.phpt 2011-12-07 19:24:58 UTC (rev 320604) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug48476.phpt 2011-12-07 19:42:44 UTC (rev 320605) @@ -1,5 +1,5 @@ --TEST-- -Bug#48476 (cloning extended DateTime class without calling parent::__constr crashed PHP) +Bug #48476 (cloning extended DateTime class without calling parent::__constr crashed PHP) --FILE-- --FILE-- Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug60236.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/bug60236.phpt 2011-12-07 19:24:58 UTC (rev 320604) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug60236.phpt 2011-12-07 19:42:44 UTC (rev 320605) @@ -1,5 +1,5 @@ --TEST-- -Bug #60236: TLA timezone dates are not converted properly from timestamp +Bug #60236 (TLA timezone dates are not converted properly from timestamp) --INI-- date.timezone=America/New_York --FILE-- Modified: php/php-src/branches/PHP_5_4/ext/date/tests/bug48476.phpt === --- php/php-src/branches/PHP_5_4/ext/date/tests/bug48476.phpt 2011-12-07 19:24:58 UTC (rev 320604) +++ php/php-src/branches/PHP_5_4/ext/date/tests/bug48476.phpt 2011-12-07 19:42:44 UTC (rev 320605) @@ -1,5 +1,5 @@ --TEST-- -Bug#48476 (cloning extended DateTime class without calling parent::__constr crashed PHP) +Bug #48476 (cloning extended DateTime class without calling parent::__constr crashed PHP) --FILE-- --FILE-- Modified: php/php-src/branches/PHP_5_4/ext/date/tests/bug60236.phpt === --- php/php-src/branches/PHP_5_4/ext/date/tests/bug60236.phpt 2011-12-07 19:24:58 UTC (rev 320604) +++ php/php-src/branches/PHP_5_4/ext/date/tests/bug60236.phpt 2011-12-07 19:42:44 UTC (rev 320605) @@ -1,5 +1,5 @@ --TEST-- -Bug #60236: TLA timezone dates are not converted properly from timestamp +Bug #60236 (TLA timezone dates are not converted properly from timestamp) --INI-- date.timezone=America/New_York --FILE-- Modified: php/php-src/trunk/ext/date/tests/bug48476.phpt
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/tests/bug28088.phpt branches/PHP_5_3/ext/date/tests/bug33415-2.phpt branches/PHP_5_3/ext/date/tests/bug51223.phpt branches/PHP_5_3/ext/date/tests
derick Wed, 07 Dec 2011 19:24:58 + Revision: http://svn.php.net/viewvc?view=revision&revision=320604 Log: Sorting out the tests *once* more. Please keep them consistent and only change them if you are 110% certain what you're doing. Otherwise -> please ask. Changed paths: U php/php-src/branches/PHP_5_3/ext/date/tests/bug28088.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug33415-2.phpt D php/php-src/branches/PHP_5_3/ext/date/tests/bug51223.phpt A php/php-src/branches/PHP_5_3/ext/date/tests/bug52062-64bit.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt A + php/php-src/branches/PHP_5_3/ext/date/tests/bug52113.phpt (from php/php-src/branches/PHP_5_3/ext/date/tests/bug51223.phpt:r320599) U php/php-src/branches/PHP_5_3/ext/date/tests/bug53502.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/gmstrftime_variation22.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/strftime_variation22.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format.phpt A php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format_a.phpt A php/php-src/branches/PHP_5_4/ext/date/tests/bug52062-64bit.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug52062.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug53502.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/date_default_timezone_set-1.phpt U php/php-src/trunk/ext/date/tests/DateInterval_format.phpt A php/php-src/trunk/ext/date/tests/DateInterval_format_a.phpt A php/php-src/trunk/ext/date/tests/bug52062-64bit.phpt U php/php-src/trunk/ext/date/tests/bug52062.phpt U php/php-src/trunk/ext/date/tests/bug53502.phpt Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug28088.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/bug28088.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug28088.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -1,9 +1,9 @@ --TEST-- Bug #28088 (strtotime() cannot convert 00 hours") +--INI-- +date.timezone=UTC --FILE-- diff($end); -$p = new DatePeriod($start, $diff, 2); -$diff_s = serialize($diff); -var_dump($diff, $diff_s); -var_export($diff); - -$diff_un = unserialize($diff_s); -$p = new DatePeriod($start, $diff_un, 2); -var_dump($diff_un, $p); - -$unser = DateInterval::__set_state(array( - 'y' => 7, - 'm' => 6, - 'd' => 5, - 'h' => 4, - 'i' => 3, - 's' => 2, - 'invert' => 1, - 'days' => 2400, -)); - -$p = new DatePeriod($start, $diff_un, 2); -var_dump($unser, $p); - -?> ---EXPECT-- -object(DateInterval)#3 (8) { - ["y"]=> - int(0) - ["m"]=> - int(0) - ["d"]=> - int(0) - ["h"]=> - int(4) - ["i"]=> - int(0) - ["s"]=> - int(0) - ["invert"]=> - int(0) - ["days"]=> - int(0) -} -string(128) "O:12:"DateInterval":8:{s:1:"y";i:0;s:1:"m";i:0;s:1:"d";i:0;s:1:"h";i:4;s:1:"i";i:0;s:1:"s";i:0;s:6:"invert";i:0;s:4:"days";i:0;}" -DateInterval::__set_state(array( - 'y' => 0, - 'm' => 0, - 'd' => 0, - 'h' => 4, - 'i' => 0, - 's' => 0, - 'invert' => 0, - 'days' => 0, -))object(DateInterval)#5 (8) { - ["y"]=> - int(0) - ["m"]=> - int(0) - ["d"]=> - int(0) - ["h"]=> - int(4) - ["i"]=> - int(0) - ["s"]=> - int(0) - ["invert"]=> - int(0) - ["days"]=> - int(0) -} -object(DatePeriod)#6 (0) { -} -object(DateInterval)#4 (8) { - ["y"]=> - int(7) - ["m"]=> - int(6) - ["d"]=> - int(5) - ["h"]=> - int(4) - ["i"]=> - int(3) - ["s"]=> - int(2) - ["invert"]=> - int(1) - ["days"]=> - int(2400) -} -object(DatePeriod)#7 (0) { -} Added: php/php-src/branches/PHP_5_3/ext/date/tests/bug52062-64bit.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/bug52062-64bit.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug52062-64bit.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -0,0 +1,27 @@ +--TEST-- +Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp (64 bit) +--SKIPIF-- + +--INI-- +date.timezone=UTC +--FILE-- +format('Y-m-d H:i:s U')); +var_dump($d->getTimestamp()); + +$d->setTimestamp(1000); +var_dump($d->format('Y-m-d H:i:s U')); +var_dump($d->getTimestamp()); + +$i = new DateInterval('PT1000S'); +var_dump($i->format('%s')); +?> +--EXPECT-- +string(32) "5138-11-16 09:46:40 1000" +int(1000) +string(32) "5138-11-16 09:46:40 1000" +int(1000) +string(12) "1000" Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt 2011-12-07 19:22:44 UTC (rev 320603) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt 2011-12-07 19:24:58 UTC (rev 320604) @@ -1,5 +1,11 @@ --TEST
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/tests/bug48678.phpt branches/PHP_5_3/ext/date/tests/date_default_timezone_set-1.phpt branches/PHP_5_4/ext/date/tests/bug48678.phpt trunk/ext/
On Wed, 7 Dec 2011, Pierre Joye wrote: > pajoye Wed, 07 Dec 2011 09:03:07 + > > Revision: http://svn.php.net/viewvc?view=revision&revision=320564 > > Log: - print_r seems to display 0 or nothing for days, let make that > test works in both cases, that's not the purpose of this test to test > print_r This is actually a bug that I haven't fixed yet. 0 is int 0, and nothing is false. It should return false, but right now it doesn't. Could you revert this changes, as there is a real bug in the code (and I'd rather fix the bug, then hide it with a passing test :)). > > Changed paths: > U php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt > U > php/php-src/branches/PHP_5_3/ext/date/tests/date_default_timezone_set-1.phpt > U php/php-src/branches/PHP_5_4/ext/date/tests/bug48678.phpt > U php/php-src/trunk/ext/date/tests/bug48678.phpt > > Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt > === > --- php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt 2011-12-07 > 08:39:43 UTC (rev 320563) > +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt 2011-12-07 > 09:03:07 UTC (rev 320564) > @@ -6,7 +6,7 @@ > print_r($x); > $y = unserialize(serialize($x)); > print_r($y); > ---EXPECT-- > +--EXPECTF-- > DateInterval Object > ( > [y] => 3 > @@ -16,7 +16,7 @@ > [i] => 30 > [s] => 5 > [invert] => 0 > -[days] => > +[days] =>%s > ) > DateInterval Object > ( > @@ -27,5 +27,5 @@ > [i] => 30 > [s] => 5 > [invert] => 0 > -[days] => > +[days] =>%s > ) > > Modified: > php/php-src/branches/PHP_5_3/ext/date/tests/date_default_timezone_set-1.phpt > === > --- > php/php-src/branches/PHP_5_3/ext/date/tests/date_default_timezone_set-1.phpt > 2011-12-07 08:39:43 UTC (rev 320563) > +++ > php/php-src/branches/PHP_5_3/ext/date/tests/date_default_timezone_set-1.phpt > 2011-12-07 09:03:07 UTC (rev 320564) > @@ -1,5 +1,9 @@ > --TEST-- > date_default_timezone_set() function [1] > +--SKIPIF-- > + +if (substr(PHP_OS, 0, 3) == 'WIN') die('skip diff TZ detection on windows.'); > +?> > --INI-- > date.timezone= > --FILE-- > > Modified: php/php-src/branches/PHP_5_4/ext/date/tests/bug48678.phpt > === > --- php/php-src/branches/PHP_5_4/ext/date/tests/bug48678.phpt 2011-12-07 > 08:39:43 UTC (rev 320563) > +++ php/php-src/branches/PHP_5_4/ext/date/tests/bug48678.phpt 2011-12-07 > 09:03:07 UTC (rev 320564) > @@ -6,7 +6,7 @@ > print_r($x); > $y = unserialize(serialize($x)); > print_r($y); > ---EXPECT-- > +--EXPECTF-- > DateInterval Object > ( > [y] => 3 > @@ -16,7 +16,7 @@ > [i] => 30 > [s] => 5 > [invert] => 0 > -[days] => > +[days] =>%s > ) > DateInterval Object > ( > @@ -27,5 +27,5 @@ > [i] => 30 > [s] => 5 > [invert] => 0 > -[days] => > +[days] =>%s > ) > > Modified: php/php-src/trunk/ext/date/tests/bug48678.phpt > === > --- php/php-src/trunk/ext/date/tests/bug48678.phpt2011-12-07 08:39:43 UTC > (rev 320563) > +++ php/php-src/trunk/ext/date/tests/bug48678.phpt2011-12-07 09:03:07 UTC > (rev 320564) > @@ -6,7 +6,7 @@ > print_r($x); > $y = unserialize(serialize($x)); > print_r($y); > ---EXPECT-- > +--EXPECTF-- > DateInterval Object > ( > [y] => 3 > @@ -16,7 +16,7 @@ > [i] => 30 > [s] => 5 > [invert] => 0 > -[days] => > +[days] =>%s > ) > DateInterval Object > ( > @@ -27,5 +27,5 @@ > [i] => 30 > [s] => 5 > [invert] => 0 > -[days] => > +[days] =>%s > ) > > -- http://derickrethans.nl | http://xdebug.org Like Xdebug? Consider a donation: http://xdebug.org/donate.php twitter: @derickr and @xdebug -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS
derick Tue, 06 Dec 2011 06:23:13 + Revision: http://svn.php.net/viewvc?view=revision&revision=320482 Log: - Fixed bug number. Changed paths: U php/php-src/branches/PHP_5_3/NEWS Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-12-06 06:21:08 UTC (rev 320481) +++ php/php-src/branches/PHP_5_3/NEWS 2011-12-06 06:23:13 UTC (rev 320482) @@ -49,7 +49,7 @@ DateTime::setTimestamp). (Derick) . Fixed bug #51994 (date_parse_from_format is parsing invalid date using 'yz' format). (Derick) - . Fixed bug #51223 (Seg fault while creating (by unserialization) + . Fixed bug #52113 (Seg fault while creating (by unserialization) DatePeriod). (Derick) - EXIF: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/date/tests/ date.phpt mktime-2.phpt timezone-configuration.phpt
derick Tue, 06 Dec 2011 06:13:41 + Revision: http://svn.php.net/viewvc?view=revision&revision=320480 Log: Make tests similar to the ones in 5.4 and trunk. Changed paths: U php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/mktime-2.phpt U php/php-src/branches/PHP_5_3/ext/date/tests/timezone-configuration.phpt Modified: php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt 2011-12-06 06:07:41 UTC (rev 320479) +++ php/php-src/branches/PHP_5_3/ext/date/tests/date.phpt 2011-12-06 06:13:41 UTC (rev 320480) @@ -3,22 +3,14 @@ --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/tests/bug53437.phpt branches/PHP_5_4/ext/date/tests/bug53437.phpt trunk/ext/date/tests/bug53437.phpt
derick Tue, 06 Dec 2011 06:07:41 + Revision: http://svn.php.net/viewvc?view=revision&revision=320479 Log: - Added a test case for #53437. Bug: https://bugs.php.net/53437 (Assigned) Crash when using unserialized DatePeriod instance Changed paths: A php/php-src/branches/PHP_5_3/ext/date/tests/bug53437.phpt A php/php-src/branches/PHP_5_4/ext/date/tests/bug53437.phpt A php/php-src/trunk/ext/date/tests/bug53437.phpt Added: php/php-src/branches/PHP_5_3/ext/date/tests/bug53437.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/bug53437.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug53437.phpt 2011-12-06 06:07:41 UTC (rev 320479) @@ -0,0 +1,28 @@ +--TEST-- +Bug #53437: Crash when using unserialized DatePeriod instance +--XFAIL-- +Bug #53437 Not fixed yet +--FILE-- +format('Y-m-d H:i:s')."\r\n"; +} +echo "\r\n"; +var_dump($dp); + +$ser = serialize($dp); // $ser is: O:10:"DatePeriod":0:{} + +// Create dangerous instance +$dpu = unserialize($ser); // $dpu has invalid values??? +var_dump($dpu); + +echo "Unserialized:\r\n"; +// ???which leads to CRASH: +foreach($dpu as $dt) { +echo $dt->format('Y-m-d H:i:s')."\r\n"; +} +?> +--EXPECT-- Added: php/php-src/branches/PHP_5_4/ext/date/tests/bug53437.phpt === --- php/php-src/branches/PHP_5_4/ext/date/tests/bug53437.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/ext/date/tests/bug53437.phpt 2011-12-06 06:07:41 UTC (rev 320479) @@ -0,0 +1,28 @@ +--TEST-- +Bug #53437: Crash when using unserialized DatePeriod instance +--XFAIL-- +Bug #53437 Not fixed yet +--FILE-- +format('Y-m-d H:i:s')."\r\n"; +} +echo "\r\n"; +var_dump($dp); + +$ser = serialize($dp); // $ser is: O:10:"DatePeriod":0:{} + +// Create dangerous instance +$dpu = unserialize($ser); // $dpu has invalid values??? +var_dump($dpu); + +echo "Unserialized:\r\n"; +// ???which leads to CRASH: +foreach($dpu as $dt) { +echo $dt->format('Y-m-d H:i:s')."\r\n"; +} +?> +--EXPECT-- Added: php/php-src/trunk/ext/date/tests/bug53437.phpt === --- php/php-src/trunk/ext/date/tests/bug53437.phpt (rev 0) +++ php/php-src/trunk/ext/date/tests/bug53437.phpt 2011-12-06 06:07:41 UTC (rev 320479) @@ -0,0 +1,28 @@ +--TEST-- +Bug #53437: Crash when using unserialized DatePeriod instance +--XFAIL-- +Bug #53437 Not fixed yet +--FILE-- +format('Y-m-d H:i:s')."\r\n"; +} +echo "\r\n"; +var_dump($dp); + +$ser = serialize($dp); // $ser is: O:10:"DatePeriod":0:{} + +// Create dangerous instance +$dpu = unserialize($ser); // $dpu has invalid values??? +var_dump($dpu); + +echo "Unserialized:\r\n"; +// ???which leads to CRASH: +foreach($dpu as $dt) { +echo $dt->format('Y-m-d H:i:s')."\r\n"; +} +?> +--EXPECT-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/lib/parse_iso_intervals.c branches/PHP_5_3/ext/date/lib/parse_iso_intervals.re branches/PHP_5_3/ext/date/tests/bug52062.phpt branches/PHP_5_4/ext
derick Tue, 06 Dec 2011 06:04:24 + Revision: http://svn.php.net/viewvc?view=revision&revision=320478 Log: - Fixed bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp. Bug: https://bugs.php.net/52062 (Assigned) large timestamps with DateTime::getTimestamp and DateTime::setTimestamp Changed paths: U php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.c U php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.re A php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt U php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.c U php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.re A php/php-src/branches/PHP_5_4/ext/date/tests/bug52062.phpt U php/php-src/trunk/ext/date/lib/parse_iso_intervals.c U php/php-src/trunk/ext/date/lib/parse_iso_intervals.re A php/php-src/trunk/ext/date/tests/bug52062.phpt Modified: php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.c === --- php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.c 2011-12-06 06:00:45 UTC (rev 320477) +++ php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.c 2011-12-06 06:04:24 UTC (rev 320478) @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sat Nov 13 14:57:59 2010 */ +/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:31 2011 */ #line 1 "ext/date/lib/parse_iso_intervals.re" /* +--+ @@ -396,7 +396,7 @@ break; } - nr = timelib_get_unsigned_nr((char **) &ptr, 9); + nr = timelib_get_unsigned_nr((char **) &ptr, 12); switch (*ptr) { case 'Y': s->period->y = nr; break; case 'W': s->period->d = nr * 7; break; Modified: php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.re === --- php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.re 2011-12-06 06:00:45 UTC (rev 320477) +++ php/php-src/branches/PHP_5_3/ext/date/lib/parse_iso_intervals.re 2011-12-06 06:04:24 UTC (rev 320478) @@ -364,7 +364,7 @@ break; } - nr = timelib_get_unsigned_nr((char **) &ptr, 9); + nr = timelib_get_unsigned_nr((char **) &ptr, 12); switch (*ptr) { case 'Y': s->period->y = nr; break; case 'W': s->period->d = nr * 7; break; Added: php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug52062.phpt 2011-12-06 06:04:24 UTC (rev 320478) @@ -0,0 +1,21 @@ +--TEST-- +Bug #52062: large timestamps with DateTime::getTimestamp and DateTime::setTimestamp +--FILE-- +format('Y-m-d H:i:s U')); +var_dump($d->getTimestamp()); + +$d->setTimestamp(1000); +var_dump($d->format('Y-m-d H:i:s U')); +var_dump($d->getTimestamp()); + +$i = new DateInterval('PT1000S'); +var_dump($i->format('%s')); +?> +--EXPECT-- +string(32) "5138-11-16 09:46:40 1000" +int(1000) +string(32) "5138-11-16 09:46:40 1000" +int(1000) +string(12) "1000" Modified: php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.c === --- php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.c 2011-12-06 06:00:45 UTC (rev 320477) +++ php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.c 2011-12-06 06:04:24 UTC (rev 320478) @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sat Nov 13 14:56:07 2010 */ +/* Generated by re2c 0.13.5 on Mon Dec 5 22:02:27 2011 */ #line 1 "ext/date/lib/parse_iso_intervals.re" /* +--+ @@ -396,7 +396,7 @@ break; } - nr = timelib_get_unsigned_nr((char **) &ptr, 9); + nr = timelib_get_unsigned_nr((char **) &ptr, 12); switch (*ptr) { case 'Y': s->period->y = nr; break; case 'W': s->period->d = nr * 7; break; Modified: php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.re === --- php/php-src/branches/PHP_5_4/ext/date/lib/parse_iso_intervals.re 2011-12-06 06:00:45 UTC (rev 320477) +++ php/php-src/branches/PHP_5_4/ext/dat
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/tests/bug48678.phpt branches/PHP_5_4/ext/date/tests/bug48678.phpt trunk/ext/date/tests/bug48678.phpt
derick Tue, 06 Dec 2011 06:00:45 + Revision: http://svn.php.net/viewvc?view=revision&revision=320477 Log: - Cosmetics for test case for #48678. Bug: https://bugs.php.net/48678 (Closed) DateInterval segfaults when unserialising Changed paths: U php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt U php/php-src/branches/PHP_5_4/ext/date/tests/bug48678.phpt U php/php-src/trunk/ext/date/tests/bug48678.phpt Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt 2011-12-06 05:59:24 UTC (rev 320476) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt 2011-12-06 06:00:45 UTC (rev 320477) @@ -1,8 +1,8 @@ --TEST-- -Bug #48678 DateInterval segfaults when unserialising +Bug #48678: DateInterval segfaults when unserialising --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php