diff options
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | PHPINFO | 9 | ||||
| -rw-r--r-- | REFLECTION | 236 | ||||
| -rw-r--r-- | composer.json | 14 | ||||
| -rw-r--r-- | php-zstd.spec | 99 |
5 files changed, 272 insertions, 88 deletions
@@ -1,4 +1,4 @@ SRCDIR := $(shell pwd) NAME := $(shell basename $(SRCDIR)) -include ../../common/Makefile +include ../../../common/Makefile @@ -2,6 +2,11 @@ zstd Zstd support => enabled -Extension Version => 0.13.3 -Interface Version => 1.5.5 +Extension Version => 0.15.2 +Interface Version => 1.5.7 APCu serializer ABI => 0 + +Directive => Local Value => Master Value +zstd.output_compression => Off => Off +zstd.output_compression_level => 3 => 3 +zstd.output_compression_dict => no value => no value @@ -1,142 +1,288 @@ -Extension [ <persistent> extension #81 zstd version 0.13.3 ] { +Extension [ <persistent> extension #131 zstd version 0.15.2 ] { - Dependencies { Dependency [ apcu (Optional) ] } + - INI { + Entry [ zstd.output_compression <ALL> ] + Current = '0' + } + Entry [ zstd.output_compression_level <ALL> ] + Current = '3' + } + Entry [ zstd.output_compression_dict <ALL> ] + Current = '' + } + } + - Constants [5] { Constant [ int ZSTD_COMPRESS_LEVEL_MIN ] { 1 } Constant [ int ZSTD_COMPRESS_LEVEL_MAX ] { 22 } Constant [ int ZSTD_COMPRESS_LEVEL_DEFAULT ] { 3 } - Constant [ int LIBZSTD_VERSION_NUMBER ] { 10505 } - Constant [ string LIBZSTD_VERSION_STRING ] { 1.5.5 } + Constant [ int ZSTD_VERSION_NUMBER ] { 10507 } + Constant [ string ZSTD_VERSION_TEXT ] { 1.5.7 } } - Functions { Function [ <internal:zstd> function zstd_compress ] { - - Parameters [2] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <optional> $level = <default> ] + - Parameters [3] { + Parameter #0 [ <required> string $data ] + Parameter #1 [ <optional> int $level = ZSTD_COMPRESS_LEVEL_DEFAULT ] + Parameter #2 [ <optional> ?string $dict = null ] } + - Return [ string|false ] } Function [ <internal:zstd> function zstd_uncompress ] { - - Parameters [1] { - Parameter #0 [ <required> $data ] + - Parameters [2] { + Parameter #0 [ <required> string $data ] + Parameter #1 [ <optional> ?string $dict = null ] } + - Return [ string|false ] } Function [ <internal:zstd> function zstd_decompress ] { - - Parameters [1] { - Parameter #0 [ <required> $data ] + - Parameters [2] { + Parameter #0 [ <required> string $data ] + Parameter #1 [ <optional> ?string $dict = null ] } + - Return [ string|false ] } Function [ <internal:zstd> function zstd_compress_dict ] { - Parameters [3] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] - Parameter #2 [ <optional> $level = <default> ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] + Parameter #2 [ <optional> int $level = ZSTD_COMPRESS_LEVEL_DEFAULT ] } + - Return [ string|false ] } Function [ <internal:zstd> function zstd_uncompress_dict ] { - Parameters [2] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] } + - Return [ string|false ] } Function [ <internal:zstd> function zstd_compress_usingcdict ] { - Parameters [3] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] - Parameter #2 [ <optional> $level = <default> ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] + Parameter #2 [ <optional> int $level = ZSTD_COMPRESS_LEVEL_DEFAULT ] } + - Return [ string|false ] } Function [ <internal:zstd> function zstd_decompress_dict ] { - Parameters [2] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] } + - Return [ string|false ] } Function [ <internal:zstd> function zstd_uncompress_usingcdict ] { - Parameters [2] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] } + - Return [ string|false ] } Function [ <internal:zstd> function zstd_decompress_usingcdict ] { - Parameters [2] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] } + - Return [ string|false ] } - Function [ <internal:zstd> function Zstd\compress ] { + Function [ <internal:zstd> function zstd_compress_init ] { - Parameters [2] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <optional> $level = <default> ] + Parameter #0 [ <optional> int $level = ZSTD_COMPRESS_LEVEL_DEFAULT ] + Parameter #1 [ <optional> ?string $dict = null ] } + - Return [ Zstd\Compress\Context|false ] } - Function [ <internal:zstd> function Zstd\uncompress ] { + Function [ <internal:zstd> function zstd_compress_add ] { + + - Parameters [3] { + Parameter #0 [ <required> Zstd\Compress\Context $context ] + Parameter #1 [ <required> string $data ] + Parameter #2 [ <optional> bool $end = false ] + } + - Return [ string|false ] + } + Function [ <internal:zstd> function zstd_uncompress_init ] { - Parameters [1] { - Parameter #0 [ <required> $data ] + Parameter #0 [ <optional> ?string $dict = null ] } + - Return [ Zstd\UnCompress\Context|false ] + } + Function [ <internal:zstd> function zstd_uncompress_add ] { + + - Parameters [2] { + Parameter #0 [ <required> Zstd\UnCompress\Context $context ] + Parameter #1 [ <required> string $data ] + } + - Return [ string|false ] + } + Function [ <internal:zstd> function Zstd\compress ] { + + - Parameters [3] { + Parameter #0 [ <required> string $data ] + Parameter #1 [ <optional> int $level = ZSTD_COMPRESS_LEVEL_DEFAULT ] + Parameter #2 [ <optional> ?string $dict = null ] + } + - Return [ string|false ] + } + Function [ <internal:zstd> function Zstd\uncompress ] { + + - Parameters [2] { + Parameter #0 [ <required> string $data ] + Parameter #1 [ <optional> ?string $dict = null ] + } + - Return [ string|false ] } Function [ <internal:zstd> function Zstd\decompress ] { - - Parameters [1] { - Parameter #0 [ <required> $data ] + - Parameters [2] { + Parameter #0 [ <required> string $data ] + Parameter #1 [ <optional> ?string $dict = null ] } + - Return [ string|false ] } Function [ <internal:zstd> function Zstd\compress_dict ] { - Parameters [3] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] - Parameter #2 [ <optional> $level = <default> ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] + Parameter #2 [ <optional> int $level = ZSTD_COMPRESS_LEVEL_DEFAULT ] } + - Return [ string|false ] } Function [ <internal:zstd> function Zstd\compress_usingcdict ] { - Parameters [3] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] - Parameter #2 [ <optional> $level = <default> ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] + Parameter #2 [ <optional> int $level = ZSTD_COMPRESS_LEVEL_DEFAULT ] } + - Return [ string|false ] } Function [ <internal:zstd> function Zstd\uncompress_dict ] { - Parameters [2] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] } + - Return [ string|false ] } Function [ <internal:zstd> function Zstd\decompress_dict ] { - Parameters [2] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] } + - Return [ string|false ] } Function [ <internal:zstd> function Zstd\uncompress_usingcdict ] { - Parameters [2] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] } + - Return [ string|false ] } Function [ <internal:zstd> function Zstd\decompress_usingcdict ] { - Parameters [2] { - Parameter #0 [ <required> $data ] - Parameter #1 [ <required> $dictBuffer ] + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> string $dict ] + } + - Return [ string|false ] + } + Function [ <internal:zstd> function Zstd\compress_init ] { + + - Parameters [2] { + Parameter #0 [ <optional> int $level = ZSTD_COMPRESS_LEVEL_DEFAULT ] + Parameter #1 [ <optional> ?string $dict = null ] + } + - Return [ Zstd\Compress\Context|false ] + } + Function [ <internal:zstd> function Zstd\compress_add ] { + + - Parameters [3] { + Parameter #0 [ <required> Zstd\Compress\Context $context ] + Parameter #1 [ <required> string $data ] + Parameter #2 [ <optional> bool $end = false ] + } + - Return [ string|false ] + } + Function [ <internal:zstd> function Zstd\uncompress_init ] { + + - Parameters [1] { + Parameter #0 [ <optional> ?string $dict = null ] + } + - Return [ Zstd\UnCompress\Context|false ] + } + Function [ <internal:zstd> function Zstd\uncompress_add ] { + + - Parameters [2] { + Parameter #0 [ <required> Zstd\UnCompress\Context $context ] + Parameter #1 [ <required> string $data ] + } + - Return [ string|false ] + } + Function [ <internal:zstd> function ob_zstd_handler ] { + + - Parameters [2] { + Parameter #0 [ <required> string $data ] + Parameter #1 [ <required> int $flags ] + } + - Return [ string|false ] + } + } + + - Classes [2] { + Class [ <internal:zstd> final class Zstd\Compress\Context ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [0] { + } + } + + Class [ <internal:zstd> final class Zstd\UnCompress\Context ] { + + - Constants [0] { + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [0] { } } } diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..0797215 --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "kjdev/zstd", + "type": "php-ext", + "license": "MIT", + "description": "A compression/decompression with Zstandard", + "require": { + "php": ">= 7.0.0" + }, + "php-ext": { + "extension-name": "zstd", + "download-url-method": "pre-packaged-source", + "configure-options": [] + } +} diff --git a/php-zstd.spec b/php-zstd.spec index 4d18d72..4149a18 100644 --- a/php-zstd.spec +++ b/php-zstd.spec @@ -1,8 +1,8 @@ # remirepo spec file for php-zstd # -# Copyright (c) 2018-2024 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2018-2026 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # @@ -13,34 +13,42 @@ %bcond_without apcu %bcond_without libzstd -%global zstdver 1.5.5 +%global zstdver 1.5.6 %global pecl_name zstd +%global pie_vend kjdev +%global pie_proj zstd %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global ini_name 40-%{pecl_name}.ini %global buildver %(pkg-config --silence-errors --modversion libzstd 2>/dev/null || echo 65536) -%global sources %{pecl_name}-%{version} +%global sources %{gh_proj}-%{version} %global _configure ../%{sources}/configure +# Github forge +%global gh_vend kjdev +%global gh_proj php-ext-zstd +%global forgeurl https://github.com/%{gh_vend}/%{gh_proj} +%global tag %{version} + Summary: Zstandard extension Name: %{?scl_prefix}php-%{pecl_name} -Version: 0.13.3 -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Version: 0.15.2 +%forgemeta +Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} %if %{with libzstd} License: MIT %else # bundled library is BSD-3-Clause License: MIT AND BSD-3-Clause %endif -URL: https://pecl.php.net/package/%{pecl_name} -Source0: https://pecl.php.net/get/%{sources}.tgz +URL: %{forgeurl} +Source0: %{forgesource} BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 7.0 %if %{with apcu} BuildRequires: %{?scl_prefix}php-pecl-apcu-devel %endif -BuildRequires: %{?scl_prefix}php-pear %if %{with libzstd} BuildRequires: libzstd-devel >= 1.4 Requires: libzstd%{?_isa} >= %{buildver} @@ -51,10 +59,14 @@ Provides: bundled(libzstd) = %{zstdver} Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version} -Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version} -Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} -Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +# PECL +Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version} +Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +# PIE +Provides: %{?scl_prefix}php-pie(%{pie_vend}/%{pie_proj}) = %{version} +Provides: %{?scl_prefix}php-%{pie_vend}-%{pie_proj} = %{version} %description @@ -77,13 +89,10 @@ These are the files needed to compile programs using %{name}. %prep %setup -qc -sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml - cd %{sources} %if %{with libzstd} # Use the system library rm -r zstd -sed -e '\:"zstd/:d' -i ../package.xml %else cp zstd/LICENSE LICENSE-libzstd %endif @@ -105,6 +114,11 @@ mkdir ZTS cat << 'EOF' | tee %{ini_name} ; Enable '%{summary}' extension module extension = %{pecl_name}.so + +; Configuration +;zstd.output_compression = Off +;zstd.output_compression_level = 3 +;zstd.output_compression_dict = EOF @@ -148,25 +162,12 @@ cd ../ZTS %make_install -C NTS install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} -# Install XML package description -install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml - %if %{with_zts} # Install the ZTS stuff %make_install -C ZTS install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif -# Test & Documentation -cd %{sources} -for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 $i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i -done -for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i -done - - %check cd %{sources} @@ -206,20 +207,13 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ %{__ztsphp} --no-php-ini \ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' - -%if %{with tests} -: Upstream test suite for ZTS extension -TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ -%{__ztsphp} -n run-tests.php -q --offline --show-diff -%endif %endif %files %license %{sources}/LICENSE -%doc %{pecl_docdir}/%{pecl_name} -%{pecl_xmldir}/%{name}.xml +%doc %{sources}/composer.json +%doc %{sources}/*.md %if ! %{with libzstd} %license %{sources}/LICENSE-libzstd %endif @@ -234,7 +228,7 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ %files devel -%doc %{pecl_testdir}/%{pecl_name} +%doc %{sources}/tests %{php_incldir}/ext/%{pecl_name} %if %{with_zts} @@ -243,6 +237,31 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ %changelog +* Wed Mar 11 2026 Remi Collet <remi@remirepo.net> - 0.15.2-3 +- drop pear/pecl dependency +- sources from github + +* Thu Sep 25 2025 Remi Collet <remi@remirepo.net> - 0.15.2-2 +- rebuild for PHP 8.5.0RC1 + +* Tue Sep 2 2025 Remi Collet <remi@remirepo.net> - 0.15.2-1 +- update to 0.15.2 + +* Mon Aug 18 2025 Remi Collet <remi@remirepo.net> - 0.15.1-1 +- update to 0.15.1 + +* Wed Aug 13 2025 Remi Collet <remi@remirepo.net> - 0.15.0-1 +- update to 0.15.0 +- drop patch merged upstream + +* Wed Jul 30 2025 Remi Collet <remi@remirepo.net> - 0.14.0-2 +- fix for PHP 8.5.0alpha3 using patch from + https://github.com/kjdev/php-ext-zstd/pull/88 +- re-license spec file to CECILL-2.1 + +* Wed Nov 6 2024 Remi Collet <remi@remirepo.net> - 0.14.0-1 +- update to 0.14.0 + * Mon Jan 29 2024 Remi Collet <remi@remirepo.net> - 0.13.3-1 - update to 0.13.3 |
