diff options
author | Remi Collet <remi@remirepo.net> | 2021-08-23 11:55:18 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2021-08-23 11:55:18 +0200 |
commit | 41881ebeabded9ccdb2b03c649c9e46422256a95 (patch) | |
tree | d5b97859ac3ae10f9c0d5b54c52e2d5eda41ffb1 | |
parent | 05784e75c66f54d47e1ecc1128850cf247c7cdc9 (diff) |
update to 0.9.4
-rw-r--r-- | PHPINFO | 2 | ||||
-rw-r--r-- | REFLECTION | 2 | ||||
-rw-r--r-- | php-pecl-jsonpath.spec | 10 | ||||
-rw-r--r-- | sort_recursively.php | 40 |
4 files changed, 6 insertions, 48 deletions
@@ -2,4 +2,4 @@ jsonpath jsonpath support => enabled -jsonpath version => 0.9.3 +jsonpath version => 0.9.4 @@ -1,4 +1,4 @@ -Extension [ <persistent> extension #116 jsonpath version 0.9.3 ] { +Extension [ <persistent> extension #116 jsonpath version 0.9.4 ] { - Classes [2] { Class [ <internal:jsonpath> 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 <remi@remirepo.net> - 0.9.4-1 +- update to 0.9.4 + * Mon Aug 9 2021 Remi Collet <remi@remirepo.net> - 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 @@ -<?php - -/** - * Comparison function for custom sort. Tries to achieve a canonical sort order across PHP versions - * by sorting primarily by type, secondarily by value. - * @param mixed $a - * @param mixed $b - * - * @return int - */ -function byTypeAndValue($a, $b): int -{ - if (gettype($a) !== gettype($b)) { - return gettype($a) <=> 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); - } - } -} |