From 3ba14c94cddf6e8f031fde88e2e5325ced3d620b Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 2 Jan 2019 15:15:01 +0100
Subject: update to 1.9.4 drop patch merged upstream raise minimal PHP version
 to 5.6 and open https://github.com/pdezwart/php-amqp/pull/338

---
 323.patch          | 37 -------------------------------------
 PHPINFO            | 32 ++++++++++++++++++++++++++++++++
 REFLECTION         | 39 +++++++++++++++++++++++++++++----------
 php-pecl-amqp.spec | 17 ++++++++++-------
 4 files changed, 71 insertions(+), 54 deletions(-)
 delete mode 100644 323.patch
 create mode 100644 PHPINFO

diff --git a/323.patch b/323.patch
deleted file mode 100644
index c71590d..0000000
--- a/323.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From f798463e8359f853a62e1b66550a0fcbc6dbe194 Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@remirepo.net>
-Date: Thu, 21 Jun 2018 10:33:36 +0200
-Subject: [PATCH] fix for 7.3
-
----
- amqp_channel.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/amqp_channel.c b/amqp_channel.c
-index f3dba5d..032526e 100644
---- a/amqp_channel.c
-+++ b/amqp_channel.c
-@@ -101,7 +101,11 @@ static void php_amqp_destroy_fci(zend_fcall_info *fci) {
-     if (fci->size > 0) {
-         zval_ptr_dtor(&fci->function_name);
-         if (fci->object != NULL) {
-+#if PHP_VERSION_ID >= 70300
-+            GC_DELREF(fci->object);
-+#else
-             GC_REFCOUNT(fci->object)--;
-+#endif
-         }
-         fci->size = 0;
-     }
-@@ -112,7 +116,11 @@ static void php_amqp_duplicate_fci(zend_fcall_info *source) {
- 
-         zval_add_ref(&source->function_name);
-         if (source->object != NULL) {
-+#if PHP_VERSION_ID >= 70300
-+            GC_ADDREF(source->object);
-+#else
-             GC_REFCOUNT(source->object)++;
-+#endif
-         }
-     }
- }
diff --git a/PHPINFO b/PHPINFO
new file mode 100644
index 0000000..fcde918
--- /dev/null
+++ b/PHPINFO
@@ -0,0 +1,32 @@
+
+amqp
+
+Version => 1.9.4
+Revision => release
+Compiled => Jan  2 2019 @ 15:02:47
+AMQP protocol version => 0-9-1
+librabbitmq version => 0.9.0
+Default max channels per connection => 256
+Default max frame size => 131072
+Default heartbeats interval => 0
+
+Directive => Local Value => Master Value
+amqp.host => localhost => localhost
+amqp.vhost => / => /
+amqp.port => 5672 => 5672
+amqp.timeout => no value => no value
+amqp.read_timeout => 0 => 0
+amqp.write_timeout => 0 => 0
+amqp.connect_timeout => 0 => 0
+amqp.login => guest => guest
+amqp.password => guest => guest
+amqp.auto_ack => 0 => 0
+amqp.prefetch_count => 3 => 3
+amqp.channel_max => 256 => 256
+amqp.frame_max => 131072 => 131072
+amqp.heartbeat => 0 => 0
+amqp.cacert => no value => no value
+amqp.cert => no value => no value
+amqp.key => no value => no value
+amqp.verify => 1 => 1
+amqp.sasl_method => 0 => 0
diff --git a/REFLECTION b/REFLECTION
index fcfa799..ee989ab 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #72 amqp version 1.9.3 ] {
+Extension [ <persistent> extension #71 amqp version 1.9.4 ] {
 
   - INI {
     Entry [ amqp.host <ALL> ]
@@ -55,9 +55,12 @@ Extension [ <persistent> extension #72 amqp version 1.9.3 ] {
     Entry [ amqp.verify <ALL> ]
       Current = '1'
     }
+    Entry [ amqp.sasl_method <ALL> ]
+      Current = '0'
+    }
   }
 
