diff options
-rw-r--r-- | PHPINFO | 2 | ||||
-rw-r--r-- | REFLECTION | 2 | ||||
-rw-r--r-- | php-pecl-trie.spec | 19 | ||||
-rw-r--r-- | php_trie-build.patch | 204 |
4 files changed, 9 insertions, 218 deletions
@@ -2,7 +2,7 @@ php_trie php_trie support => enabled -php_trie version => 0.1.1 +php_trie version => 0.1.2 php_trie author => Lochemem Bruno Michael <lochbm@gmail.com> Trie available => yes Hat Trie available => yes @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #120 php_trie version 0.1.1 ] { +Extension [ <persistent> extension #120 php_trie version 0.1.2 ] { - Dependencies { Dependency [ json (Required) ] diff --git a/php-pecl-trie.spec b/php-pecl-trie.spec index b3dc79b..593128b 100644 --- a/php-pecl-trie.spec +++ b/php-pecl-trie.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-pecl-trie # -# Copyright (c) 2013-2022 Remi Collet +# Copyright (c) 2020-2022 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -19,17 +19,14 @@ Summary: PHP Trie extension Name: %{?sub_prefix}php-pecl-trie -Version: 0.1.1 -Release: 0%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 0.1.2 +Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz # headers only library Source1: https://github.com/Tessil/hat-trie/archive/v%{libver}.tar.gz -# https://github.com/ace411/php-trie-ext/pull/1 -Patch0: %{pecl_name}-build.patch - BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7.3 @@ -59,9 +56,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -q -c -a 1 -# https://github.com/ace411/php-trie-ext/issues/6 -mkdir NTS -mv LICENSE README.md changes.md common.cpp config.m4 config.w32 examples php_trie.cpp php_trie_ext.h tests trie.h NTS/ +mv %{pecl_name}-%{version} NTS # Don't install/register tests sed -e 's/role="test"/role="src"/' \ @@ -69,9 +64,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -# https://github.com/ace411/php-trie-ext/issues/7 -sed -e s/0.1.0/0.1.1/ -i php_trie_ext.h - # Sanity check, really often broken extver=$(sed -n '/#define PHP_TRIE_EXT_EXTVER/{s/.* "//;s/".*$//;p}' php_trie_ext.h) if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then @@ -206,6 +198,9 @@ TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \ %changelog +* Wed May 25 2022 Remi Collet <remi@remirepo.net> - 0.1.2-1 +- update to 0.1.2 + * Tue May 24 2022 Remi Collet <remi@remirepo.net> - 0.1.1-1 - update to 0.1.1 - open https://github.com/ace411/php-trie-ext/issues/6 bad archive diff --git a/php_trie-build.patch b/php_trie-build.patch deleted file mode 100644 index 81ad235..0000000 --- a/php_trie-build.patch +++ /dev/null @@ -1,204 +0,0 @@ -From c2e76aa7daf1829502736ed7d2659813bba52792 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Wed, 9 Sep 2020 09:13:44 +0200 -Subject: [PATCH 07/10] fix header config.m4 - ---- - config.m4 | 12 +++++------- - trie.h | 2 +- - 2 files changed, 6 insertions(+), 8 deletions(-) - -diff --git a/config.m4 b/config.m4 -index 2236ddf..52e086b 100644 ---- a/config.m4 -+++ b/config.m4 -@@ -15,30 +15,28 @@ if test "$PHP_PHP_TRIE" != "no"; then - AC_MSG_CHECKING([for Tessil/hat-trie library]) - if test -s $PHP_HATTRIE/$HATTRIE_HEADER; then - AC_MSG_RESULT(found $HATTRIE_HEADER) -- HATTRIE_LIB=$PHP_HATTRIE/$HATTRIE_HEADER -+ HATTRIE_LIB=$PHP_HATTRIE - else - for iter in $HEADER_INSTALL_DIRS; do - if test -s $iter/$HATTRIE_CPP_DIR/$HATTRIE_CPP_HEADER; then - AC_MSG_RESULT(found $HATTRIE_HEADER) -- HATTRIE_LIB=$iter/$HATTRIE_CPP_DIR/$HATTRIE_CPP_HEADER -+ HATTRIE_LIB=$iter/$HATTRIE_CPP_DIR - fi - done - fi - - if test -z "$HATTRIE_LIB"; then - AC_MSG_RESULT(hattrie lib is not properly installed. You will not be able to use the HAT trie) -- dnl AC_MSG_ERROR(Please install the hattrie library) -+ AC_MSG_ERROR(Please install the hattrie library) - fi - - dnl add support for C++ -- CXXFLAGS="-std=c++11" - PHP_REQUIRE_CXX() -+ PHP_ADD_INCLUDE($HATTRIE_LIB) - -- PHP_SUBST(PHP_TRIE_SHARED_LIBADD) - - dnl add C++11 standard library -- PHP_ADD_LIBRARY(stdc++, 1, PHP_TRIE_SHARED_LIBADD) - AC_DEFINE(HAVE_PHP_TRIE, 1, [ Have php_trie support ]) - -- PHP_NEW_EXTENSION(php_trie, php_trie.cpp, $ext_shared) -+ PHP_NEW_EXTENSION(php_trie, php_trie.cpp, $ext_shared,, -std=c++11, cxx) - fi -diff --git a/trie.h b/trie.h -index e653e80..b54918a 100644 ---- a/trie.h -+++ b/trie.h -@@ -15,7 +15,7 @@ - #include <utility> - #include <cstddef> - #include <string> --#include <hat-trie/include/tsl/htrie_map.h> -+#include <htrie_map.h> - - namespace trie - { - -From 8fff61e1dfd4fa2c22cc160711402bd68cdf525f Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Wed, 9 Sep 2020 09:14:42 +0200 -Subject: [PATCH 08/10] fix test, seems order was wrong - ---- - tests/trie/merge.phpt | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/tests/trie/merge.phpt b/tests/trie/merge.phpt -index e59f3b3..5c7bb9e 100644 ---- a/tests/trie/merge.phpt -+++ b/tests/trie/merge.phpt -@@ -21,8 +21,8 @@ array(4) { - string(3) "foo" - ["baz"]=> - int(12) -- ["baff"]=> -- bool(false) - ["bar"]=> - string(3) "bar" --} -\ No newline at end of file -+ ["baff"]=> -+ bool(false) -+} - -From 2b8feba9542c72339bf177169a776289212e2e5e Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Wed, 9 Sep 2020 09:21:49 +0200 -Subject: [PATCH 09/10] add module dependency on json - ---- - php_trie.cpp | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/php_trie.cpp b/php_trie.cpp -index 07d6015..1c766d7 100644 ---- a/php_trie.cpp -+++ b/php_trie.cpp -@@ -488,10 +488,17 @@ PHP_MINIT_FUNCTION(php_trie) - } - /* }}} */ - -+static zend_module_dep php_trie_deps[] = { -+ ZEND_MOD_REQUIRED("json") -+ ZEND_MOD_END -+}; -+ - /* {{{ php_trie_module_entry - */ - zend_module_entry php_trie_module_entry = { -- STANDARD_MODULE_HEADER, -+ STANDARD_MODULE_HEADER_EX, -+ NULL, -+ php_trie_deps, - "php_trie", /* Extension name */ - trie_methods, /* zend_function_entry */ - PHP_MINIT(php_trie), /* PHP_MINIT - Module initialization */ - -From cf7c464594e7c7628fdeb30159f7a458c61699d3 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Wed, 9 Sep 2020 09:25:12 +0200 -Subject: [PATCH 10/10] sort test result to avoid failure - ---- - tests/trie/merge.phpt | 16 +++++++++------- - 1 file changed, 9 insertions(+), 7 deletions(-) - -diff --git a/tests/trie/merge.phpt b/tests/trie/merge.phpt -index 5c7bb9e..4cdb86b 100644 ---- a/tests/trie/merge.phpt -+++ b/tests/trie/merge.phpt -@@ -13,16 +13,18 @@ $snd['baz'] = 12; - $thd = new Trie; - $thd['baff'] = false; - --var_dump($fst->merge($snd, $thd)->toArray()); -+$res = $fst->merge($snd, $thd)->toArray(); -+ksort($res); -+var_dump($res); - ?> - --EXPECT-- - array(4) { -- ["foo"]=> -- string(3) "foo" -- ["baz"]=> -- int(12) -- ["bar"]=> -- string(3) "bar" - ["baff"]=> - bool(false) -+ ["bar"]=> -+ string(3) "bar" -+ ["baz"]=> -+ int(12) -+ ["foo"]=> -+ string(3) "foo" - } -From b97b49ea191760e27d366fc5a487cb4313b300d3 Mon Sep 17 00:00:00 2001 -From: Remi Collet <remi@remirepo.net> -Date: Wed, 9 Sep 2020 10:04:21 +0200 -Subject: [PATCH] sort test result to avoid failure - ---- - tests/trie/map.phpt | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/tests/trie/map.phpt b/tests/trie/map.phpt -index aedf9e8..8cb0df8 100644 ---- a/tests/trie/map.phpt -+++ b/tests/trie/map.phpt -@@ -7,19 +7,19 @@ $trie['foo'] = 'FOO'; - $trie['bar'] = 'BAR'; - $trie['baz'] = 'BAZ'; - --var_dump( -- $trie -+$res = $trie - ->map('strtolower') - ->map('ucfirst') -- ->toArray() --); -+ ->toArray(); -+ksort($res); -+var_dump($res); - ?> - --EXPECT-- - array(3) { -- ["foo"]=> -- string(3) "Foo" - ["bar"]=> - string(3) "Bar" - ["baz"]=> - string(3) "Baz" --} -\ No newline at end of file -+ ["foo"]=> -+ string(3) "Foo" -+} |