[PHP-CVS] com php-src: Always reset those parameters.: ext/date/lib/unixtime2tm.c

2013-11-29 Thread Derick Rethans
Commit:261c6b31ca748fd97a105314ec78a166b2639db9
Author:Derick Rethans git...@derickrethans.nl 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: 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

2013-11-29 Thread Derick Rethans
Commit:aa26ace21f1457bfcc5faf417d9d453b82944aba
Author:Derick Rethans git...@derickrethans.nl 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 dani...@php.net
+--FILE--
+?php
+
+date_default_timezone_set('America/New_York');
+$date_format = 'Y-m-d H:i:s T e';
+$interval_format = 'P%dDT%hH';
+
+/*
+ * Backward Transitions, add().
+ */
+
+$start = new DateTime('2010-11-07 01:59:59');
+$interval_spec = 'PT1S';
+$interval = new DateInterval($interval_spec);
+echo 'ba1 ' . $start-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 America/New_York + PT23H = 2010-11-07 02:30:00 EST 
America/New_York
+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

[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/date/lib/timelib.h ext/date/php_date.c

2013-11-29 Thread Derick Rethans
Commit:88067b6e60a1813aa6bb97e41c2e33c19019fbf5
Author:Derick Rethans git...@derickrethans.nl 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: Fixed Forward Transition construction of DateTime objects.: ext/date/php_date.c ext/date/tests/forward-transition-construction.phpt

2013-11-29 Thread Derick Rethans
Commit:44a9e6b4843de686eab2e2bfa66bdf17ed685d7e
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+date_default_timezone_set('America/New_York');
+
+$date = new DateTime('2010-03-14 01:30:00');
+echo $date-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: 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

2013-11-29 Thread Derick Rethans
Commit:582f6e529e843b412d582023bf0270e47b1aa468
Author:Derick Rethans git...@derickrethans.nl 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 dani...@php.net
 ?php
 
 date_default_timezone_set('America/New_York');
+$tz = new DateTimeZone('America/New_York');
 $date_format = 'Y-m-d H:i:s T e';
 $interval_format = 'P%dDT%hH';
 
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt 
b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
index 4b3c254..f8066ae 100644
--- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
@@ -62,4 +62,4 @@ fs3 2010-03-14 03:30:00 EDT America/New_York - PT22H = 
2010-03-13 04:30:00 EST A
 fs4 2010-03-14 01:30:00

[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

2013-11-29 Thread Derick Rethans
Commit:5d0c526199add0e4f054a57db29d882c8ad89a23
Author:Derick Rethans git...@derickrethans.nl 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);
-   timelib_update_from_sse(dateobj-time);
-   dateobj-time-have_relative = 0;
+   new_time = timelib_add(dateobj-time, intobj-diff);
+   timelib_time_dtor(dateobj-time);
+   dateobj-time = new_time;
 
RETURN_ZVAL(object, 1, 0);
 }
@@ -2933,7 +2915,7 @@ PHP_FUNCTION(date_sub)
zval *object, *interval

[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

2013-11-29 Thread Derick Rethans
Commit:aab0b2ce3b8641848e7e92b9e5c4db044004133d
Author:Derick Rethans git...@derickrethans.nl 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 dani...@php.net
+--XFAIL--
+Still not quite right
 --FILE--
 ?php
 
diff --git a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt 
b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
index f8066ae..72351d3 100644
--- a/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
+++ b/ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt
@@ -2,6 +2,8 @@
 RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fs)
 --CREDITS--
 Daniel Convissor dani...@php.net
+--XFAIL--
+Still not quite right
 --FILE--
 ?php


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS Zend/zend_execute_API.c

2013-11-29 Thread Derick Rethans
On Fri, 29 Nov 2013, Dmitry Stogov wrote:

 Commit:967abd61537a2c7d0beebac9039aa068d518e4eb
 Author:Dmitry Stogov dmi...@zend.com 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: Fix backwards transition diffs.: ext/date/lib/interval.c

2013-11-28 Thread Derick Rethans
Commit:324e6a5f82d830cf46e0cf35f82c44253b8bd2cf
Author:Derick Rethans git...@derickrethans.nl 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

2013-11-28 Thread Derick Rethans
Commit:7a0df7be34d35e91406b9654cb7be1de9b8720c1
Author:Derick Rethans git...@derickrethans.nl 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 dani...@php.net
---XFAIL--
-RFC not implemented yet
 --FILE--
 ?php
 
@@ -155,11 +153,10 @@ $tz = new DateTimeZone('America/New_York');
  * Backward Transitions, diff().
  */
 
-$end   = new DateTime('2010-11-07 01:00:00 EST');
-$end-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

2013-11-28 Thread Derick Rethans
Commit:6e8b2c91c4a9e8ceab5930bbfe6b18cfb9689f3a
Author:Derick Rethans git...@derickrethans.nl 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

2013-09-27 Thread Derick Rethans
Commit:9ef4e5d23d331227cbc3dfed04f9702b8012e1ef
Author:Derick Rethans git...@derickrethans.nl 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

2013-07-09 Thread Derick Rethans
Commit:c7ee677f2f330bbcc8721b6a84dd3a05dc0c5541
Author:Derick Rethans git...@derickrethans.nl 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

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

2013-06-10 Thread Derick Rethans
On Mon, 10 Jun 2013, Anatol Belski wrote:

 Commit:ec790753948d190db354cbce97786b4a1aac63fc
 Author:Anatol Belski a...@php.net 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--
 +?php
 + 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: 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

2013-03-31 Thread Derick Rethans
Commit:68a7fec7af2c8976820ae06063a112db6da82605
Author:Derick Rethans git...@derickrethans.nl Sun, 31 Mar 2013 
10:37:16 +0100
Parents:   0e25e00ecf74bcc1a9e14eac25bd7d7cc4857c24
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=68a7fec7af2c8976820ae06063a112db6da82605

Log:
Make DateTime and DateTimeImmutable siblings.

They both implement the DateTimeInterface interface, which specifies the
non-modifying methods of DateTime/DateTimeImmutable.

Changed paths:
  M  ext/date/php_date.c
  M  ext/date/tests/DatePeriod_wrong_constructor.phpt
  M  ext/date/tests/date_format_error.phpt
  M  ext/date/tests/date_format_variation1.phpt
  M  ext/date/tests/date_offset_get_error.phpt
  M  ext/date/tests/date_offset_get_variation1.phpt
  M  ext/date/tests/date_timestamp_get.phpt
  M  ext/date/tests/date_timezone_get_error.phpt
  M  ext/date/tests/date_timezone_get_variation1.phpt

diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index a073aa6..c61a4d3 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -444,6 +444,16 @@ const zend_function_entry date_functions[] = {
PHP_FE_END
 };
 
