From a1bc6dc0d174d96b0cd6533c103d96b58fea5e4c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 3 Oct 2022 15:56:17 +0200 Subject: add upstream patch for 8.2 and from https://github.com/m6w6/ext-pq/pull/44 --- pq-upstream.patch | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 pq-upstream.patch (limited to 'pq-upstream.patch') diff --git a/pq-upstream.patch b/pq-upstream.patch new file mode 100644 index 0000000..f4fbb3d --- /dev/null +++ b/pq-upstream.patch @@ -0,0 +1,49 @@ +From 64cc2702825f663e8da413dab235d18145f073b7 Mon Sep 17 00:00:00 2001 +From: Michael Wallner +Date: Wed, 10 Nov 2021 10:12:57 +0100 +Subject: [PATCH] PHP-8.2 compat with __toString + +--- + src/php_pq_misc.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/php_pq_misc.c b/src/php_pq_misc.c +index 70f32da..9acef34 100644 +--- a/src/php_pq_misc.c ++++ b/src/php_pq_misc.c +@@ -138,7 +138,11 @@ ZEND_END_ARG_INFO() + #define ai_pqdt_jsonserialize ai_pqdt_to_string + #endif + ++#if PHP_VERSION_ID >= 80200 ++ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ai_pqdt_to_string, 0, 0, IS_STRING, 0) ++#else + ZEND_BEGIN_ARG_INFO_EX(ai_pqdt_to_string, 0, 0, 0) ++#endif + ZEND_END_ARG_INFO(); + static PHP_METHOD(pqdt, __toString) + { + +From e518cb365f1e28dd4779ce37888a89ac54278c65 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Thu, 8 Sep 2022 17:24:42 +0200 +Subject: [PATCH] allow dynamic properties in Pq\Connection + +--- + src/php_pqconn.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/php_pqconn.c b/src/php_pqconn.c +index 6278323..0b39d25 100644 +--- a/src/php_pqconn.c ++++ b/src/php_pqconn.c +@@ -2001,6 +2001,9 @@ PHP_MINIT_FUNCTION(pqconn) + INIT_NS_CLASS_ENTRY(ce, "pq", "Connection", php_pqconn_methods); + php_pqconn_class_entry = zend_register_internal_class_ex(&ce, NULL); + php_pqconn_class_entry->create_object = php_pqconn_create_object; ++#if PHP_VERSION_ID >= 80200 ++ php_pqconn_class_entry->ce_flags |= ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES; ++#endif + + memcpy(&php_pqconn_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); + php_pqconn_object_handlers.offset = XtOffsetOf(php_pqconn_object_t, zo); -- cgit