From 41881ebeabded9ccdb2b03c649c9e46422256a95 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 23 Aug 2021 11:55:18 +0200 Subject: update to 0.9.4 --- PHPINFO | 2 +- REFLECTION | 2 +- php-pecl-jsonpath.spec | 10 ++++------ sort_recursively.php | 40 ---------------------------------------- 4 files changed, 6 insertions(+), 48 deletions(-) delete mode 100644 sort_recursively.php diff --git a/PHPINFO b/PHPINFO index f5a8932..1e89858 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,4 +2,4 @@ jsonpath jsonpath support => enabled -jsonpath version => 0.9.3 +jsonpath version => 0.9.4 diff --git a/REFLECTION b/REFLECTION index d89f97e..108df5c 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #116 jsonpath version 0.9.3 ] { +Extension [ extension #116 jsonpath version 0.9.4 ] { - Classes [2] { Class [ class JsonPath\JsonPath ] { diff --git a/php-pecl-jsonpath.spec b/php-pecl-jsonpath.spec index 8aa55ea..1e5b9c1 100644 --- a/php-pecl-jsonpath.spec +++ b/php-pecl-jsonpath.spec @@ -25,14 +25,12 @@ Summary: Extract data using JSONPath notation Name: %{?sub_prefix}php-pecl-jsonpath -Version: 0.9.3 +Version: 0.9.4 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}%{?prever}.tgz -Source1: https://raw.githubusercontent.com/supermetrics-public/pecl-jsonpath/v%{version}/tests/utils/sort_recursively.php - BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7.4 @@ -77,9 +75,6 @@ sed -e 's/role="test"/role="src"/' \ -i package.xml cd NTS -mkdir tests/utils -cp %{SOURCE1} tests/utils - # Sanity check, really often broken extver=$(sed -n '/#define PHP_JSONPATH_VERSION/{s/.* "//;s/".*$//;p}' php_jsonpath.h) if test "x${extver}" != "x%{version}%{?prever}"; then @@ -201,6 +196,9 @@ cd ../ZTS %changelog +* Mon Aug 23 2021 Remi Collet - 0.9.4-1 +- update to 0.9.4 + * Mon Aug 9 2021 Remi Collet - 0.9.3-1 - initial package - open https://github.com/supermetrics-public/pecl-jsonpath/pull/137 diff --git a/sort_recursively.php b/sort_recursively.php deleted file mode 100644 index 4d089e1..0000000 --- a/sort_recursively.php +++ /dev/null @@ -1,40 +0,0 @@ - gettype($b); - } else { - return $a <=> $b; - } -} - -/** - * Sort an array by its values, recursively - * @param array &$array - */ -function sortRecursively(array &$array): void -{ - // Sequential array, re-index after sorting - if (array_keys($array) === range(0, count($array) - 1)) { - usort($array, 'byTypeAndValue'); - } - // Associative array, maintain keys - else { - uasort($array, 'byTypeAndValue'); - } - - foreach ($array as &$value) { - if (is_array($value)) { - sortRecursively($value); - } - } -} -- cgit