+static const zend_function_entry date_funcs_interface[] = {
+   PHP_ABSTRACT_ME(DateTimeInterface, format, arginfo_date_method_format)
+   PHP_ABSTRACT_ME(DateTimeInterface, getTimezone, 
arginfo_date_method_timezone_get)
+   PHP_ABSTRACT_ME(DateTimeInterface, getOffset, 
arginfo_date_method_offset_get)
+   PHP_ABSTRACT_ME(DateTimeInterface, getTimestamp, 
arginfo_date_method_timestamp_get)
+   PHP_ABSTRACT_ME(DateTimeInterface, diff, arginfo_date_method_diff)
+   PHP_ABSTRACT_ME(DateTimeInterface, __wakeup, NULL)
+   PHP_FE_END
+};
+
 const zend_function_entry date_funcs_date[] = {
PHP_ME(DateTime,__construct,
arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
PHP_ME(DateTime,__wakeup,   
NULL, ZEND_ACC_PUBLIC)
@@ -468,7 +478,15 @@ const zend_function_entry date_funcs_date[] = {
 
 const zend_function_entry date_funcs_immutable[] = {
PHP_ME(DateTimeImmutable, __construct,   arginfo_date_create, 
ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
+   PHP_ME(DateTime, __wakeup,   NULL, ZEND_ACC_PUBLIC)
PHP_ME(DateTimeImmutable, __set_state,   NULL, 
ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+   PHP_ME_MAPPING(createFromFormat, date_create_from_format, 
arginfo_date_create_from_format, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+   PHP_ME_MAPPING(getLastErrors,date_get_last_errors,
arginfo_date_get_last_errors, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
+   PHP_ME_MAPPING(format,   date_format, 
arginfo_date_method_format, 0)
+   PHP_ME_MAPPING(getTimezone, date_timezone_get,  
arginfo_date_method_timezone_get, 0)
+   PHP_ME_MAPPING(getOffset,   date_offset_get,
arginfo_date_method_offset_get, 0)
+   PHP_ME_MAPPING(getTimestamp,date_timestamp_get, 
arginfo_date_method_timestamp_get, 0)
+   PHP_ME_MAPPING(diff,date_diff, 
arginfo_date_method_diff, 0)
PHP_ME(DateTimeImmutable, modify,arginfo_date_method_modify, 0)
PHP_ME(DateTimeImmutable, add,   arginfo_date_method_add, 0)
PHP_ME(DateTimeImmutable, sub,   arginfo_date_method_sub, 0)
@@ -540,7 +558,7 @@ PHP_INI_END()
 /* }}} */
 
 zend_class_entry *date_ce_date, *date_ce_timezone, *date_ce_interval, 
*date_ce_period;
-zend_class_entry *date_ce_immutable;
+zend_class_entry *date_ce_immutable, *date_ce_interface;
 
 
 PHPAPI zend_class_entry *php_date_get_date_ce(void)
@@ -1955,7 +1973,10 @@ zend_object_iterator 
*date_object_period_get_iterator(zend_class_entry *ce, zval
 
 static void date_register_classes(TSRMLS_D)
 {
-   zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, 
ce_period;
+   zend_class_entry ce_date, ce_immutable, ce_timezone, ce_interval, 
ce_period, ce_interface;
+
+   INIT_CLASS_ENTRY(ce_interface, DateTimeInterface, 
date_funcs_interface);
+   date_ce_interface = zend_register_internal_interface(ce_interface 
TSRMLS_CC);
 
INIT_CLASS_ENTRY(ce_date, DateTime, date_funcs_date);
ce_date.create_object = date_object_new_date;
@@ -1965,6 +1986,7 @@ static void date_register_classes(TSRMLS_D)
date_object_handlers_date.compare_objects = date_object_compare_date;
date_object_handlers_date.get_properties = date_object_get_properties;
date_object_handlers_date.get_gc = date_object_get_gc;
+   zend_class_implements(date_ce_date TSRMLS_CC, 1, date_ce_interface);
 
 #define REGISTER_DATE_CLASS_CONST_STRING(const_name, value) \
zend_declare_class_constant_stringl(date_ce_date, const_name, 
sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC);
@@ -1983,11 +2005,12 @@ static void date_register_classes(TSRMLS_D)
 
INIT_CLASS_ENTRY(ce_immutable, DateTimeImmutable, 
date_funcs_immutable

[PHP-CVS] com php-src: Added the new .c files as well as they are not automatically regenerated.: ext/date/lib/parse_date.c ext/date/lib/parse_iso_intervals.c

2013-03-31 Thread Derick Rethans
Commit:84208d9dc550e7feab7c44d5e4ea3061a5952dab
Author:Derick Rethans git...@derickrethans.nl Sun, 31 Mar 2013 
10:55:45 +0100
Parents:   58a8013e5ff8174aeac4cb38c50c435de9ea5622
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=84208d9dc550e7feab7c44d5e4ea3061a5952dab

Log:
Added the new .c files as well as they are not automatically regenerated.

Changed paths:
  M  ext/date/lib/parse_date.c
  M  ext/date/lib/parse_iso_intervals.c

diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c
index 90622f9..e8f393f 100644
--- a/ext/date/lib/parse_date.c
+++ b/ext/date/lib/parse_date.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 */
+/* Generated by re2c 0.13.5 on Sun Mar 31 10:47:54 2013 */
 #line 1 ext/date/lib/parse_date.re
 /*
+--+
@@ -170,8 +170,6 @@ typedef struct _timelib_relunit {
int multiplier;
 } timelib_relunit;
 
-#define HOUR(a) (int)(a * 60)
-
 /* The timezone table. */
 const static timelib_tz_lookup_table timelib_timezone_lookup[] = {
 #include timezonemap.h
@@ -532,39 +530,6 @@ static timelib_ull timelib_get_unsigned_nr(char **ptr, int 
max_length)
return dir * timelib_get_nr(ptr, max_length);
 }
 
-static long timelib_parse_tz_cor(char **ptr)
-{
-   char *begin = *ptr, *end;
-   long  tmp;
-
-   while (isdigit(**ptr) || **ptr == ':') {
-   ++*ptr;
-   }
-   end = *ptr;
-   switch (end - begin) {
-   case 1:
-   case 2:
-   return HOUR(strtol(begin, NULL, 10));
-   break;
-   case 3:
-   case 4:
-   if (begin[1] == ':') {
-   tmp = HOUR(strtol(begin, NULL, 10)) + 
strtol(begin + 2, NULL, 10);
-   return tmp;
-   } else if (begin[2] == ':') {
-   tmp = HOUR(strtol(begin, NULL, 10)) + 
strtol(begin + 3, NULL, 10);
-   return tmp;
-   } else {
-   tmp = strtol(begin, NULL, 10);
-   return HOUR(tmp / 100) + tmp % 100;
-   }
-   case 5:
-   tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, 
NULL, 10);
-   return tmp;
-   }
-   return 0;
-}
-
 static timelib_sll timelib_lookup_relative_text(char **ptr, int *behavior)
 {
char *word;
@@ -871,11 +836,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper 
tz_get_wrapper)
 std:
s-tok = cursor;
s-len = 0;
-#line 997 ext/date/lib/parse_date.re
+#line 962 ext/date/lib/parse_date.re
 
 
 
-#line 879 ext/date/lib/parse_date.c
+#line 844 ext/date/lib/parse_date.c
 {
YYCTYPE yych;
unsigned int yyaccept = 0;
@@ -995,7 +960,7 @@ std:
}
 yy2:
YYDEBUG(2, *YYCURSOR);
-#line 1083 ext/date/lib/parse_date.re
+#line 1048 ext/date/lib/parse_date.re
{
DEBUG_OUTPUT(firstdayof | lastdayof);
TIMELIB_INIT;
@@ -1011,7 +976,7 @@ yy2:
TIMELIB_DEINIT;
return TIMELIB_LF_DAY_OF_MONTH;
}
-#line 1015 ext/date/lib/parse_date.c
+#line 980 ext/date/lib/parse_date.c
 yy3:
YYDEBUG(3, *YYCURSOR);
++YYCURSOR;
@@ -1034,7 +999,7 @@ yy3:
}
 yy4:
YYDEBUG(4, *YYCURSOR);
-#line 1677 ext/date/lib/parse_date.re
+#line 1642 ext/date/lib/parse_date.re
{
int tz_not_found;
DEBUG_OUTPUT(tzcorrection | tz);
@@ -1047,7 +1012,7 @@ yy4:
TIMELIB_DEINIT;
return TIMELIB_TIMEZONE;
}
-#line 1051 ext/date/lib/parse_date.c
+#line 1016 ext/date/lib/parse_date.c
 yy5:
YYDEBUG(5, *YYCURSOR);
yych = *++YYCURSOR;
@@ -1358,12 +1323,12 @@ yy12:
if (yych = '9') goto yy1385;
 yy13:
YYDEBUG(13, *YYCURSOR);
-#line 1772 ext/date/lib/parse_date.re
+#line 1737 ext/date/lib/parse_date.re
{
add_error(s, Unexpected character);
goto std;
}
-#line 1367 ext/date/lib/parse_date.c
+#line 1332 ext/date/lib/parse_date.c
 yy14:
YYDEBUG(14, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2420,11 +2385,11 @@ yy49:
if (yych = '9') goto yy55;
 yy50:
YYDEBUG(50, *YYCURSOR);
-#line 1761 ext/date/lib/parse_date.re
+#line 1726 ext/date/lib/parse_date.re
{
goto std;
}
-#line 2428 ext/date/lib/parse_date.c
+#line 2393 ext/date/lib/parse_date.c
 yy51:
YYDEBUG(51, *YYCURSOR);
yych = *++YYCURSOR;
@@ -2433,12 +2398,12 @@ yy52:
YYDEBUG(52, *YYCURSOR);
++YYCURSOR;
YYDEBUG(53, *YYCURSOR);
-#line 1766 ext/date/lib/parse_date.re
+#line 1731 ext/date/lib/parse_date.re
{
s-pos = cursor; s-line++;
goto std

[PHP-CVS] com php-src: Rebased to PHP-5.4 Implemented Dmitrys change from df97c3aa0d331be668bd5d8f27fff96d4e3ac1d7 Moved the timelib_parse_tz_cor function to ext/date/lib/timelib.c: ext/date/lib/parse

2013-03-31 Thread Derick Rethans
Commit:58a8013e5ff8174aeac4cb38c50c435de9ea5622
Author:Lonny Kapelushnik lon...@gmail.com Mon, 14 Jan 2013 
23:03:52 +
Committer: Derick Rethans git...@derickrethans.nl  Sun, 31 Mar 2013 
10:45:01 +0100
Parents:   a4ca01cc2bc18204ad09ac4cc0f886539f8911e0
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=58a8013e5ff8174aeac4cb38c50c435de9ea5622

Log:
Rebased to PHP-5.4
Implemented Dmitrys change from df97c3aa0d331be668bd5d8f27fff96d4e3ac1d7
Moved the timelib_parse_tz_cor function to ext/date/lib/timelib.c

Changed paths:
  M  ext/date/lib/parse_date.re
  M  ext/date/lib/parse_iso_intervals.re
  M  ext/date/lib/timelib.c
  M  ext/date/lib/timelib.h
  M  ext/date/php_date.c


Diff:
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index 06ab7e3..f3f5906 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -168,8 +168,6 @@ typedef struct _timelib_relunit {
int multiplier;
 } timelib_relunit;
 
-#define HOUR(a) (int)(a * 60)
-
 /* The timezone table. */
 const static timelib_tz_lookup_table timelib_timezone_lookup[] = {
 #include timezonemap.h
@@ -2238,39 +2236,6 @@ const timelib_tz_lookup_table 
*timelib_timezone_abbreviations_list(void)
return timelib_timezone_lookup;
 }
 
-long timelib_parse_tz_cor(char **ptr)
-{
-   char *begin = *ptr, *end;
-   long  tmp;
-
-   while (isdigit(**ptr) || **ptr == ':') {
-   ++*ptr;
-   }
-   end = *ptr;
-   switch (end - begin) {
-   case 1:
-   case 2:
-   return HOUR(strtol(begin, NULL, 10));
-   break;
-   case 3:
-   case 4:
-   if (begin[1] == ':') {
-   tmp = HOUR(strtol(begin, NULL, 10)) + 
strtol(begin + 2, NULL, 10);
-   return tmp;
-   } else if (begin[2] == ':') {
-   tmp = HOUR(strtol(begin, NULL, 10)) + 
strtol(begin + 3, NULL, 10);
-   return tmp;
-   } else {
-   tmp = strtol(begin, NULL, 10);
-   return HOUR(tmp / 100) + tmp % 100;
-   }
-   case 5:
-   tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, 
NULL, 10);
-   return tmp;
-   }
-   return 0;
-}
-
 #ifdef DEBUG_PARSER_STUB
 int main(void)
 {
diff --git a/ext/date/lib/parse_iso_intervals.re 
b/ext/date/lib/parse_iso_intervals.re
index 56aa34d..e50ab37 100644
--- a/ext/date/lib/parse_iso_intervals.re
+++ b/ext/date/lib/parse_iso_intervals.re
@@ -102,8 +102,6 @@ typedef struct Scanner {
int have_end_date;
 } Scanner;
 
-#define HOUR(a) (int)(a * 60)
-
 static void add_warning(Scanner *s, char *error)
 {
s-errors-warning_count++;
@@ -176,39 +174,6 @@ static timelib_ull timelib_get_unsigned_nr(char **ptr, int 
max_length)
return dir * timelib_get_nr(ptr, max_length);
 }
 
-static long timelib_parse_tz_cor(char **ptr)
-{
-   char *begin = *ptr, *end;
-   long  tmp;
-
-   while (isdigit(**ptr) || **ptr == ':') {
-   ++*ptr;
-   }
-   end = *ptr;
-   switch (end - begin) {
-   case 1:
-   case 2:
-   return HOUR(strtol(begin, NULL, 10));
-   break;
-   case 3:
-   case 4:
-   if (begin[1] == ':') {
-   tmp = HOUR(strtol(begin, NULL, 10)) + 
strtol(begin + 2, NULL, 10);
-   return tmp;
-   } else if (begin[2] == ':') {
-   tmp = HOUR(strtol(begin, NULL, 10)) + 
strtol(begin + 3, NULL, 10);
-   return tmp;
-   } else {
-   tmp = strtol(begin, NULL, 10);
-   return HOUR(tmp / 100) + tmp % 100;
-   }
-   case 5:
-   tmp = HOUR(strtol(begin, NULL, 10)) + strtol(begin + 3, 
NULL, 10);
-   return tmp;
-   }
-   return 0;
-}
-
 static void timelib_eat_spaces(char **ptr)
 {
while (**ptr == ' ' || **ptr == '\t') {
diff --git a/ext/date/lib/timelib.c b/ext/date/lib/timelib.c
index 2f457a9..84354e3 100644
--- a/ext/date/lib/timelib.c
+++ b/ext/date/lib/timelib.c
@@ -30,6 +30,8 @@
 
 #define TIMELIB_LLABS(y) (y  0 ? (y * -1) : y)
 
+#define HOUR(a) (int)(a * 60)
+
 timelib_time* timelib_time_ctor(void)
 {
timelib_time *t;
@@ -284,3 +286,35 @@ void timelib_dump_rel_time(timelib_rel_time *d)
printf(\n);
 }
 
+long timelib_parse_tz_cor(char **ptr)
+{
+char *begin = *ptr, *end;
+long  tmp;
+
+while (isdigit(**ptr) || **ptr == ':') {
+++*ptr

[PHP-CVS] com php-src: Bug 54567 DateTimeZone serialize/unserialize Make DateTimeZone serializable and implement __set_state: ext/date/php_date.c ext/date/php_date.h ext/date/tests/014.phpt ext/date/t

2013-03-31 Thread Derick Rethans
Commit:30d0ae42b56c62bc441d763dfa8388c43625b83d
Author:Lonny Kapelushnik lon...@gmail.com Fri, 28 Sep 2012 
12:15:20 +
Committer: Derick Rethans git...@derickrethans.nl  Sun, 31 Mar 2013 
10:45:00 +0100
Parents:   5dd73b9e540206a4b084b915caec1579dfcb19f2
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=30d0ae42b56c62bc441d763dfa8388c43625b83d

Log:
Bug 54567 DateTimeZone serialize/unserialize
Make DateTimeZone serializable and implement __set_state

Bugs:
https://bugs.php.net/54567

Changed paths:
  M  ext/date/php_date.c
  M  ext/date/php_date.h
  M  ext/date/tests/014.phpt
  M  ext/date/tests/DateTimeZone_clone_basic1.phpt
  M  ext/date/tests/DateTimeZone_clone_basic2.phpt
  M  ext/date/tests/DateTimeZone_clone_basic3.phpt
  M  ext/date/tests/DateTimeZone_construct_basic.phpt
  M  ext/date/tests/DateTimeZone_serialize.phpt
  M  ext/date/tests/DateTimeZone_verify.phpt
  M  ext/date/tests/timezone_open_basic1.phpt

diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index c61a4d3..16eb6db 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -500,6 +500,8 @@ const zend_function_entry date_funcs_immutable[] = {
 
 const zend_function_entry date_funcs_timezone[] = {
PHP_ME(DateTimeZone,  __construct, 
arginfo_timezone_open, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
+   PHP_ME(DateTimeZone,  __wakeup,NULL, 
ZEND_ACC_PUBLIC)
+   PHP_ME(DateTimeZone,  __set_state, NULL, 
ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
PHP_ME_MAPPING(getName,   timezone_name_get,   
arginfo_timezone_method_name_get, 0)
PHP_ME_MAPPING(getOffset, timezone_offset_get, 
arginfo_timezone_method_offset_get, 0)
PHP_ME_MAPPING(getTransitions,timezone_transitions_get,
arginfo_timezone_method_transitions_get, 0)
@@ -630,6 +632,7 @@ static HashTable *date_object_get_gc_interval(zval *object, 
zval ***table, int *
 static HashTable *date_object_get_properties_interval(zval *object TSRMLS_DC);
 static HashTable *date_object_get_gc_period(zval *object, zval ***table, int 
*n TSRMLS_DC);
 static HashTable *date_object_get_properties_period(zval *object TSRMLS_DC);
+static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC);
 
 zval *date_interval_read_property(zval *object, zval *member, int type, const 
zend_literal *key TSRMLS_DC);
 void date_interval_write_property(zval *object, zval *member, zval *value, 
const zend_literal *key TSRMLS_DC);
@@ -2017,6 +2020,7 @@ static void date_register_classes(TSRMLS_D)
date_ce_timezone = zend_register_internal_class_ex(ce_timezone, NULL, 
NULL TSRMLS_CC);
memcpy(date_object_handlers_timezone, zend_get_std_object_handlers(), 
sizeof(zend_object_handlers));
date_object_handlers_timezone.clone_obj = date_object_clone_timezone;
+   date_object_handlers_timezone.get_properties = 
date_object_get_properties_timezone;
 
 #define REGISTER_TIMEZONE_CLASS_CONST_STRING(const_name, value) \
zend_declare_class_constant_long(date_ce_timezone, const_name, 
sizeof(const_name)-1, value TSRMLS_CC);
@@ -2269,6 +2273,50 @@ static zend_object_value date_object_clone_timezone(zval 
*this_ptr TSRMLS_DC)
return new_ov;
 }
 
+static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC)
+{
+   HashTable *props;
+   zval *zv;
+   php_timezone_obj *tzobj;
+
+
+   tzobj = (php_timezone_obj *) zend_object_store_get_object(object 
TSRMLS_CC);
+
+   props = zend_std_get_properties(object TSRMLS_CC);
+
+   if (!tzobj-initialized || GC_G(gc_active)) {
+   return props;
+   }
+
+   MAKE_STD_ZVAL(zv);
+   ZVAL_LONG(zv, tzobj-type);
+   zend_hash_update(props, timezone_type, 14, zv, sizeof(zval), NULL);
+
+   MAKE_STD_ZVAL(zv);
+   switch (tzobj-type) {
+   case TIMELIB_ZONETYPE_ID:
+   ZVAL_STRING(zv, tzobj-tzi.tz-name, 1);
+   break;
+   case TIMELIB_ZONETYPE_OFFSET: {
+   char *tmpstr = emalloc(sizeof(UTC+05:00));
+
+   snprintf(tmpstr, sizeof(+05:00), %c%02d:%02d,
+   tzobj-tzi.z.utc_offset  0 ? '-' : '+',
+   abs(tzobj-tzi.z.utc_offset / 60),
+   abs((tzobj-tzi.z.utc_offset % 60)));
+
+   ZVAL_STRING(zv, tmpstr, 0);
+   }
+   break;
+   case TIMELIB_ZONETYPE_ABBR:
+   ZVAL_STRING(zv, tzobj-tzi.tz-timezone_abbr, 1);
+   break;
+   }
+   zend_hash_update(props, timezone, 9, zv, sizeof(zval), NULL);
+
+   return props;
+}
+
 static inline zend_object_value date_object_new_interval_ex(zend_class_entry 
*class_type, php_interval_obj **ptr TSRMLS_DC)
 {
php_interval_obj *intern;
@@ -3643,6

[PHP-CVS] com php-src: Fixed the test to use %d instead of an actual number: ext/date/tests/DateTimeZone_verify.phpt

2013-03-31 Thread Derick Rethans
Commit:a1ebd82a29c427455c7ec2938b892727cfada552
Author:Lonny Kapelushnik lon...@gmail.com Sat, 29 Sep 2012 
22:10:58 -0400
Committer: Derick Rethans git...@derickrethans.nl  Sun, 31 Mar 2013 
10:45:00 +0100
Parents:   30d0ae42b56c62bc441d763dfa8388c43625b83d
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a1ebd82a29c427455c7ec2938b892727cfada552

Log:
Fixed the test to use %d instead of an actual number

Changed paths:
  M  ext/date/tests/DateTimeZone_verify.phpt


Diff:
diff --git a/ext/date/tests/DateTimeZone_verify.phpt 
b/ext/date/tests/DateTimeZone_verify.phpt
index 1304000..241d91e 100644
--- a/ext/date/tests/DateTimeZone_verify.phpt
+++ b/ext/date/tests/DateTimeZone_verify.phpt
@@ -35,14 +35,14 @@ array(9) {
 string(12) DateTimeZone
   }
   [1]=
-  object(ReflectionMethod)#3 (2) {
+  object(ReflectionMethod)#%d (2) {
 [name]=
 string(8) __wakeup
 [class]=
 string(12) DateTimeZone
   }
   [2]=
-  object(ReflectionMethod)#4 (2) {
+  object(ReflectionMethod)#%d (2) {
 [name]=
 string(11) __set_state
 [class]=
@@ -122,4 +122,4 @@ array(14) {
   [PER_COUNTRY]=
   int(4096)
 }
-===DONE===
\ No newline at end of file
+===DONE===


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Updated test case and added BFN to NEWS.: NEWS ext/date/tests/bug60774.phpt

2013-03-31 Thread Derick Rethans
Commit:503760c9130683a21ffe631fddfb20cc18ee2867
Author:Derick Rethans git...@derickrethans.nl Sun, 31 Mar 2013 
11:07:24 +0100
Parents:   b07ecb5501bcc07c830b552aee39098439fe2027
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=503760c9130683a21ffe631fddfb20cc18ee2867

Log:
Updated test case and added BFN to NEWS.

Changed paths:
  M  NEWS
  M  ext/date/tests/bug60774.phpt


Diff:
diff --git a/NEWS b/NEWS
index c8b7116..f0a6b95 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ PHP
NEWS
 |||
 ?? ??? 20??, PHP 5.5.0 Beta 3
 
+- DateTime
+  . Fixed bug #54567 (DateTimeZone serialize/unserialize) (Lonny
+Kapelushnik, Derick)
+  . Fixed bug #60774 (DateInterval::format(%a) is always zero when an
+interval is created using the createFromDateString method) (Lonny
+Kapelushnik, Derick)
 
 28 Mar 2013, PHP 5.5.0 Beta 2
 
diff --git a/ext/date/tests/bug60774.phpt b/ext/date/tests/bug60774.phpt
index af8f447..865928d 100644
--- a/ext/date/tests/bug60774.phpt
+++ b/ext/date/tests/bug60774.phpt
@@ -7,8 +7,8 @@ var_dump($i);
 echo $i-format(%d), \n;
 echo $i-format(%a), \n;
 ?
---EXPECT--
-object(DateInterval)#1 (8) {
+--EXPECTF--
+object(DateInterval)#1 (%d) {
   [y]=
   int(0)
   [m]=
@@ -21,10 +21,24 @@ object(DateInterval)#1 (8) {
   int(0)
   [s]=
   int(0)
+  [weekday]=
+  int(0)
+  [weekday_behavior]=
+  int(0)
+  [first_last_day_of]=
+  int(0)
   [invert]=
   int(0)
   [days]=
   bool(false)
+  [special_type]=
+  int(0)
+  [special_amount]=
+  string(1) 0
+  [have_weekday_relative]=
+  int(0)
+  [have_special_relative]=
+  int(0)
 }
 2
 (unknown)


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] com php-src: Bug #60774 (DateInterval::format(%a) is always zero when an interval is created using the createFromDateString method): ext/date/lib/parse_date.c ext/date/lib/parse_date.re ex

2013-03-31 Thread Derick Rethans
Commit:b07ecb5501bcc07c830b552aee39098439fe2027
Author:EC2 Default User ec2-user@ip-10-66-82-148.ec2.internal 
Sun, 5 Aug 2012 17:14:51 +
Committer: Derick Rethans git...@derickrethans.nl  Sun, 31 Mar 2013 
10:59:21 +0100
Parents:   84208d9dc550e7feab7c44d5e4ea3061a5952dab
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=b07ecb5501bcc07c830b552aee39098439fe2027

Log:
Bug #60774 (DateInterval::format(%a) is always zero when an interval is
created using the createFromDateString method)

Bugs:
https://bugs.php.net/60774

Changed paths:
  M  ext/date/lib/parse_date.c
  M  ext/date/lib/parse_date.re
  A  ext/date/tests/bug60774.phpt


Diff:
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c
index e8f393f..9f5593d 100644
--- a/ext/date/lib/parse_date.c
+++ b/ext/date/lib/parse_date.c
@@ -24789,6 +24789,7 @@ timelib_time* timelib_strtotime(char *s, int len, 
struct timelib_error_container
in.tzdb = tzdb;
in.time-is_localtime = 0;
in.time-zone_type = 0;
+   in.time-relative.days = TIMELIB_UNSET;
 
do {
t = scan(in, tz_get_wrapper);
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index f3f5906..8aaa6c3 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -1796,6 +1796,7 @@ timelib_time* timelib_strtotime(char *s, int len, struct 
timelib_error_container
in.tzdb = tzdb;
in.time-is_localtime = 0;
in.time-zone_type = 0;
+   in.time-relative.days = TIMELIB_UNSET;
 
do {
t = scan(in, tz_get_wrapper);
diff --git a/ext/date/tests/bug60774.phpt b/ext/date/tests/bug60774.phpt
new file mode 100644
index 000..af8f447
--- /dev/null
+++ b/ext/date/tests/bug60774.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Bug #60774 (DateInterval::format(%a) is always zero when an interval is 
created using the createFromDateString method)
+--FILE--
+?php
+$i= DateInterval::createFromDateString('2 days');
+var_dump($i);
+echo $i-format(%d), \n;
+echo $i-format(%a), \n;
+?
+--EXPECT--
+object(DateInterval)#1 (8) {
+  [y]=
+  int(0)
+  [m]=
+  int(0)
+  [d]=
+  int(2)
+  [h]=
+  int(0)
+  [i]=
+  int(0)
+  [s]=
+  int(0)
+  [invert]=
+  int(0)
+  [days]=
+  bool(false)
+}
+2
+(unknown)


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] com php-src: Fixed bug #64359 strftime crash with VS2012: NEWS ext/date/php_date.c

2013-03-06 Thread Derick Rethans
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: Merge branch 'PHP-5.3' into PHP-5.4: NEWS

2013-03-03 Thread Derick Rethans
Commit:a3f020a4be1dc5595a55d0e970663e5830ce6aa7
Author:Derick Rethans git...@derickrethans.nl 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: Merge branch 'PHP-5.4' into PHP-5.5: NEWS

2013-03-03 Thread Derick Rethans
Commit:c596850af6d278b283aaf5b90026d23b348d5fe7
Author:Derick Rethans git...@derickrethans.nl 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: Rename to create a NEWS file per version to fix the annoying merging issue with NEWS files.: NEWS NEWS-5.3

2013-03-03 Thread Derick Rethans
Commit:b36df28dca7d07a6b2bdae03c1257498470f8eef
Author:Derick Rethans git...@derickrethans.nl 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: Diff exceeded maximum size

--
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.4

2013-03-03 Thread Derick Rethans
Commit:6c2564766f9260ceecf3f963ce79a150cea9b0ac
Author:Derick Rethans git...@derickrethans.nl 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: Diff exceeded maximum size

--
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

2013-03-03 Thread Derick Rethans
Commit:1e1de1554f2fb78f9d8fc237e52e42d276a64b6e
Author:Derick Rethans git...@derickrethans.nl 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
-  . Fixed return

[PHP-CVS] com php-src: Added NEWS item for DateTimeImmutable: NEWS

2013-01-14 Thread Derick Rethans
Commit:6313fc7e10d4234cc1e80f223c0652240cad4fda
Author:Derick Rethans git...@derickrethans.nl 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: Make DatePeriod support DateTimeImmutable as well.: ext/date/php_date.c ext/date/php_date.h ext/date/tests/date_period-immutable.phpt

2013-01-14 Thread Derick Rethans
Commit:c20911a8501ed2a69c6ce9359e8e50d599f99bba
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+date_default_timezone_set('UTC');
+$db1 = new DateTimeImmutable( '2008-01-01' );
+$db2 = new DateTime( '2008-01-01' );
+$de = new DateTime( '2008-03-31' );
+$di = DateInterval::createFromDateString( 'first day of next month' );
+
+foreach ( new DatePeriod( $db1, $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 );
+}
+
+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: Fixed crash bug when the non-OO interface was used.: ext/date/php_date.c

2013-01-14 Thread Derick Rethans
Commit:a0618139c9f7aa7859f338a485af161f672be9cd
Author:Derick Rethans git...@derickrethans.nl 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: 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

2013-01-14 Thread Derick Rethans
Commit:017b1f7fca09896b05f2602136ffba7585cd4bfe
Author:Derick Rethans git...@derickrethans.nl 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

[PHP-CVS] com php-src: Added a few missing TSRMLS_DC/TSRMLS_CC.: ext/date/php_date.c

2013-01-14 Thread Derick Rethans
Commit:3919d0adf734f37d7db7c6d76522cd75ac608250
Author:Derick Rethans git...@derickrethans.nl 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: Added another test to test the unmodified inherited methods.: ext/date/tests/date_time_point-inherited.phpt

2013-01-14 Thread Derick Rethans
Commit:a0bea9a1de7123d52b0339ad9d883bbe231122d5
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+$tz = new DateTimeZone(Asia/Tokyo);
+$current = 2012-12-27 16:24:08;
+
+echo \ngetTimezone():\n;
+$v = date_create_point($current);
+$x = $v-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

2013-01-14 Thread Derick Rethans
Commit:45a429200cdf7e918ef3aabc0eb23441f6e8eda3
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+$tz = new DateTimeZone(Asia/Tokyo);
+$current = 2012-12-27 16:24:08;
+
+function dump($a, $b, $c)
+{
+   echo 'orig:', $a-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: 2012-01-14 16:24:08 Europe/London
+
+setTimestamp():
+orig:2012-12-27 16:24:08 Europe/London
+copy:2012-12-27 16:24:08 Europe/London
+changed: 2033-10-06 18:57:02

[PHP-CVS] com php-src: Implemented immutable DateTime objects as the DateTimePoint class.: ext/date/php_date.c ext/date/php_date.h

2013-01-14 Thread Derick Rethans
Commit:1cc61f09279b26b9acc82461c7b77051355346ad
Author:Derick Rethans git...@derickrethans.nl 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_point.create_object

[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

2013-01-12 Thread Derick Rethans
Branch: immutable-date
Deleted commits count: 7
User: Derick Rethans der...@php.net 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

[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

2013-01-12 Thread Derick Rethans
Commit:62129f31a758e86f62410262bb6096f1b2584363
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+date_default_timezone_set('UTC');
+$db1 = new DateTimeImmutable( '2008-01-01' );
+$db2 = new DateTime( '2008-01-01' );
+$de = new DateTime( '2008-03-31' );
+$di = DateInterval::createFromDateString( 'first day of next month' );
+
+foreach ( new DatePeriod( $db1, $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 );
+}
+
+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: Fixed crash bug when the non-OO interface was used.: ext/date/php_date.c

2013-01-12 Thread Derick Rethans
Commit:793b52b576e7af8823ae24622c6a331fd473e149
Author:Derick Rethans git...@derickrethans.nl 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: 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

2013-01-12 Thread Derick Rethans
Commit:8b9d23c0cfcdfaa39f0a7d097cc471143cd4f4d2
Author:Derick Rethans git...@derickrethans.nl 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

[PHP-CVS] com php-src: Added another test to test the unmodified inherited methods.: ext/date/tests/date_time_point-inherited.phpt

2013-01-12 Thread Derick Rethans
Commit:0f679b926cb39f642ca051cb3ae6d7ab55db21fc
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+$tz = new DateTimeZone(Asia/Tokyo);
+$current = 2012-12-27 16:24:08;
+
+echo \ngetTimezone():\n;
+$v = date_create_point($current);
+$x = $v-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

2013-01-12 Thread Derick Rethans
Commit:99e7d1dca2f7e6cd05a955a42c38792a694cc836
Author:Derick Rethans git...@derickrethans.nl 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 a test case for DateTimePoint.: ext/date/tests/date_time_point.phpt

2013-01-12 Thread Derick Rethans
Commit:21d7efef922956a233cc2bfdfba139a88fdc6c4f
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+$tz = new DateTimeZone(Asia/Tokyo);
+$current = 2012-12-27 16:24:08;
+
+function dump($a, $b, $c)
+{
+   echo 'orig:', $a-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: 2012-01-14 16:24:08 Europe/London
+
+setTimestamp():
+orig:2012-12-27 16:24:08 Europe/London
+copy:2012-12-27 16:24:08 Europe/London
+changed: 2033-10-06 18:57:02

[PHP-CVS] com php-src: Implemented immutable DateTime objects as the DateTimePoint class.: ext/date/php_date.c ext/date/php_date.h

2013-01-12 Thread Derick Rethans
Commit:9657591e35b0466b8d86284a78f8cba8bbd4e4b9
Author:Derick Rethans git...@derickrethans.nl 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_point.create_object

Re: [PHP-CVS] svn: /SVNROOT/ global_avail

2013-01-11 Thread Derick Rethans
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: Update news with new bug fix.: NEWS

2013-01-06 Thread Derick Rethans
Commit:67c662a0a2615d52215dccc4805e8eb989df7eab
Author:Derick Rethans git...@derickrethans.nl 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: Merge branch 'PHP-5.3' into PHP-5.4: ext/date/php_date.c

2013-01-06 Thread Derick Rethans
Commit:ba35ae32b7e9858e6590a616c4d5c2f0020cc7ab
Author:Derick Rethans git...@derickrethans.nl 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: Merge branch 'PHP-5.4' into PHP-5.5: ext/date/php_date.c

2013-01-06 Thread Derick Rethans
Commit:4ff088d061ed3d4e15d38d0ed3f2fd10346c634c
Author:Derick Rethans git...@derickrethans.nl 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: Make DatePeriod support DateTimeImmutable as well.: ext/date/php_date.c ext/date/php_date.h ext/date/tests/date_period-immutable.phpt

2012-12-20 Thread Derick Rethans
Commit:042ddf371e84fbb7ba1326e7bd45888e63fb30ef
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+date_default_timezone_set('UTC');
+$db1 = new DateTimeImmutable( '2008-01-01' );
+$db2 = new DateTime( '2008-01-01' );
+$de = new DateTime( '2008-03-31' );
+$di = DateInterval::createFromDateString( 'first day of next month' );
+
+foreach ( new DatePeriod( $db1, $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 );
+}
+
+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: .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.

2012-12-19 Thread Derick Rethans
Branch: immutable-date
Deleted commits count: 4
User: Derick Rethans der...@php.net 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: Fixed crash bug when the non-OO interface was used.: ext/date/php_date.c

2012-12-19 Thread Derick Rethans
Commit:b1c68330161f7ccf4fdb4786ac1b0b28778d3f55
Author:Derick Rethans git...@derickrethans.nl 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] com php-src: Implemented immutable DateTime objects as the DateTimePoint class.: ext/date/php_date.c ext/date/php_date.h

2012-12-19 Thread Derick Rethans
Commit:d4acb579df4c78acaaff3e90698277e62aac
Author:Derick Rethans git...@derickrethans.nl 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_point.create_object

[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

2012-12-19 Thread Derick Rethans
Commit:6b48ae4580a0e97f7df4f1733eca345755110b96
Author:Derick Rethans git...@derickrethans.nl 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

[PHP-CVS] com php-src: Added another test to test the unmodified inherited methods.: ext/date/tests/date_time_point-inherited.phpt

2012-12-19 Thread Derick Rethans
Commit:c69921f76e738b8512b91a198e9c4a144f462a11
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+$tz = new DateTimeZone(Asia/Tokyo);
+$current = 2012-12-27 16:24:08;
+
+echo \ngetTimezone():\n;
+$v = date_create_point($current);
+$x = $v-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

2012-12-19 Thread Derick Rethans
Commit:11718f7447349e7a4191a3473fc3a2738948d18c
Author:Derick Rethans git...@derickrethans.nl 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 a test case for DateTimePoint.: ext/date/tests/date_time_point.phpt

2012-12-19 Thread Derick Rethans
Commit:7c74531e884aaa0a0bf6db76adb0e203cdb81c02
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+$tz = new DateTimeZone(Asia/Tokyo);
+$current = 2012-12-27 16:24:08;
+
+function dump($a, $b, $c)
+{
+   echo 'orig:', $a-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: 2012-01-14 16:24:08 Europe/London
+
+setTimestamp():
+orig:2012-12-27 16:24:08 Europe/London
+copy:2012-12-27 16:24:08 Europe/London
+changed: 2033-10-06 18:57:02

[PHP-CVS] com php-src: Implemented immutable DateTime objects as the DateTimePoint class.: ext/date/php_date.c ext/date/php_date.h

2012-12-17 Thread Derick Rethans
Commit:db554e1c6504fe0ed0845ea637e0d7064014ad31
Author:Derick Rethans git...@derickrethans.nl 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_point.create_object

[PHP-CVS] com php-src: Added a test case for DateTimePoint.: ext/date/tests/date_time_point.phpt

2012-12-17 Thread Derick Rethans
Commit:86c0ac9e759aa615683d3b396813e1922911e4a6
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+$tz = new DateTimeZone(Asia/Tokyo);
+$current = 2012-12-27 16:24:08;
+
+function dump($a, $b, $c)
+{
+   echo 'orig:', $a-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: 2012-01-14 16:24:08 Europe/London
+
+setTimestamp():
+orig:2012-12-27 16:24:08 Europe/London
+copy:2012-12-27 16:24:08 Europe/London
+changed: 2033-10-06 18:57:02

[PHP-CVS] com php-src: Added another test to test the unmodified inherited methods.: ext/date/tests/date_time_point-inherited.phpt

2012-12-17 Thread Derick Rethans
Commit:400502e3f9a3477877daebd84707f4bac9645019
Author:Derick Rethans git...@derickrethans.nl 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--
+?php
+$tz = new DateTimeZone(Asia/Tokyo);
+$current = 2012-12-27 16:24:08;
+
+echo \ngetTimezone():\n;
+$v = date_create_point($current);
+$x = $v-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

2012-12-17 Thread Derick Rethans
Commit:f65a5597d33ffc12b8c1afc941cb77899481b4cd
Author:Derick Rethans git...@derickrethans.nl 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: - Updated to version 2012.9 (2012i): ext/date/lib/timezonedb.h

2012-11-13 Thread Derick Rethans
Commit:1784279be07f1ea18baff67646d9d75896cae36f
Author:Derick Rethans git...@derickrethans.nl 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

[PHP-CVS] svn: /SVNROOT/ global_avail

2012-11-10 Thread Derick Rethans
derick   Sat, 10 Nov 2012 17:18:35 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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: SUpport newer bisons.: Zend/acinclude.m4

2012-10-18 Thread Derick Rethans
Commit:7aed21c55753d2cfb5dc66e47b1a7396333e566f
Author:Derick Rethans git...@derickrethans.nl 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



[PHP-CVS] com php-src: - Updated to version 2012.7 (2012g): ext/date/lib/timezonedb.h

2012-10-18 Thread Derick Rethans
Commit:8f7a6c3029bd1f5731492aa9897c26f421961191
Author:Derick Rethans git...@derickrethans.nl 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 },
-   { US/Michigan   , 0x03DBE8 },
-   { US/Mountain   , 0x03DF1F },
-   { US/Pacific, 0x03E298 },
-   { US/Pacific-New, 0x03E69D },
-   { US/Samoa  , 0x03EAA2 },
-   { UTC   , 0x03EB2B },
-   { W-SU  , 0x03EE22 },
-   { WET   , 0x03EB6F },
-   { Zulu  , 0x03F05C },
+   { Pacific/Auckland  , 0x03971C },
+   { Pacific/Chatham   , 0x039AA8 },
+   { Pacific/Chuuk , 0x039D9F },
+   { Pacific/Easter

Re: [PHP-CVS] com php-src: update news: NEWS

2012-09-18 Thread Derick Rethans
On Tue, 18 Sep 2012, Ferenc Kovacs wrote:

 On Tue, Sep 18, 2012 at 12:45 PM, Pierre Joye pierre@gmail.com wrote:
 
  On Tue, Sep 18, 2012 at 12:58 AM, Stanislav Malyshev s...@php.net 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

2012-07-10 Thread Derick Rethans
On Sun, 8 Jul 2012, Xinchen Hui wrote:

 Commit:e3b9b1e6dc016d9128ac5e9ed95aa5b1a5065e5f
 Author:Xinchen Hui larue...@php.net 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

2012-04-04 Thread Derick Rethans
On Wed, 4 Apr 2012, Johannes Schlüter wrote:

 On Mon, 2012-04-02 at 09:40 +, Derick Rethans wrote:
  Commit:0e53ac49e60b4a58a918aa311bbca405e9185fcf
  Author:Derick Rethans git...@derickrethans.nl 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] svn: /SVNROOT/ global_avail

2012-03-20 Thread Derick Rethans
derick   Tue, 20 Mar 2012 08:30:43 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

[PHP-CVS] [git] branch karma.git: update branch master

2012-03-20 Thread Derick Rethans
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] [git] commit karma.git: lib/Git/PostReceiveHook.php

2012-03-20 Thread Derick Rethans
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] commit karma.git: lib/Git/PostReceiveHook.php

2012-03-20 Thread Derick Rethans
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/ReceiveHook.php

2012-03-20 Thread Derick Rethans
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: hooks/post-receive.mail lib/Git/PostReceiveHook.php

2012-03-20 Thread Derick Rethans
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] com karma.git: Switch to getRepositoryShortName otherwise it breaks the karma system.: lib/Git/PostReceiveHook.php lib/Git/ReceiveHook.php

2012-03-20 Thread Derick Rethans
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] branch karma.git: update branch master

2012-03-20 Thread Derick Rethans
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: Fixed typo in variable name.: hooks/post-receive.mail

2012-03-20 Thread Derick Rethans
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] push karma: update branch master

2012-03-20 Thread Derick Rethans
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: Use the author/tagged date as timestamp to go into the e-mail header.: lib/Git/PostReceiveHook.php lib/Mail.php

2012-03-20 Thread Derick Rethans
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] com karma: Use author/email format that can be copied and pasted for use in e-mail clients.: lib/Git/PostReceiveHook.php

2012-03-20 Thread Derick Rethans
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



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

2012-03-20 Thread Derick Rethans
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] push karma: update branch master

2012-03-20 Thread Derick Rethans
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 git...@derickrethans.nl Tue, 20 Mar 2012 
09:41:04 +
Committer: Derick Rethans git...@derickrethans.nl  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



[PHP-CVS] com karma: Fold author and committer if they're the same and align items.: lib/Git/PostReceiveHook.php

2012-03-20 Thread Derick Rethans
Commit: 14bb87dbb769d3795797921014e4b9cc14da412f
Author: Derick Rethans git...@derickrethans.nl Tue, 20 Mar 2012 
09:41:04 +
Committer: Derick Rethans git...@derickrethans.nl  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['author_email'] != $targetInfo['committer_email'])) {
+$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;
@@ -506,12 +510,14 @@ 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;
-if ($info['parents']) $message .= 'Parents: ' . $info['parents'] . 
\n;
+$message .= 'Commit:' . $revision . \n;
+$message .= 'Author:' . $info['author'] . ' ' . 
$info['author_email'] . ' ' . $info['author_date'] . \n

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/Zend/ README.ZEND_MM zend_API.c

2012-03-06 Thread Derick Rethans
derick   Tue, 06 Mar 2012 18:25:55 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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/Zend/README.ZEND_MM branches/PHP_5_4/Zend/README.ZEND_MM trunk/Zend/README.ZEND_MM

2012-03-06 Thread Derick Rethans
derick   Tue, 06 Mar 2012 18:34:10 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3/Zend/ README.ZEND_MM zend_API.c

2012-03-06 Thread Derick Rethans
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/ext/date/lib/timezonedb.h branches/PHP_5_4/ext/date/lib/timezonedb.h trunk/ext/date/lib/timezonedb.h

2012-03-01 Thread Derick Rethans
derick   Thu, 01 Mar 2012 15:09:49 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

diffs exceeded maximum size
-- 
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

2012-02-27 Thread Derick Rethans
On Mon, 27 Feb 2012, Laruence wrote:

 On Mon, Feb 27, 2012 at 4:31 PM, Laruence larue...@php.net wrote:
  On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov dmi...@zend.com 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/trunk/Zend/ zend_alloc.c

2012-01-29 Thread Derick Rethans
derick   Sun, 29 Jan 2012 11:17:07 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/zend_execute_API.c trunk/Zend/zend_execute_API.c

2012-01-29 Thread Derick Rethans
derick   Sun, 29 Jan 2012 15:25:40 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ext/date/tests/ DateTime_add-fall-type2-type2.phpt

2011-12-27 Thread Derick Rethans
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



[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

2011-12-12 Thread Derick Rethans
derick   Mon, 12 Dec 2011 12:57:46 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
 ?php
 if (!method_exists('DateInterval', 'format')) die(skip: method doesn't 
exist);
-if (substr(PHP_OS, 0, 3) != 'WIN') die(skip this test is for Windows 
platforms only);
 ?
---XFAIL--
-Windows VC6 libs' floor()/ceil() choke on floats
 --FILE--
 ?php


Modified: php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format_a.phpt
===
--- php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format_a.phpt  
2011-12-12 10:56:09 UTC (rev 320889)
+++ php/php-src/branches/PHP_5_4/ext/date/tests/DateInterval_format_a.phpt  
2011-12-12 12:57:46 UTC (rev 320890)
@@ -8,10 +8,7 @@
 --SKIPIF--
 ?php
 if (!method_exists('DateInterval', 'format')) die(skip: method doesn't 
exist);
-if (substr(PHP_OS, 0, 3) != 'WIN') die(skip this test is for Windows 
platforms only);
 ?
---XFAIL--
-Windows VC6 libs' floor()/ceil() choke on floats
 --FILE--
 ?php


Modified: php/php-src/trunk/ext/date/tests/DateInterval_format_a.phpt
===
--- php/php-src/trunk/ext/date/tests/DateInterval_format_a.phpt 2011-12-12 
10:56:09 UTC (rev 320889)
+++ php/php-src/trunk/ext/date/tests/DateInterval_format_a.phpt 2011-12-12 
12:57:46 UTC (rev 320890)
@@ -8,10 +8,7 @@
 --SKIPIF--
 ?php
 if (!method_exists('DateInterval', 'format')) die(skip: method doesn't 
exist);
-if (substr(PHP_OS, 0, 3) != 'WIN') die(skip this test is for Windows 
platforms only);
 ?
---XFAIL--
-Windows VC6 libs' floor()/ceil() choke on floats
 --FILE--
 ?php


-- 
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/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/

2011-12-07 Thread Derick Rethans
On Wed, 7 Dec 2011, Pierre Joye wrote:

 pajoye   Wed, 07 Dec 2011 09:03:07 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
 +?php
 +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/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

2011-12-07 Thread Derick Rethans
derick   Wed, 07 Dec 2011 19:24:58 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
 ?php
-putenv(TZ=GMT);
-
 echo The following line rightly shows the correct date time:\n;
 echo gmdate(m/d/y Hi, strtotime(04/04/04 2345)), \n;


Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug33415-2.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug33415-2.phpt	2011-12-07 19:22:44 UTC (rev 320603)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug33415-2.phpt	2011-12-07 19:24:58 UTC (rev 320604)
@@ -2,14 +2,10 @@
 Bug #33415 [2] (Possibly invalid non-one-hour DST or timezone shifts)
 --FILE--
 ?php
+date_default_timezone_set('Africa/Bujumbura');

 print TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
 have a DST or timezone transition.\n;
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-	date_default_timezone_set('Africa/Bujumbura');
-} else {
-	putenv(TZ=Africa/Bujumbura);
-}
 $tStamp = mktime (17, 17, 17, 1, 1, 1970);
 print tStamp=. date(l Y-m-d H:i:s T I, $tStamp). \n;
 $strtotime_tstamp = strtotime(next Wednesday, $tStamp);
@@ -17,11 +13,7 @@
 print wanted=Wednesday00:00:00\n\n;

 print TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes\n;
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-	date_default_timezone_set('Asia/Thimbu');
-} else {
-	putenv(TZ=Asia/Thimbu);
-}
+date_default_timezone_set('Asia/Thimbu');
 $tStamp = mktime (17, 17, 17, 1, 6476, 1970);
 print tStamp=. date(l Y-m-d H:i:s T I, $tStamp). \n;
 $strtotime_tstamp = strtotime(next Thursday, $tStamp);
@@ -30,11 +22,7 @@

 print TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
 appear to have a DST or timezone transition.\n;
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-	date_default_timezone_set('Indian/Cocos');
-} else {
-	putenv(TZ=Indian/Cocos);
-}
+date_default_timezone_set('Indian/Cocos');
 $tStamp = mktime (17, 17, 17, 1, 1, 1970);
 print tStamp=. date(l Y-m-d H:i:s T I, $tStamp). \n;
 $strtotime_tstamp = strtotime(next Thursday, $tStamp);
@@ -43,11 +31,7 @@

 print TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
 not appear to have a DST or timezone transition.\n;
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-	date_default_timezone_set('Africa/Lubumbashi');
-} else {
-	putenv(TZ=Africa/Lubumbashi);
-}
+date_default_timezone_set('Africa/Lubumbashi');
 $tStamp = mktime (17, 17, 17, 1, 1, 1970);
 print tStamp=. date(l Y-m-d H:i:s T I, $tStamp). \n;
 $strtotime_tstamp = strtotime(next Saturday, $tStamp);
@@ -55,11 +39,7 @@
 print wanted=Saturday00:00:00\n\n;

 print TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes\n;
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-	date_default_timezone_set('Asia/Kashgar');
-} else {
-	putenv(TZ=Asia/Kashgar);
-}
+date_default_timezone_set('Asia/Kashgar');
 $tStamp = 

[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

2011-12-07 Thread Derick Rethans
derick   Wed, 07 Dec 2011 19:42:44 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
 ?php
 class MyDateTime extends DateTime {

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 19:24:58 UTC (rev 320604)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug48678.phpt	2011-12-07 19:42:44 UTC (rev 320605)
@@ -1,5 +1,5 @@
 --TEST--
-Bug #48678: DateInterval segfaults when unserialising
+Bug #48678 (DateInterval segfaults when unserialising)
 --FILE--
 ?php
 $x = new DateInterval(P3Y6M4DT12H30M5S);

Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug50392.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug50392.phpt	2011-12-07 19:24:58 UTC (rev 320604)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug50392.phpt	2011-12-07 19:42:44 UTC (rev 320605)
@@ -1,5 +1,5 @@
 --TEST--
-Bug #50392 date_create_from_format enforces 6 digits for 'u' format character
+Bug #50392 (date_create_from_format enforces 6 digits for 'u' format character)
 --FILE--
 ?php
 date_default_timezone_set('Europe/Bratislava');

Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug51096.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug51096.phpt	2011-12-07 19:24:58 UTC (rev 320604)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug51096.phpt	2011-12-07 19:42:44 UTC (rev 320605)
@@ -1,5 +1,5 @@
 --TEST--
-Bug #51096: Test for first day vs first day of.
+Bug #51096 (Test for first day vs first day of)
 --FILE--
 ?php
 $tests = array(

Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug52062-64bit.phpt
===
--- 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 05:44:54 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=320475

Log:
This changes adds the --EXTENSION-- section to .phpt files as
described in http://marc.info/?t=13224861637r=1w=2.

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-12-06 02:18:08 UTC (rev 
320474)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-12-06 05:44:54 UTC (rev 
320475)
@@ -1246,7 +1246,7 @@
}

// Match the beginning of a section.
-   if (preg_match(b'/^--([_A-Z]+)--/', $line, $r)) {
+   if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
settype($section, 'string');

@@ -1483,6 +1483,18 @@
settings2array(preg_split( /[\n\r]+/, $section_text['INI']), 
$ini_settings);
}

+   // Additional required extensions
+   if (array_key_exists('EXTENSIONS', $section_text)) {
+   $ext_dir=`$php -r 'echo ini_get(extension_dir);'`;
+   $extensions = preg_split(/[\n\r]+/, 
trim($section_text['EXTENSIONS']));
+   $loaded = explode(,, `$php -n -r 'echo join(,, 
get_loaded_extensions());'`);
+   foreach ($extensions as $req_ext) {
+   if (!in_array($req_ext, $loaded)) {
+   $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+   }
+   }
+   }
+
settings2params($ini_settings);

// Check if test should be skipped.

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-12-06 02:18:08 UTC (rev 
320474)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-12-06 05:44:54 UTC (rev 
320475)
@@ -1246,7 +1246,7 @@
}

// Match the beginning of a section.
-   if (preg_match(b'/^--([_A-Z]+)--/', $line, $r)) {
+   if (preg_match('/^--([_A-Z]+)--/', $line, $r)) {
$section = $r[1];
settype($section, 'string');

@@ -1483,6 +1483,18 @@
settings2array(preg_split( /[\n\r]+/, $section_text['INI']), 
$ini_settings);
}

+   // Additional required extensions
+   if (array_key_exists('EXTENSIONS', $section_text)) {
+   $ext_dir=`$php -r 'echo ini_get(extension_dir);'`;
+   $extensions = preg_split(/[\n\r]+/, 
trim($section_text['EXTENSIONS']));
+   $loaded = explode(,, `$php -n -r 'echo join(,, 
get_loaded_extensions());'`);
+   foreach ($extensions as $req_ext) {
+   if (!in_array($req_ext, $loaded)) {
+   $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+   }
+   }
+   }
+
settings2params($ini_settings);

// Check if test should be skipped.

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2011-12-06 02:18:08 UTC (rev 320474)
+++ php/php-src/trunk/run-tests.php 2011-12-06 05:44:54 UTC (rev 320475)
@@ -1483,6 +1483,18 @@
settings2array(preg_split( /[\n\r]+/, $section_text['INI']), 
$ini_settings);
}

+   // Additional required extensions
+   if (array_key_exists('EXTENSIONS', $section_text)) {
+   $ext_dir=`$php -r 'echo ini_get(extension_dir);'`;
+   $extensions = preg_split(/[\n\r]+/, 
trim($section_text['EXTENSIONS']));
+   $loaded = explode(,, `$php -n -r 'echo join(,, 
get_loaded_extensions());'`);
+   foreach ($extensions as $req_ext) {
+   if (!in_array($req_ext, $loaded)) {
+   $ini_settings['extension'][] = $ext_dir . 
DIRECTORY_SEPARATOR . $req_ext . '.' . PHP_SHLIB_SUFFIX;
+   }
+   }
+   }
+
settings2params($ini_settings);

// Check if test should be skipped.

-- 
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/bug32555.phpt branches/PHP_5_3/ext/date/tests/bug54851.phpt branches/PHP_5_4/ext/date/tests/bug54851.phpt trunk/ext/date/tests/bug32555.php

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 05:59:24 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=320476

Log:
- Fixed test case for #54851.
- Make test case for #32555 the same for all branches.

Bugs: https://bugs.php.net/54851 (Closed) DateTime::createFromFormat, 
$format=='D' or $format=='l' Always Returns Today.
  https://bugs.php.net/32555 (Closed) strtotime(tomorrow) can return false
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/tests/bug32555.phpt
U   php/php-src/branches/PHP_5_3/ext/date/tests/bug54851.phpt
U   php/php-src/branches/PHP_5_4/ext/date/tests/bug54851.phpt
U   php/php-src/trunk/ext/date/tests/bug32555.phpt
U   php/php-src/trunk/ext/date/tests/bug54851.phpt

Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug32555.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug32555.phpt   2011-12-06 
05:44:54 UTC (rev 320475)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug32555.phpt   2011-12-06 
05:59:24 UTC (rev 320476)
@@ -8,7 +8,6 @@
 date.timezone=US/Eastern
 --FILE--
 ?php
-
 $stamp = 1112427000;
 print strftime('%c %Z',strtotime('now',$stamp)) .\n;
 print strftime('%c %Z',strtotime('tomorrow',$stamp)) .\n;

Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug54851.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug54851.phpt   2011-12-06 
05:44:54 UTC (rev 320475)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug54851.phpt   2011-12-06 
05:59:24 UTC (rev 320476)
@@ -5,7 +5,7 @@
 --FILE--
 ?php
 $date = new DateTime(2011-05-17T22:14:12);
-$date2 = DateTime::createFromFormat(D H i s, $date-format(D). ' 0 0 0');
+$date2 = DateTime::createFromFormat(D H i s, $date-format(D). ' 0 00 00');
 echo $date-format(r), \n;
 echo $date2-format(r), \n;
 var_dump($date-format(D) == $date2-format(D));
@@ -20,7 +20,7 @@
 // Verify that our implementation is the same as for the constructor and
 // strtotime
 $date1 = new DateTime(Tuesday);
-$date2 = DateTime::createFromFormat(D H i s, Tuesday 0 0 0);
+$date2 = DateTime::createFromFormat(D H i s, Tuesday 0 00 00);
 echo $date1-format('r'), \n;
 echo $date2-format('r'), \n;
 var_dump($date1-format('D') == $date2-format('D'));

Modified: php/php-src/branches/PHP_5_4/ext/date/tests/bug54851.phpt
===
--- php/php-src/branches/PHP_5_4/ext/date/tests/bug54851.phpt   2011-12-06 
05:44:54 UTC (rev 320475)
+++ php/php-src/branches/PHP_5_4/ext/date/tests/bug54851.phpt   2011-12-06 
05:59:24 UTC (rev 320476)
@@ -5,7 +5,7 @@
 --FILE--
 ?php
 $date = new DateTime(2011-05-17T22:14:12);
-$date2 = DateTime::createFromFormat(D H i s, $date-format(D). ' 0 0 0');
+$date2 = DateTime::createFromFormat(D H i s, $date-format(D). ' 0 00 00');
 echo $date-format(r), \n;
 echo $date2-format(r), \n;
 var_dump($date-format(D) == $date2-format(D));
@@ -20,7 +20,7 @@
 // Verify that our implementation is the same as for the constructor and
 // strtotime
 $date1 = new DateTime(Tuesday);
-$date2 = DateTime::createFromFormat(D H i s, Tuesday 0 0 0);
+$date2 = DateTime::createFromFormat(D H i s, Tuesday 0 00 00);
 echo $date1-format('r'), \n;
 echo $date2-format('r'), \n;
 var_dump($date1-format('D') == $date2-format('D'));

Modified: php/php-src/trunk/ext/date/tests/bug32555.phpt
===
--- php/php-src/trunk/ext/date/tests/bug32555.phpt  2011-12-06 05:44:54 UTC 
(rev 320475)
+++ php/php-src/trunk/ext/date/tests/bug32555.phpt  2011-12-06 05:59:24 UTC 
(rev 320476)
@@ -8,7 +8,6 @@
 date.timezone=US/Eastern
 --FILE--
 ?php
-
 $stamp = 1112427000;
 print strftime('%c %Z',strtotime('now',$stamp)) .\n;
 print strftime('%c %Z',strtotime('tomorrow',$stamp)) .\n;

Modified: php/php-src/trunk/ext/date/tests/bug54851.phpt
===
--- php/php-src/trunk/ext/date/tests/bug54851.phpt  2011-12-06 05:44:54 UTC 
(rev 320475)
+++ php/php-src/trunk/ext/date/tests/bug54851.phpt  2011-12-06 05:59:24 UTC 
(rev 320476)
@@ -5,7 +5,7 @@
 --FILE--
 ?php
 $date = new DateTime(2011-05-17T22:14:12);
-$date2 = DateTime::createFromFormat(D H i s, $date-format(D). ' 0 0 0');
+$date2 = DateTime::createFromFormat(D H i s, $date-format(D). ' 0 00 00');
 echo $date-format(r), \n;
 echo $date2-format(r), \n;
 var_dump($date-format(D) == $date2-format(D));
@@ -20,7 +20,7 @@
 // Verify that our implementation is the same as for the constructor and
 // strtotime
 $date1 = new DateTime(Tuesday);
-$date2 = DateTime::createFromFormat(D H i s, Tuesday 0 0 0);
+$date2 = DateTime::createFromFormat(D H i s, Tuesday 0 00 00);
 echo $date1-format('r'), \n;
 echo $date2-format('r'), \n;
 var_dump($date1-format('D') == $date2-format('D'));

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: 

[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

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 06:00:45 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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
-$x = new dateinterval(P3Y6M4DT12H30M5S);
+$x = new DateInterval(P3Y6M4DT12H30M5S);
 print_r($x);
 $y = unserialize(serialize($x));
 print_r($y);

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-06 
05:59:24 UTC (rev 320476)
+++ php/php-src/branches/PHP_5_4/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
-$x = new dateinterval(P3Y6M4DT12H30M5S);
+$x = new DateInterval(P3Y6M4DT12H30M5S);
 print_r($x);
 $y = unserialize(serialize($x));
 print_r($y);

Modified: php/php-src/trunk/ext/date/tests/bug48678.phpt
===
--- php/php-src/trunk/ext/date/tests/bug48678.phpt  2011-12-06 05:59:24 UTC 
(rev 320476)
+++ php/php-src/trunk/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
-$x = new dateinterval(P3Y6M4DT12H30M5S);
+$x = new DateInterval(P3Y6M4DT12H30M5S);
 print_r($x);
 $y = unserialize(serialize($x));
 print_r($y);

-- 
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

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 06:04:24 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
+?php
+$d = new DateTime('@1000');
+var_dump($d-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-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

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 06:07:41 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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--
+?php
+$dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new DateInterval('P1D'), 
2);
+
+echo Original:\r\n;
+foreach($dp as $dt) {
+echo $dt-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--
+?php
+$dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new DateInterval('P1D'), 
2);
+
+echo Original:\r\n;
+foreach($dp as $dt) {
+echo $dt-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--
+?php
+$dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new DateInterval('P1D'), 
2);
+
+echo Original:\r\n;
+foreach($dp as $dt) {
+echo $dt-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/tests/ date.phpt mktime-2.phpt timezone-configuration.phpt

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 06:13:41 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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
 $tmp = cr;
-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-   date_default_timezone_set('GMT0');
-} else {
-   putenv (TZ=GMT0);
-}
+date_default_timezone_set('UTC');

-
 for($a = 0;$a  strlen($tmp); $a++){
echo $tmp[$a], ': ', date($tmp[$a], 1043324459).\n;
 }

-if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-   date_default_timezone_set(MET);
-} else {
-   putenv (TZ=MET);
-}
+date_default_timezone_set(MET);
+
 for($a = 0;$a  strlen($tmp); $a++){
echo $tmp[$a], ': ', date($tmp[$a], 1043324459).\n;
 }

Modified: php/php-src/branches/PHP_5_3/ext/date/tests/mktime-2.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/mktime-2.phpt   2011-12-06 
06:07:41 UTC (rev 320479)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/mktime-2.phpt   2011-12-06 
06:13:41 UTC (rev 320480)
@@ -5,13 +5,13 @@
 --FILE--
 ?php
 $timezones = array(
-'GMT0',
+'UTC',
 'Europe/London'
 );

 foreach($timezones as $timezone)
 {
-putenv('TZ='.$timezone);
+date_default_timezone_set($timezone);

 /* status of daylight saving time unknown */
 var_dump(mktime(0, 0, 0, 1, 1, 2002));

Modified: 
php/php-src/branches/PHP_5_3/ext/date/tests/timezone-configuration.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/timezone-configuration.phpt 
2011-12-06 06:07:41 UTC (rev 320479)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/timezone-configuration.phpt 
2011-12-06 06:13:41 UTC (rev 320480)
@@ -4,19 +4,10 @@
 date.timezone=GMT
 --FILE--
 ?php
-   putenv('TZ=Europe/Oslo');
-   if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-   date_default_timezone_set('Europe/Oslo');
-   } else {
-   putenv('TZ=Europe/Oslo');
-   }
+   date_default_timezone_set('Europe/Oslo');
echo strtotime(2005-06-18 22:15:44), \n;

-   if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
-   date_default_timezone_set('Europe/London');
-   } else {
-   putenv('TZ=Europe/London');
-   }
+   date_default_timezone_set('Europe/London');
echo strtotime(2005-06-18 22:15:44), \n;

date_default_timezone_set('Europe/Oslo');

-- 
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

2011-12-05 Thread Derick Rethans
derick   Tue, 06 Dec 2011 06:23:13 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=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

  1   2   3   4   5   6   7   8   9   10   >