diff options
-rw-r--r-- | ion-php82.patch | 70 | ||||
-rw-r--r-- | php-pecl-ion.spec | 9 |
2 files changed, 78 insertions, 1 deletions
diff --git a/ion-php82.patch b/ion-php82.patch new file mode 100644 index 0000000..c99408f --- /dev/null +++ b/ion-php82.patch @@ -0,0 +1,70 @@ +From 58445d22c26c02e865f2d494de7255cc72cfa25d Mon Sep 17 00:00:00 2001 +From: Michael Wallner <mike@php.net> +Date: Wed, 8 Jun 2022 14:15:08 +0200 +Subject: [PATCH] fix #6: compatibility with 8.2 + +--- + ion_private.h | 28 ++++++++++++++-------------- + 1 file changed, 14 insertions(+), 14 deletions(-) + +diff --git a/ion_private.h b/ion_private.h +index 64d2a33..a3ab32e 100644 +--- a/ion_private.h ++++ b/ion_private.h +@@ -188,9 +188,9 @@ typedef struct php_ion_unserializer { + + ION_TYPE type; // FIXME: there's already `php_ion_obj(reader, rdr)->state` + php_ion_annotations annotations; +- ++ + zend_object *rdr, std; +- ++ + } php_ion_unserializer; + + ZEND_BEGIN_MODULE_GLOBALS(ion) +@@ -1284,7 +1284,7 @@ static void php_ion_reader_ctor(php_ion_reader *obj) + obj->options.chunk_threshold); + zend_update_property_bool(ce_Reader_Reader, &obj->std, ZEND_STRL("skipCharacterValidation"), + obj->options.skip_character_validation); +- ++ + if (obj->type == STREAM_READER) { + obj->stream.buf.length = obj->options.chunk_threshold ? obj->options.chunk_threshold : 0x4000; + obj->stream.buf.value = emalloc(obj->stream.buf.length); +@@ -1861,17 +1861,7 @@ static void php_ion_serialize_object(php_ion_serializer *ser, zend_object *zobje + return; + } + +- if (can_call_magic_serialize(ser, ce)) { +- php_ion_serialize_object_magic(ser, zobject, NULL); +- } else if (can_call_iface_serialize(ser, ce)) { +- php_ion_serialize_object_iface(ser, zobject); +- } else if (can_call_custom_serialize(ser, zobject, &fn)) { +- php_ion_serialize_object_magic(ser, zobject, fn); +- } else if (zobject->ce->ce_flags & ZEND_ACC_ENUM) { +- php_ion_serialize_object_enum(ser, zobject); +- } else if (!is_special_class(ce, &special_ce)) { +- php_ion_serialize_object_std(ser, zobject); +- } else { ++ if (is_special_class(ce, &special_ce)) { + if (can_serialize_fast(ser) || special_ce == ce_LOB) { + if (special_ce == ce_Symbol) { + ION_CHECK(ion_writer_write_ion_symbol(php_ion_obj(writer, ser->wri)->writer, &php_ion_obj(symbol, zobject)->sym)); +@@ -1902,6 +1892,16 @@ static void php_ion_serialize_object(php_ion_serializer *ser, zend_object *zobje + } + zend_call_method(ser->wri, NULL, NULL, method, strlen(method), NULL, 1, &z_param, NULL); + } ++ } else if (can_call_magic_serialize(ser, ce)) { ++ php_ion_serialize_object_magic(ser, zobject, NULL); ++ } else if (can_call_iface_serialize(ser, ce)) { ++ php_ion_serialize_object_iface(ser, zobject); ++ } else if (can_call_custom_serialize(ser, zobject, &fn)) { ++ php_ion_serialize_object_magic(ser, zobject, fn); ++ } else if (zobject->ce->ce_flags & ZEND_ACC_ENUM) { ++ php_ion_serialize_object_enum(ser, zobject); ++ } else { ++ php_ion_serialize_object_std(ser, zobject); + } + } + diff --git a/php-pecl-ion.spec b/php-pecl-ion.spec index ed142d4..0df27b2 100644 --- a/php-pecl-ion.spec +++ b/php-pecl-ion.spec @@ -37,13 +37,15 @@ Summary: Amazon ION support Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: BSD URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz Source1: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{gh_version}-%{gh_short}.tar.gz +Patch0: %{pecl_name}-php82.patch + BuildRequires: make %if 0%{?rhel} == 7 BuildRequires: cmake3 >= 3.6 @@ -89,6 +91,8 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS +%patch0 -p1 -b .php82 + # use bundled library ln -s ../%{gh_project}-%{gh_commit} ion-c @@ -223,6 +227,9 @@ fi %changelog +* Fri Jun 17 2022 Remi Collet <remi@remirepo.net> - 0.2.1-2 +- add upstream patch for PHP 8.2 + * Tue May 31 2022 Remi Collet <remi@remirepo.net> - 0.2.1-1 - update to 0.2.1 |