summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--69.patch22
-rw-r--r--PHPINFO4
-rw-r--r--REFLECTION124
-rw-r--r--php-pecl-mustache.spec183
5 files changed, 192 insertions, 143 deletions
diff --git a/.gitignore b/.gitignore
index 1ab5c4f..01f0400 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
+clog
package-*.xml
*.tgz
+*.tar.bz2
*.tar.gz
*.tar.xz
*.tar.xz.asc
diff --git a/69.patch b/69.patch
new file mode 100644
index 0000000..6cbdffe
--- /dev/null
+++ b/69.patch
@@ -0,0 +1,22 @@
+From b7dca6820a2e90b64fde3f0fe2af35f4cbffae6f Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Fri, 18 Jul 2025 06:31:34 +0200
+Subject: [PATCH] drop zend_exception_get_default usage
+
+---
+ mustache_exceptions.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mustache_exceptions.cpp b/mustache_exceptions.cpp
+index bae387c..6e90437 100644
+--- a/mustache_exceptions.cpp
++++ b/mustache_exceptions.cpp
+@@ -18,7 +18,7 @@ zend_class_entry * MustacheParserException_ce_ptr;
+ PHP_MINIT_FUNCTION(mustache_exceptions)
+ {
+ try {
+- zend_class_entry * exception_ce = zend_exception_get_default();
++ zend_class_entry * exception_ce = zend_ce_exception;
+
+ // MustacheException
+ zend_class_entry mustache_exception_ce;
diff --git a/PHPINFO b/PHPINFO
index b407935..192f2a4 100644
--- a/PHPINFO
+++ b/PHPINFO
@@ -1,8 +1,8 @@
mustache
-Version => 0.9.0
-Released => 2019-05-27
+Version => 0.9.3
+Released => 2022-11-26
Revision => master
Authors => John Boehr <jbboehr@gmail.com> (lead)
Spec Version => 1.1.2
diff --git a/REFLECTION b/REFLECTION
index b6efda0..ee666bc 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,7 +1,7 @@
-Extension [ <persistent> extension #124 mustache version 0.9.0 ] {
+Extension [ <persistent> extension #122 mustache version 0.9.3 ] {
- Classes [7] {
- Class [ <internal:mustache> class MustacheAST ] {
+ Class [ <internal:mustache> class MustacheAST implements Stringable ] {
- Constants [0] {
}
@@ -13,14 +13,14 @@ Extension [ <persistent> extension #124 mustache version 0.9.0 ] {
}
- Properties [1] {
- Property [ <default> protected $binaryString ]
+ Property [ protected $binaryString = NULL ]
}
- Methods [5] {
Method [ <internal:mustache, ctor> public method __construct ] {
- Parameters [1] {
- Parameter #0 [ <optional> $vars ]
+ Parameter #0 [ <optional> $vars = <default> ]
}
}
@@ -36,10 +36,11 @@ Extension [ <persistent> extension #124 mustache version 0.9.0 ] {
}
}
- Method [ <internal:mustache> public method __toString ] {
+ Method [ <internal:mustache, prototype Stringable> public method __toString ] {
- Parameters [0] {
}
+ - Return [ string ]
}
Method [ <internal:mustache> public method __wakeup ] {
@@ -172,7 +173,7 @@ Extension [ <persistent> extension #124 mustache version 0.9.0 ] {
}
}
- Class [ <internal:mustache> class MustacheTemplate ] {
+ Class [ <internal:mustache> class MustacheTemplate implements Stringable ] {
- Constants [0] {
}
@@ -184,26 +185,27 @@ Extension [ <persistent> extension #124 mustache version 0.9.0 ] {
}
- Properties [1] {
- Property [ <default> protected $template ]
+ Property [ protected $template = NULL ]
}
- Methods [2] {
Method [ <internal:mustache, ctor> public method __construct ] {
- Parameters [1] {
- Parameter #0 [ <optional> $vars ]
+ Parameter #0 [ <optional> $vars = <default> ]
}
}
- Method [ <internal:mustache> public method __toString ] {
+ Method [ <internal:mustache, prototype Stringable> public method __toString ] {
- Parameters [0] {
}
+ - Return [ string ]
}
}
}
- Class [ <internal:mustache> class MustacheException extends Exception implements Throwable ] {
+ Class [ <internal:mustache> class MustacheException extends Exception implements Throwable, Stringable ] {
- Constants [0] {
}
@@ -215,52 +217,86 @@ Extension [ <persistent> extension #124 mustache version 0.9.0 ] {
}
- Properties [4] {
- Property [ <default> protected $message ]
- Property [ <default> protected $code ]
- Property [ <default> protected $file ]
- Property [ <default> protected $line ]
+ Property [ protected $message = '' ]
+ Property [ protected $code = 0 ]
+ Property [ protected $file = NULL ]
+ Property [ protected $line = NULL ]
}
- Methods [10] {
Method [ <internal:Core, inherits Exception, ctor> public method __construct ] {
- Parameters [3] {
- Parameter #0 [ <optional> $message ]
- Parameter #1 [ <optional> $code ]
- Parameter #2 [ <optional> $previous ]
+ Parameter #0 [ <optional> string $message = "" ]
+ Parameter #1 [ <optional> int $code = 0 ]
+ Parameter #2 [ <optional> ?Throwable $previous = null ]
}
}
Method [ <internal:Core, inherits Exception> public method __wakeup ] {
+
+ - Parameters [0] {
+ }
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getMessage ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getCode ] {
+
+ - Parameters [0] {
+ }
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getFile ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getLine ] {
+
+ - Parameters [0] {
+ }
+ - Return [ int ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTrace ] {
+
+ - Parameters [0] {
+ }
+ - Return [ array ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getPrevious ] {
+
+ - Parameters [0] {
+ }
+ - Return [ ?Throwable ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTraceAsString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
- Method [ <internal:Core, inherits Exception, prototype Throwable> public method __toString ] {
+ Method [ <internal:Core, inherits Exception, prototype Stringable> public method __toString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
}
}
- Class [ <internal:mustache> class MustacheParserException extends MustacheException implements Throwable ] {
+ Class [ <internal:mustache> class MustacheParserException extends MustacheException implements Stringable, Throwable ] {
- Constants [0] {
}
@@ -272,47 +308,81 @@ Extension [ <persistent> extension #124 mustache version 0.9.0 ] {
}
- Properties [4] {
- Property [ <default> protected $message ]
- Property [ <default> protected $code ]
- Property [ <default> protected $file ]
- Property [ <default> protected $line ]
+ Property [ protected $message = '' ]
+ Property [ protected $code = 0 ]
+ Property [ protected $file = NULL ]
+ Property [ protected $line = NULL ]
}
- Methods [10] {
Method [ <internal:Core, inherits Exception, ctor> public method __construct ] {
- Parameters [3] {
- Parameter #0 [ <optional> $message ]
- Parameter #1 [ <optional> $code ]
- Parameter #2 [ <optional> $previous ]
+ Parameter #0 [ <optional> string $message = "" ]
+ Parameter #1 [ <optional> int $code = 0 ]
+ Parameter #2 [ <optional> ?Throwable $previous = null ]
}
}
Method [ <internal:Core, inherits Exception> public method __wakeup ] {
+
+ - Parameters [0] {
+ }
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getMessage ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getCode ] {
+
+ - Parameters [0] {
+ }
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getFile ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getLine ] {
+
+ - Parameters [0] {
+ }
+ - Return [ int ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTrace ] {
+
+ - Parameters [0] {
+ }
+ - Return [ array ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getPrevious ] {
+
+ - Parameters [0] {
+ }
+ - Return [ ?Throwable ]
}
Method [ <internal:Core, inherits Exception, prototype Throwable> final public method getTraceAsString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
- Method [ <internal:Core, inherits Exception, prototype Throwable> public method __toString ] {
+ Method [ <internal:Core, inherits Exception, prototype Stringable> public method __toString ] {
+
+ - Parameters [0] {
+ }
+ - Return [ string ]
}
}
}
diff --git a/php-pecl-mustache.spec b/php-pecl-mustache.spec
index 206319f..abf796a 100644
--- a/php-pecl-mustache.spec
+++ b/php-pecl-mustache.spec
@@ -1,80 +1,48 @@
# remirepo spec file for php-pecl-mustache
#
-# Copyright (c) 2017-2019 Remi Collet
-# License: CC-BY-SA
-# http://creativecommons.org/licenses/by-sa/4.0/
+# SPDX-FileCopyrightText: Copyright 2017-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-mustache
-%endif
-%global pecl_name mustache
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%global ini_name 40-%{pecl_name}.ini
-%global with_tests 0%{!?_without_tests:1}
+%{?scl:%scl_package php-pecl-mustache}
+
+%bcond_without tests
-%global upstream_version 0.9.0
+%global pecl_name mustache
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global ini_name 40-%{pecl_name}.ini
+%global upstream_version 0.9.3
#global upstream_prever RC2
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
Summary: Mustache templating language
-Name: %{?sub_prefix}php-pecl-%{pecl_name}
+Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: MIT
-URL: http://pecl.php.net/package/%{pecl_name}
-Source0: http://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+URL: https://pecl.php.net/package/%{pecl_name}
+Source0: https://pecl.php.net/get/%{sources}.tgz
+
+Patch0: 69.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: pkgconfig(mustache) >= 0.5.0
-%if 0%{?rhel} == 7
-BuildRequires: devtoolset-6-toolchain
-%else
BuildRequires: gcc-c++
-%endif
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
-
-%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# Other third party repo stuff
-%if "%{php_version}" > "7.1"
-Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.2"
-Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-Obsoletes: php73w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-Obsoletes: php74w-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
-
-%if 0%{?fedora} < 20 && 0%{?rhel} < 7
-# Filter shared private
-%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
-%{?filter_setup}
-%endif
%description
@@ -86,14 +54,15 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
- %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -e '/LICENSE/s/role="doc"/role="src"/' \
-i package.xml
-cd NTS
+cd %{sources}
+%patch -P0 -p1
+
# Sanity check, really often broken
extver=$(sed -n '/PHP_MUSTACHE_VERSION/{s/.* "//;s/".*$//;p}' php_mustache.h)
if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
@@ -102,9 +71,9 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -115,37 +84,29 @@ EOF
%build
-%if 0%{?rhel} == 7
-source /opt/rh/devtoolset-6/enable
-g++ --version
-%endif
+cd %{sources}
+%{__phpize}
-cd NTS
-%{_bindir}/phpize
+cd ../NTS
%configure \
--enable-mustache \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
--enable-mustache \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
%install
-%if 0%{?rhel} == 7
-source /opt/rh/devtoolset-6/enable
-%endif
-
make -C NTS install INSTALL_ROOT=%{buildroot}
# install config file
@@ -162,68 +123,41 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%if 0%{?fedora} < 24 && 0%{?rhel} < 8
-# when pear installed alone, after us
-%triggerin -- %{?scl_prefix}php-pear
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-# posttrans as pear can be installed after us
-%posttrans
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-%postun
-if [ $1 -eq 0 -a -x %{__pecl} ] ; then
- %{pecl_uninstall} %{pecl_name} >/dev/null || :
-fi
-%endif
-
-
%check
+cd %{sources}
+
: Minimal load test for NTS extension
-cd NTS
%{__php} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --define extension=../NTS/modules/%{pecl_name}.so \
+ --modules | grep '^%{pecl_name}$'
-%if %{with_tests}
+%if %{with tests}
+OPTS="-P -q --show-diff %{?_smp_mflags}"
+%if "%{php_version}" > "7.4"
+OPTS="$OPTS %{?_smp_mflags}"
+%endif
+
# Upstream test suite
-TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
+TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php --show-diff
+%{__php} -n run-tests.php $OPTS
%endif
%if %{with_zts}
: Minimal load test for ZTS extension
-cd ../ZTS
%{__ztsphp} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
- --modules | grep %{pecl_name}
-
-%if %{with_tests}
-# Upstream test suite
-TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
-REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php --show-diff
-%endif
+ --define extension=../ZTS/modules/%{pecl_name}.so \
+ --modules | grep '^%{pecl_name}$'
%endif
%files
-%{!?_licensedir:%global license %%doc}
-%license NTS/LICENSE.md
+%license %{sources}/LICENSE.md
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -236,8 +170,29 @@ REPORT_EXIT_STATUS=1 \
%endif
-# Notice no more EL-6 build (compiler issue and segfaults)
%changelog
+* Fri Jul 18 2025 Remi Collet <remi@remirepo.net> - 0.9.3-3
+- add fix for PHP 8.5.0alpha2 using patch from
+ https://github.com/jbboehr/php-mustache/pull/69
+- re-license spec file to CECILL-2.1
+
+* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 0.9.3-2
+- build out of sources tree
+
+* Mon Nov 28 2022 Remi Collet <remi@remirepo.net> - 0.9.3-1
+- update to 0.9.3
+- drop patch merged upstream
+
+* Tue Sep 13 2022 Remi Collet <remi@remirepo.net> - 0.9.2-2
+- add patch for PHP 8.2 from
+ https://github.com/jbboehr/php-mustache/pull/67
+
+* Fri Nov 13 2020 Remi Collet <remi@remirepo.net> - 0.9.2-1
+- update to 0.9.2
+
+* Wed Dec 11 2019 Remi Collet <remi@remirepo.net> - 0.9.1-1
+- update to 0.9.1
+
* Tue Sep 03 2019 Remi Collet <remi@remirepo.net> - 0.9.0-4
- rebuild for 7.4.0RC1