summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2014-01-08 08:44:28 +0100
committerRemi Collet <fedora@famillecollet.com>2014-01-08 08:44:28 +0100
commit051634248b0a6938a3526904336330a5d44d0c59 (patch)
tree7ea153dfbe922dd5b003a8ba27aa5832f70d801b
parent2982afcaf2754b7ee713d634f88acc7451f2127b (diff)
PHP: another test build of 5.5.8RC1
-rw-r--r--php-wip2.patch93
-rw-r--r--php55.spec10
2 files changed, 101 insertions, 2 deletions
diff --git a/php-wip2.patch b/php-wip2.patch
new file mode 100644
index 0000000..fcea691
--- /dev/null
+++ b/php-wip2.patch
@@ -0,0 +1,93 @@
+From 5137cb5f0ccdeb78d6db25f6045b2c520463a38f Mon Sep 17 00:00:00 2001
+From: Derick Rethans <github@derickrethans.nl>
+Date: Thu, 2 Jan 2014 12:45:48 +0000
+Subject: [PATCH] Fixed (some of) add/sub.
+
+This worked in PHP 5.4 already, but with the introduction of DateTimeImmutable
+this code was not correctly merged.
+---
+ ext/date/php_date.c | 48 ++++++++----------------------------------------
+ 1 file changed, 8 insertions(+), 40 deletions(-)
+
+diff --git a/ext/date/php_date.c b/ext/date/php_date.c
+index cd3bf74..d96428d 100644
+--- a/ext/date/php_date.c
++++ b/ext/date/php_date.c
+@@ -3137,33 +3137,16 @@ static void php_date_add(zval *object, zval *interval, zval *return_value TSRMLS
+ {
+ php_date_obj *dateobj;
+ php_interval_obj *intobj;
+- int bias = 1;
++ timelib_time *new_time;
+
+ dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
+ 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;
+ }
+
+ /* {{{ proto DateTime date_add(DateTime object, DateInterval interval)
+@@ -3204,7 +3187,7 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS
+ {
+ php_date_obj *dateobj;
+ php_interval_obj *intobj;
+- int bias = 1;
++ timelib_time *new_time;
+
+ dateobj = (php_date_obj *) zend_object_store_get_object(object TSRMLS_CC);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
+@@ -3216,24 +3199,9 @@ static void php_date_sub(zval *object, zval *interval, zval *return_value TSRMLS
+ return;
+ }
+
+- if (intobj->diff->invert) {
+- bias = -1;
+- }
+-
+- memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time));
+- dateobj->time->relative.y = 0 - (intobj->diff->y * bias);
+- dateobj->time->relative.m = 0 - (intobj->diff->m * bias);
+- dateobj->time->relative.d = 0 - (intobj->diff->d * bias);
+- dateobj->time->relative.h = 0 - (intobj->diff->h * bias);
+- dateobj->time->relative.i = 0 - (intobj->diff->i * bias);
+- dateobj->time->relative.s = 0 - (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_sub(dateobj->time, intobj->diff);
++ timelib_time_dtor(dateobj->time);
++ dateobj->time = new_time;
+ }
+
+ /* {{{ proto DateTime date_sub(DateTime object, DateInterval interval)
+--
+1.8.4.3
+
diff --git a/php55.spec b/php55.spec
index efde641..5d2c11f 100644
--- a/php55.spec
+++ b/php55.spec
@@ -106,7 +106,7 @@ Summary: PHP scripting language for creating dynamic web sites
Name: php
Version: 5.5.8
%if 0%{?snapdate:1}%{?rcver:1}
-Release: 0.1.%{?snapdate}%{?rcver}%{?dist}
+Release: 0.2.%{?snapdate}%{?rcver}%{?dist}
%else
Release: 1%{?dist}.1
%endif
@@ -176,6 +176,7 @@ Patch91: php-5.3.7-oci8conf.patch
# WIP
Patch200: php-wip.patch
+Patch201: php-wip2.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -219,12 +220,13 @@ Requires: php-cli%{?_isa} = %{version}-%{release}
# To ensure correct /var/lib/php/session ownership:
Requires(pre): httpd
-
+%if 0%{?fedora} < 20
# Don't provides extensions, which are not shared library, as .so
%{?filter_provides_in: %filter_provides_in %{_libdir}/php/modules/.*\.so$}
%{?filter_provides_in: %filter_provides_in %{_libdir}/php-zts/modules/.*\.so$}
%{?filter_provides_in: %filter_provides_in %{_httpd_moddir}/.*\.so$}
%{?filter_setup}
+%endif
%description
@@ -889,6 +891,7 @@ rm -rf ext/json
# WIP patch
%patch200 -p0 -b .wip
+%patch201 -p1 -b .wip2
# Prevent %%doc confusion over LICENSE files
cp Zend/LICENSE Zend/ZEND_LICENSE
@@ -1863,6 +1866,9 @@ fi
%changelog
+* Wed Jan 8 2014 Remi Collet <rcollet@redhat.com> 5.5.8-0.2.RC1
+- another test build of 5.5.8RC1
+
* Sat Dec 28 2013 Remi Collet <rcollet@redhat.com> 5.5.8-0.1.RC1
- test build of 5.5.8RC1