From bde1475971e58c3a4cd0bf268fbdbcc5ac032965 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 13 Mar 2017 07:22:59 +0100 Subject: php-pecl-amqp: 1.9.0beta1 --- REFLECTION | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++++- amqp-pr274.patch | 35 +++++++++++++ php-pecl-amqp.spec | 14 ++++-- 3 files changed, 187 insertions(+), 5 deletions(-) create mode 100644 amqp-pr274.patch diff --git a/REFLECTION b/REFLECTION index 10d23e8..a238e6b 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #72 amqp version 1.8.0 ] { +Extension [ extension #72 amqp version 1.9.0beta1 ] { - INI { Entry [ amqp.host ] @@ -82,7 +82,7 @@ Extension [ extension #72 amqp version 1.8.0 ] { Constant [ integer PHP_AMQP_MAX_CHANNELS ] { 256 } } - - Classes [11] { + - Classes [14] { Class [ class AMQPConnection ] { - Constants [0] { @@ -1141,6 +1141,88 @@ Extension [ extension #72 amqp version 1.8.0 ] { } } + Class [ final class AMQPTimestamp ] { + + - Constants [2] { + Constant [ string MAX ] { 18446744073709551616 } + Constant [ string MIN ] { 0 } + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [1] { + Property [ private $timestamp ] + } + + - Methods [3] { + Method [ public method __construct ] { + + - Parameters [1] { + Parameter #0 [ $timestamp ] + } + } + + Method [ public method getTimestamp ] { + + - Parameters [0] { + } + } + + Method [ public method __toString ] { + + - Parameters [0] { + } + } + } + } + + Class [ 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 } + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [2] { + Property [ private $exponent ] + Property [ private $significand ] + } + + - Methods [3] { + Method [ public method __construct ] { + + - Parameters [2] { + Parameter #0 [ $exponent ] + Parameter #1 [ $significand ] + } + } + + Method [ public method getExponent ] { + + - Parameters [0] { + } + } + + Method [ public method getSignificand ] { + + - Parameters [0] { + } + } + } + } + Class [ class AMQPException extends Exception implements Throwable ] { - Constants [0] { @@ -1425,6 +1507,63 @@ Extension [ extension #72 amqp version 1.8.0 ] { } } } + + Class [ class AMQPValueException extends AMQPException implements Throwable ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [4] { + Property [ protected $message ] + Property [ protected $code ] + Property [ protected $file ] + Property [ protected $line ] + } + + - Methods [10] { + Method [ public method __construct ] { + + - Parameters [3] { + Parameter #0 [ $message ] + Parameter #1 [ $code ] + Parameter #2 [ $previous ] + } + } + + Method [ public method __wakeup ] { + } + + Method [ final public method getMessage ] { + } + + Method [ final public method getCode ] { + } + + Method [ final public method getFile ] { + } + + Method [ final public method getLine ] { + } + + Method [ final public method getTrace ] { + } + + Method [ final public method getPrevious ] { + } + + Method [ final public method getTraceAsString ] { + } + + Method [ public method __toString ] { + } + } + } } } diff --git a/amqp-pr274.patch b/amqp-pr274.patch new file mode 100644 index 0000000..4817470 --- /dev/null +++ b/amqp-pr274.patch @@ -0,0 +1,35 @@ +From f031d8492f0acfc0f38e8e5e4e01ed87a22234b2 Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 13 Mar 2017 06:57:14 +0100 +Subject: [PATCH] adapt buffer size and secure its usage, fix #273 + +--- + amqp_timestamp.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/amqp_timestamp.c b/amqp_timestamp.c +index 70013f1..79b0e52 100644 +--- a/amqp_timestamp.c ++++ b/amqp_timestamp.c +@@ -119,7 +119,7 @@ zend_function_entry amqp_timestamp_class_functions[] = { + PHP_MINIT_FUNCTION(amqp_timestamp) + { + zend_class_entry ce; +- char min[1], max[20]; ++ char min[20], max[20]; + int min_len, max_len; + + INIT_CLASS_ENTRY(ce, "AMQPTimestamp", amqp_timestamp_class_functions); +@@ -128,10 +128,10 @@ PHP_MINIT_FUNCTION(amqp_timestamp) + + zend_declare_property_null(this_ce, ZEND_STRL("timestamp"), ZEND_ACC_PRIVATE TSRMLS_CC); + +- max_len = sprintf(max, "%.0f", AMQP_TIMESTAMP_MAX); ++ max_len = snprintf(max, sizeof(max), "%.0f", AMQP_TIMESTAMP_MAX); + zend_declare_class_constant_stringl(this_ce, ZEND_STRL("MAX"), max, max_len TSRMLS_CC); + +- min_len = sprintf(min, "%.0f", AMQP_TIMESTAMP_MIN); ++ min_len = snprintf(min, sizeof(min), "%.0f", AMQP_TIMESTAMP_MIN); + zend_declare_class_constant_stringl(this_ce, ZEND_STRL("MIN"), min, min_len TSRMLS_CC); + + return SUCCESS; diff --git a/php-pecl-amqp.spec b/php-pecl-amqp.spec index 30d4a03..599b178 100644 --- a/php-pecl-amqp.spec +++ b/php-pecl-amqp.spec @@ -22,22 +22,25 @@ %else %global ini_name 40-%{pecl_name}.ini %endif -#global prever beta2 +%global prever beta1 %global buildver %(pkg-config --silence-errors --modversion librabbitmq 2>/dev/null || echo 65536) Summary: Communicate with any AMQP compliant server Name: %{?sub_prefix}php-pecl-amqp -Version: 1.8.0 -Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 1.9.0 +Release: 0.1.%{prever}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP Group: Development/Languages URL: http://pecl.php.net/package/amqp Source0: http://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz +Patch0: %{pecl_name}-pr274.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: %{?scl_prefix}php-devel > 5.3.0 BuildRequires: %{?scl_prefix}php-pear +#BuildRequires: php-debuginfo valgrind gdb # Upstream requires 0.5.2, set 0.8.0 to ensure "last" is used. %if 0%{?fedora} >= 23 BuildRequires: librabbitmq-devel >= 0.8.0 @@ -114,6 +117,7 @@ sed -e 's/role="test"/role="src"/' \ mv %{pecl_name}-%{version}%{?prever} NTS cd NTS +%patch0 -p1 -b .pr274 sed -e 's/CFLAGS="-I/CFLAGS="-fPIC -I/' -i config.m4 # Upstream often forget to change this @@ -308,6 +312,10 @@ fi %changelog +* Mon Mar 13 2017 Remi Collet - 1.9.0-0.1.beta1 +- Update to 1.9.0beta1 +- add patch from https://github.com/pdezwart/php-amqp/pull/274 + * Sun Feb 19 2017 Remi Collet - 1.8.0-2 - ensure proper librabbitmq version is used -- cgit