-  - Constants [22] {
+  - Constants [24] {
     Constant [ integer AMQP_NOPARAM ] { 0 }
     Constant [ integer AMQP_JUST_CONSUME ] { 1 }
     Constant [ integer AMQP_DURABLE ] { 2 }
@@ -80,6 +83,8 @@ Extension [ <persistent> extension #72 amqp version 1.9.3 ] {
     Constant [ string AMQP_EX_TYPE_HEADERS ] { headers }
     Constant [ integer AMQP_OS_SOCKET_TIMEOUT_ERRNO ] { 536870923 }
     Constant [ integer PHP_AMQP_MAX_CHANNELS ] { 256 }
+    Constant [ integer AMQP_SASL_METHOD_PLAIN ] { 0 }
+    Constant [ integer AMQP_SASL_METHOD_EXTERNAL ] { 1 }
   }
 
   - Classes [15] {
@@ -94,7 +99,7 @@ Extension [ <persistent> extension #72 amqp version 1.9.3 ] {
       - Static methods [0] {
       }
 
-      - Properties [15] {
+      - Properties [16] {
         Property [ <default> private $login ]
         Property [ <default> private $password ]
         Property [ <default> private $host ]
@@ -110,9 +115,10 @@ Extension [ <persistent> extension #72 amqp version 1.9.3 ] {
         Property [ <default> private $key ]
         Property [ <default> private $cert ]
         Property [ <default> private $verify ]
+        Property [ <default> private $sasl_method ]
       }
 
-      - Methods [37] {
+      - Methods [39] {
         Method [ <internal:amqp, ctor> public method __construct ] {
 
           - Parameters [1] {
@@ -347,6 +353,19 @@ Extension [ <persistent> extension #72 amqp version 1.9.3 ] {
             Parameter #0 [ <required> $verify ]
           }
         }
+
+        Method [ <internal:amqp> public method getSaslMethod ] {
+
+          - Parameters [0] {
+          }
+        }
+
+        Method [ <internal:amqp> public method setSaslMethod ] {
+
+          - Parameters [1] {
+            Parameter #0 [ <required> $sasl_method ]
+          }
+        }
       }
     }
 
@@ -1158,8 +1177,8 @@ Extension [ <persistent> extension #72 amqp version 1.9.3 ] {
     Class [ <internal:amqp> final class AMQPTimestamp ] {
 
       - Constants [2] {
-        Constant [ string MAX ] { 18446744073709551616 }
-        Constant [ string MIN ] { 0 }
+        Constant [ public string MAX ] { 18446744073709551616 }
+        Constant [ public string MIN ] { 0 }
       }
 
       - Static properties [0] {
@@ -1197,10 +1216,10 @@ Extension [ <persistent> extension #72 amqp version 1.9.3 ] {
     Class [ <internal:amqp> final class AMQPDecimal ] {
 
       - Constants [4] {
-        Constant [ integer EXPONENT_MIN ] { 0 }
-        Constant [ integer EXPONENT_MAX ] { 255 }
-        Constant [ integer SIGNIFICAND_MIN ] { 0 }
-        Constant [ integer SIGNIFICAND_MAX ] { 4294967295 }
+        Constant [ public integer EXPONENT_MIN ] { 0 }
+        Constant [ public integer EXPONENT_MAX ] { 255 }
+        Constant [ public integer SIGNIFICAND_MIN ] { 0 }
+        Constant [ public integer SIGNIFICAND_MAX ] { 4294967295 }
       }
 
       - Static properties [0] {
diff --git a/php-pecl-amqp.spec b/php-pecl-amqp.spec
index 3c54130..eeb2b1f 100644
--- a/php-pecl-amqp.spec
+++ b/php-pecl-amqp.spec
@@ -3,7 +3,7 @@
 #
 # Fedora spec file for php-pecl-amqp
 #
-# Copyright (c) 2012-2018 Remi Collet
+# Copyright (c) 2012-2019 Remi Collet
 # License: CC-BY-SA
 # http://creativecommons.org/licenses/by-sa/4.0/
 #
@@ -32,16 +32,14 @@
 
 Summary:       Communicate with any AMQP compliant server
 Name:          %{?sub_prefix}php-pecl-amqp
-Version:       1.9.3
+Version:       1.9.4
 Release:       6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
 License:       PHP
 URL:           http://pecl.php.net/package/amqp
 Source0:       http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
 
-Patch0:        https://patch-diff.githubusercontent.com/raw/pdezwart/php-amqp/pull/323.patch
-
 BuildRequires: %{?dtsprefix}gcc
-BuildRequires: %{?scl_prefix}php-devel > 5.3
+BuildRequires: %{?scl_prefix}php-devel > 5.6
 BuildRequires: %{?scl_prefix}php-pear
 #BuildRequires: php-debuginfo valgrind gdb
 # Upstream requires 0.5.2, set 0.8.0 to ensure "last" is used.
@@ -122,8 +120,6 @@ sed -e 's/role="test"/role="src"/' \
 mv %{pecl_name}-%{version}%{?prever} NTS
 
 cd NTS
-%patch0 -p1 -b .pr323
-
 sed -e 's/CFLAGS="-I/CFLAGS="-fPIC -I/' -i config.m4
 
 # Upstream often forget to change this
@@ -178,6 +174,7 @@ extension = %{pecl_name}.so
 ;amqp.cert = ''
 ;amqp.key = ''
 ;amqp.verify = ''
+;amqp.sasl_method = 0
 EOF
 
 %if %{with_zts}
@@ -312,6 +309,12 @@ fi
 
 
 %changelog
+* Wed Jan  2 2019 Remi Collet <remi@remirepo.net> - 1.9.4-1
+- update to 1.9.4
+- drop patch merged upstream
+- raise minimal PHP version to 5.6
+  and open https://github.com/pdezwart/php-amqp/pull/338
+
 * Thu Aug 16 2018 Remi Collet <remi@remirepo.net> - 1.9.3-6
 - rebuild for 7.3.0beta2 new ABI
 
-- 
cgit