summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-06-17 15:08:10 +0200
committerRemi Collet <remi@php.net>2022-06-17 15:08:10 +0200
commitbb0248de01c4d2fe726420f8e1ea6e780e052638 (patch)
treecb7c10e58f26188fdb8f68d4b50af044feea9bd8
parent753f689f3d6fad9c8bb48eb8417f608a3036fc22 (diff)
add patch for PHP 8.2 from https://github.com/zeromq/php-zmq/pull/228
-rw-r--r--228.patch122
-rw-r--r--php-pecl-zmq.spec9
2 files changed, 129 insertions, 2 deletions
diff --git a/228.patch b/228.patch
new file mode 100644
index 0000000..7448172
--- /dev/null
+++ b/228.patch
@@ -0,0 +1,122 @@
+From 68d4bf090b6a12e40dcd6178837ef729f43c2d2e Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Fri, 17 Jun 2022 15:04:34 +0200
+Subject: [PATCH] fix 8.2 deprecations
+
+---
+ tests/007-addremovepoll.phpt | 6 +++---
+ tests/036-device.phpt | 8 ++++----
+ tests/037-device-deprecated.phpt | 4 ++--
+ tests/048-pollsetitems.phpt | 6 +++---
+ 4 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/tests/007-addremovepoll.phpt b/tests/007-addremovepoll.phpt
+index a37762f..645d212 100644
+--- a/tests/007-addremovepoll.phpt
++++ b/tests/007-addremovepoll.phpt
+@@ -16,14 +16,14 @@ $z = create_client();
+ $socket_server = stream_socket_server("tcp://127.0.0.1:5858", $errno, $errstr);
+
+ if (!$socket_server) {
+- echo "Failed to create socket server: ${errstr}" . PHP_EOL;
++ echo "Failed to create socket server: {$errstr}" . PHP_EOL;
+ exit (1);
+ }
+
+ $socket_client = stream_socket_client("tcp://127.0.0.1:5858", $errno, $errstr);
+
+ if (!$socket_client) {
+- echo "Failed to create socket client: ${errstr}" . PHP_EOL;
++ echo "Failed to create socket client: {$errstr}" . PHP_EOL;
+ exit (1);
+ }
+
+@@ -73,4 +73,4 @@ array(1) {
+ [0]=>
+ string(3) "r:%d"
+ }
+-int(0)
+\ No newline at end of file
++int(0)
+diff --git a/tests/036-device.phpt b/tests/036-device.phpt
+index 507e902..0fcc15e 100644
+--- a/tests/036-device.phpt
++++ b/tests/036-device.phpt
+@@ -17,11 +17,11 @@ class CbStateData
+ protected $_name;
+
+ public function __construct ($name) {
+- $this->name = $name;
++ $this->_name = $name;
+ }
+
+ public function getName () {
+- return $this->name;
++ return $this->_name;
+ }
+
+ public function increment ()
+@@ -58,7 +58,7 @@ $orig_cb = function ($user_data) use (&$last_called, $device) {
+ $time_elapsed = (proper_microtime () - $last_called) + 1;
+
+ if ($time_elapsed < $device->getTimerTimeout ()) {
+- echo "Called too early, only ${time_elapsed}ms elapsed, expected {$device->getTimerTimeout ()}" . PHP_EOL;
++ echo "Called too early, only {$time_elapsed}ms elapsed, expected {$device->getTimerTimeout ()}" . PHP_EOL;
+ }
+
+ $device->setTimerTimeout ($device->getTimerTimeout () + 50);
+@@ -100,4 +100,4 @@ Triggered for 160ms timeout
+ timer function called 2 times
+ Triggered for 210ms timeout
+ timer function called 3 times
+-OK
+\ No newline at end of file
++OK
+diff --git a/tests/037-device-deprecated.phpt b/tests/037-device-deprecated.phpt
+index 82beb16..4f1ce37 100644
+--- a/tests/037-device-deprecated.phpt
++++ b/tests/037-device-deprecated.phpt
+@@ -14,7 +14,7 @@ $device = new ZMQDevice($s1, $ctx->getSocket(ZMQ::SOCKET_PUB));
+
+ // Setup callback and user data for callback
+ $device->setIdleTimeout (100);
+-$device->setIdleCallback (function ($user_data) { echo "Called: ${user_data}" . PHP_EOL; return false; }, "test");
++$device->setIdleCallback (function ($user_data) { echo "Called: {$user_data}" . PHP_EOL; return false; }, "test");
+
+ // Run first time
+ $device->run ();
+@@ -24,4 +24,4 @@ echo "OK";
+ --EXPECTF--
+ Deprecated: ZMQDevice::setidlecallback(): The signature for setIdleCallback has changed, please update your code in %s on line %d
+ Called: test
+-OK
+\ No newline at end of file
++OK
+diff --git a/tests/048-pollsetitems.phpt b/tests/048-pollsetitems.phpt
+index 0f0f316..5079809 100644
+--- a/tests/048-pollsetitems.phpt
++++ b/tests/048-pollsetitems.phpt
+@@ -19,14 +19,14 @@ $poll = new ZMQPoll();
+ $socket_server = stream_socket_server("tcp://127.0.0.1:5858", $errno, $errstr);
+
+ if (!$socket_server) {
+- echo "Failed to create socket server: ${errstr}" . PHP_EOL;
++ echo "Failed to create socket server: {$errstr}" . PHP_EOL;
+ exit (1);
+ }
+
+ $socket_client = stream_socket_client("tcp://127.0.0.1:5858", $errno, $errstr);
+
+ if (!$socket_client) {
+- echo "Failed to create socket client: ${errstr}" . PHP_EOL;
++ echo "Failed to create socket client: {$errstr}" . PHP_EOL;
+ exit (1);
+ }
+
+@@ -58,4 +58,4 @@ array(3) {
+ }
+ array(0) {
+ }
+-OK
+\ No newline at end of file
++OK
diff --git a/php-pecl-zmq.spec b/php-pecl-zmq.spec
index bd79c65..57539d9 100644
--- a/php-pecl-zmq.spec
+++ b/php-pecl-zmq.spec
@@ -3,7 +3,7 @@
#
# Fedora spec file for php-pecl-zmq
#
-# Copyright (c) 2013-2021 Remi Collet
+# Copyright (c) 2013-2022 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -26,13 +26,14 @@
Summary: ZeroMQ messaging
Name: %{?sub_prefix}php-pecl-%{pecl_name}
Version: 1.1.3
-Release: 15%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 16%{?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}-%{version}.tgz
Patch0: https://patch-diff.githubusercontent.com/raw/zeromq/php-zmq/pull/216.patch
Patch1: https://patch-diff.githubusercontent.com/raw/zeromq/php-zmq/pull/222.patch
+Patch2: https://patch-diff.githubusercontent.com/raw/zeromq/php-zmq/pull/228.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -98,6 +99,7 @@ mv %{pecl_name}-%{version} NTS
cd NTS
%patch0 -p1 -b .pr216
%patch1 -p1 -b .pr222
+%patch2 -p1 -b .pr228
if pkg-config libzmq --atleast-version=4
then
@@ -240,6 +242,9 @@ export TEST_PHP_EXECUTABLE=%{__ztsphp}
%changelog
+* Fri Jun 17 2022 Remi Collet <remi@remirepo.net> - 1.1.3-16
+- add patch for PHP 8.2 from https://github.com/zeromq/php-zmq/pull/228
+
* Wed Nov 3 2021 Remi Collet <remi@remirepo.net> - 1.1.3-15
- add patch for PHP 8.1 from https://github.com/zeromq/php-zmq/pull/222