From 5c7f670b297e919ea3a145088f18ac414eb43cd3 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 6 Jan 2021 08:16:53 +0100 Subject: update to 2.3.0 --- 115.patch | 107 ------------------------------------------------------ PHPINFO | 2 +- REFLECTION | 7 ++-- php-pecl-yac.spec | 22 ++++------- 4 files changed, 13 insertions(+), 125 deletions(-) delete mode 100644 115.patch diff --git a/115.patch b/115.patch deleted file mode 100644 index e83a27f..0000000 --- a/115.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 619c2b4fb4839502c88317b3e39221647fd16d2a Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Wed, 23 Sep 2020 14:26:16 +0200 -Subject: [PATCH] Fix compatibility with PHP 8 - ---- - tests/021.phpt | 8 ++++++-- - tests/022.phpt | 2 +- - yac.c | 34 +++++++++++++++++++++++++++------- - 3 files changed, 34 insertions(+), 10 deletions(-) - -diff --git a/tests/021.phpt b/tests/021.phpt -index f2f98cf..0f68258 100644 ---- a/tests/021.phpt -+++ b/tests/021.phpt -@@ -13,8 +13,12 @@ $yac = new Yac("prefix"); - - $yac->value = "value"; - --/* can not used in writen context */ --$yac->foo->bar = "bar"; -+try { -+ /* can not used in writen context */ -+ $yac->foo->bar = "bar"; -+} catch (Error $e) { -+ /* expected exception on PHP 8 */ -+} - - var_dump($yac->get("value")); - var_dump($yac->value); -diff --git a/tests/022.phpt b/tests/022.phpt -index a34a4d2..487de28 100644 ---- a/tests/022.phpt -+++ b/tests/022.phpt -@@ -17,5 +17,5 @@ var_dump($yac); - --EXPECTF-- - string(18) "Yac is not enabled" - --Notice: Undefined variable: yac in %s022.php on line %d -+%s: Undefined variable%syac in %s022.php on line %d - NULL -diff --git a/yac.c b/yac.c -index 2e961f7..408e694 100644 ---- a/yac.c -+++ b/yac.c -@@ -504,17 +504,27 @@ static void yac_object_free(zend_object *object) /* {{{ */ { - } - /* }}} */ - --static zval* yac_read_property_ptr(zval *zobj, zval *name, int type, void **cache_slot) /* {{{ */ { -+#if PHP_VERSION_ID < 80000 -+static zval* yac_read_property_ptr(zval *zobj, zval *zname, int type, void **cache_slot) /* {{{ */ { -+#else -+static zval* yac_read_property_ptr(zend_object *obj, zend_string *name, int type, void **cache_slot) /* {{{ */ { -+#endif - return &EG(error_zval); - } - /* }}} */ - --static zval* yac_read_property(zval *zobj, zval *name, int type, void **cache_slot, zval *rv) /* {{{ */ { -+#if PHP_VERSION_ID < 80000 -+static zval* yac_read_property(zval *zobj, zval *zname, int type, void **cache_slot, zval *rv) /* {{{ */ { -+ zend_object *obj = Z_OBJ_P(zobj); -+ zend_string *name = Z_STR_P(zname); -+#else -+static zval* yac_read_property(zend_object *obj, zend_string *name, int type, void **cache_slot, zval *rv) /* {{{ */ { -+#endif - if (UNEXPECTED(type == BP_VAR_RW||type == BP_VAR_W)) { - return &EG(error_zval); - } - -- if (yac_get_impl(Z_YACOBJ_P(zobj), Z_STR_P(name), NULL, rv)) { -+ if (yac_get_impl(php_yac_fetch_object(obj), name, NULL, rv)) { - return rv; - } - -@@ -522,16 +532,26 @@ static zval* yac_read_property(zval *zobj, zval *name, int type, void **cache_sl - } - /* }}} */ - --static YAC_WHANDLER yac_write_property(zval *zobj, zval *name, zval *value, void **cache_slot) /* {{{ */ { -- yac_add_impl(Z_YACOBJ_P(zobj), Z_STR_P(name), value, 0, 0); -+#if PHP_VERSION_ID < 80000 -+static YAC_WHANDLER yac_write_property(zval *zobj, zval *zname, zval *value, void **cache_slot) /* {{{ */ { -+ yac_add_impl(Z_YACOBJ_P(zobj), Z_STR_P(zname), value, 0, 0); -+#else -+static YAC_WHANDLER yac_write_property(zend_object *obj, zend_string *name, zval *value, void **cache_slot) /* {{{ */ { -+ yac_add_impl(php_yac_fetch_object(obj), name, value, 0, 0); -+#endif - Z_TRY_ADDREF_P(value); - - YAC_WHANDLER_RET(value); - } - /* }}} */ - --static void yac_unset_property(zval *zobj, zval *name, void **cache_slot) /* {{{ */ { -- yac_delete_impl(Z_YACOBJ_P(zobj), Z_STR_P(name), 0); -+#if PHP_VERSION_ID < 80000 -+static void yac_unset_property(zval *zobj, zval *zname, void **cache_slot) /* {{{ */ { -+ yac_delete_impl(Z_YACOBJ_P(zobj), Z_STR_P(zname), 0); -+#else -+static void yac_unset_property(zend_object *obj, zend_string *name, void **cache_slot) /* {{{ */ { -+ yac_delete_impl(php_yac_fetch_object(obj), name, 0); -+#endif - } - /* }}} */ - diff --git a/PHPINFO b/PHPINFO index a11340b..69fb80d 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,7 +2,7 @@ yac yac support => enabled -Version => 2.2.1 +Version => 2.3.0 Shared Memory => mmap Serializer => php, msgpack, igbinary, json diff --git a/REFLECTION b/REFLECTION index 4f6396a..c03c538 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #113 yac version 2.2.1 ] { +Extension [ extension #118 yac version 2.3.0 ] { - Dependencies { Dependency [ msgpack (Required) ] @@ -31,7 +31,7 @@ Extension [ extension #113 yac version 2.2.1 ] { } - Constants [9] { - Constant [ string YAC_VERSION ] { 2.2.1 } + Constant [ string YAC_VERSION ] { 2.3.0 } Constant [ int YAC_MAX_KEY_LEN ] { 48 } Constant [ int YAC_MAX_VALUE_RAW_LEN ] { 67108863 } Constant [ int YAC_MAX_RAW_COMPRESSED_LEN ] { 1048576 } @@ -112,7 +112,8 @@ Extension [ extension #113 yac version 2.2.1 ] { Method [ public method dump ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ $limit ] } } } diff --git a/php-pecl-yac.spec b/php-pecl-yac.spec index 1b4ca33..137ea49 100644 --- a/php-pecl-yac.spec +++ b/php-pecl-yac.spec @@ -3,7 +3,7 @@ # # Fedora spec file for php-pecl-yac (previously php-yac) # -# Copyright (c) 2013-2020 Remi Collet +# Copyright (c) 2013-2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -28,21 +28,20 @@ Summary: Lockless user data cache Name: %{?sub_prefix}php-pecl-%{pecl_name} -Version: 2.2.1 +Version: 2.3.0 License: PHP URL: https://pecl.php.net/package/%{pecl_name} %if 0%{?gh_date:1} Release: 0.13.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{pecl_name}-%{version}-%{gh_short}.tar.gz %else -Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz %endif -Patch0: https://patch-diff.githubusercontent.com/raw/laruence/yac/pull/115.patch - +BuildRequires: make BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel > 7 +BuildRequires: %{?scl_prefix}php-devel >= 7.0 BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-json BuildRequires: %{?scl_prefix}php-pecl-msgpack-devel @@ -82,12 +81,6 @@ Obsoletes: php80-pecl-%{pecl_name} <= %{version} %endif %endif -%if 0%{?fedora} < 20 && 0%{?rhel} < 7 -# Filter private shared object -%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} -%{?filter_setup} -%endif - %description Yac (Yet Another Cache) is a shared memory user data cache for PHP. @@ -117,8 +110,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -%patch0 -p1 -b .pr115 - %if %{with_fastlz} sed -e '\:name="compressor/fastlz:d' -i ../package.xml rm -r compressor/fastlz @@ -281,6 +272,9 @@ fi %changelog +* Wed Jan 6 2021 Remi Collet - 2.3.0-1 +- update to 2.3.0 + * Wed Sep 30 2020 Remi Collet - 2.2.1-3 - rebuild for PHP 8.0.0RC1 -- cgit