From 5c4ca5de4cd5dcebb63d17a5cea18ce182e310a2 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 13 Jan 2020 08:53:35 +0100 Subject: update to 4.0.2 sources from pecl --- .gitignore | 7 +++- PHPINFO | 6 +-- REFLECTION | 96 ++++++++++++++++++++++++++++++-------------- php-phalcon4.spec | 116 ++++++++++++++++++++++++++++++++++-------------------- 4 files changed, 149 insertions(+), 76 deletions(-) diff --git a/.gitignore b/.gitignore index af9f2ef..fc9aa8c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ -*.tar.xz +clog +package-*.xml +*.tgz *.tar.gz +*.tar.xz +*.tar.xz.asc *.src.rpm +*/*rpm diff --git a/PHPINFO b/PHPINFO index 89b47e8..f47b0a7 100644 --- a/PHPINFO +++ b/PHPINFO @@ -5,9 +5,9 @@ phalcon Phalcon is a full stack PHP framework, delivered as a PHP extension, offering lower resource consumption and high performance. phalcon => enabled Author => Phalcon Team and contributors -Version => 4.0.0 -Build Date => Dec 22 2019 00:00:00 -Powered by Zephir => Version 0.12.10-fedc314 +Version => 4.0.2 +Build Date => Jan 13 2020 00:00:00 +Powered by Zephir => Version 0.12.15-814db50 Directive => Local Value => Master Value phalcon.db.escape_identifiers => On => On diff --git a/REFLECTION b/REFLECTION index 52bcac3..0110c02 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #106 phalcon version 4.0.0 ] { +Extension [ extension #106 phalcon version 4.0.2 ] { - Dependencies { Dependency [ pdo (Required) ] @@ -15993,10 +15993,25 @@ Extension [ extension #106 phalcon version 4.0.0 ] { - Static methods [0] { } - - Properties [0] { + - Properties [1] { + Property [ protected $dateFormat ] } - - Methods [2] { + - Methods [5] { + Method [ public method getDateFormat ] { + + - Parameters [0] { + } + - Return [ string ] + } + + Method [ public method setDateFormat ] { + + - Parameters [1] { + Parameter #0 [ string $dateFormat ] + } + } + Method [ public method interpolate ] { - Parameters [2] { @@ -16005,6 +16020,13 @@ Extension [ extension #106 phalcon version 4.0.0 ] { } } + Method [ protected method getFormattedDate ] { + + - Parameters [0] { + } + - Return [ string ] + } + Method [ abstract public method format ] { - Parameters [1] { @@ -44423,34 +44445,34 @@ Extension [ extension #106 phalcon version 4.0.0 ] { Property [ protected $dateFormat ] } - - Methods [5] { - Method [ public method getDateFormat ] { + - Methods [6] { + Method [ public method __construct ] { - - Parameters [0] { + - Parameters [1] { + Parameter #0 [ string $dateFormat ] } - - Return [ string ] } - Method [ public method setDateFormat ] { + Method [ public method format ] { - Parameters [1] { - Parameter #0 [ string $dateFormat ] + Parameter #0 [ Phalcon\Logger\Item $item ] } + - Return [ string ] } - Method [ public method __construct ] { + Method [ public method getDateFormat ] { - - Parameters [1] { - Parameter #0 [ string $dateFormat ] + - Parameters [0] { } + - Return [ string ] } - Method [ public method format ] { + Method [ public method setDateFormat ] { - Parameters [1] { - Parameter #0 [ Phalcon\Logger\Item $item ] + Parameter #0 [ string $dateFormat ] } - - Return [ string ] } Method [ public method interpolate ] { @@ -44460,6 +44482,13 @@ Extension [ extension #106 phalcon version 4.0.0 ] { Parameter #1 [ $context ] } } + + Method [ protected method getFormattedDate ] { + + - Parameters [0] { + } + - Return [ string ] + } } } @@ -44479,21 +44508,7 @@ Extension [ extension #106 phalcon version 4.0.0 ] { Property [ protected $format ] } - - Methods [7] { - Method [ public method getDateFormat ] { - - - Parameters [0] { - } - - Return [ string ] - } - - Method [ public method setDateFormat ] { - - - Parameters [1] { - Parameter #0 [ string $dateFormat ] - } - } - + - Methods [8] { Method [ public method getFormat ] { - Parameters [0] { @@ -44524,6 +44539,20 @@ Extension [ extension #106 phalcon version 4.0.0 ] { - Return [ string ] } + Method [ public method getDateFormat ] { + + - Parameters [0] { + } + - Return [ string ] + } + + Method [ public method setDateFormat ] { + + - Parameters [1] { + Parameter #0 [ string $dateFormat ] + } + } + Method [ public method interpolate ] { - Parameters [2] { @@ -44531,6 +44560,13 @@ Extension [ extension #106 phalcon version 4.0.0 ] { Parameter #1 [ $context ] } } + + Method [ protected method getFormattedDate ] { + + - Parameters [0] { + } + - Return [ string ] + } } } diff --git a/php-phalcon4.spec b/php-phalcon4.spec index f6f9047..aade475 100644 --- a/php-phalcon4.spec +++ b/php-phalcon4.spec @@ -1,6 +1,6 @@ # remirepo spec file for php-phalcon4 # -# Copyright (c) 2014-2019 Remi Collet +# Copyright (c) 2014-2020 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -23,12 +23,12 @@ %global gh_project cphalcon %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global with_tests 0%{?_with_tests:1} -%global ext_name phalcon +%global pecl_name phalcon # See ext/php_phalcon.h -#global zephir_ver 0.12.10 +#global zephir_ver 0.12.15 # after 40-json.ini, 20-pdo.ini, 40-psr.ini -%global ini_name 50-%{ext_name}.ini -%global upstream_ver 4.0.0 +%global ini_name 50-%{pecl_name}.ini +%global upstream_ver 4.0.2 #global upstream_pre rc.3 Name: %{?sub_prefix}php-phalcon4 @@ -37,11 +37,12 @@ Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_ Summary: Phalcon Framework License: MIT -URL: https://github.com/%{gh_owner}/%{gh_project} -Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{upstream_ver}%{?upstream_pre:-%{upstream_pre}}-%{gh_short}.tar.gz +URL: https://pecl.php.net/package/phalcon +Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel > 7.2 +BuildRequires: %{?scl_prefix}php-pear BuildRequires: %{?scl_prefix}php-hash BuildRequires: %{?scl_prefix}php-json BuildRequires: %{?scl_prefix}php-pdo @@ -86,6 +87,11 @@ Conflicts: %{?scl_prefix}php-phalcon < 4 Conflicts: %{?scl_prefix}php-phalcon2 < 4 Conflicts: %{?scl_prefix}php-phalcon3 < 4 %endif +# PECL +Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} +Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} # Don't provides php-composer(phalcon/cphalcon), not registered on packagist @@ -106,19 +112,28 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep -%setup -q -n %{gh_project}-%{gh_commit} +%setup -qc +mv %{pecl_name}-%{version}%{?upstream_pre} NTS + +cd NTS # Sanity check, really often broken -extver=$(sed -n '/#define PHP_PHALCON_VERSION/{s/.* "//;s/".*$//;p}' ext/php_phalcon.h) +extver=$(sed -n '/#define PHP_PHALCON_VERSION/{s/.* "//;s/".*$//;p}' php_phalcon.h) if test "x${extver}" != "x%{upstream_ver}%{?upstream_pre:-%{upstream_pre}}"; then : Error: Upstream extension version is ${extver}, expecting %{upstream_ver}%{?upstream_pre:-%{upstream_pre}}. exit 1 fi +cd .. + +%if %{with_zts} +# duplicate for ZTS build +cp -pr NTS ZTS +%endif # Create configuration file cat << 'EOF' | tee %{ini_name} ; Enable '%{summary}' extension module -extension=%{ext_name}.so +extension=%{pecl_name}.so ; Configuration ;phalcon.db.escape_identifiers = On @@ -142,7 +157,7 @@ extension=%{ext_name}.so EOF : Check Zephir version -grep PHP_PHALCON_ZEPVERSION ext/php_phalcon.h +grep PHP_PHALCON_ZEPVERSION NTS/php_phalcon.h %build @@ -155,23 +170,8 @@ peclconf() { --with-php-config=$1 } -: Generate the SAFE sources - optimization seems no more needed - -%if 0%{?zephir_ver:1} -%{_bindir}/zephir clean -%{_bindir}/zephir fullclean -%{_bindir}/zephir generate -%endif -%{__php} build/gen-build.php -mv build/php7/safe build/NTS - -%if %{with_zts} -: Duplicate source tree for NTS / ZTS build -cp -r build/NTS build/ZTS -%endif - : Build NTS extension -cd build/NTS +cd NTS %{_bindir}/phpize peclconf %{_bindir}/php-config make %{?_smp_mflags} @@ -188,16 +188,24 @@ make %{?_smp_mflags} %install %{?dtsenable} -make -C build/NTS install INSTALL_ROOT=%{buildroot} +# Install XML package description +install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml -# install config file +# Install the NTS stuff +make -C NTS install INSTALL_ROOT=%{buildroot} install -Dpm644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} %if %{with_zts} -make -C build/ZTS install INSTALL_ROOT=%{buildroot} +# Install the ZTS stuff +make -C ZTS install INSTALL_ROOT=%{buildroot} install -Dpm644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif +# 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 +done + %check # Shared needed extensions @@ -211,15 +219,15 @@ done : Minimal load test for NTS extension %{__php} --no-php-ini \ $modules \ - --define extension=%{buildroot}%{php_extdir}/%{ext_name}.so \ - --modules | grep -i %{ext_name} + --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ + --modules | grep -i %{pecl_name} %if %{with_tests} : Upstream test suite NTS extension cd build/NTS SKIP_ONLINE_TESTS=1 \ TEST_PHP_EXECUTABLE=%{__php} \ -TEST_PHP_ARGS="-n $modules -d extension=$PWD/modules/%{ext_name}.so" \ +TEST_PHP_ARGS="-n $modules -d extension=$PWD/modules/%{pecl_name}.so" \ NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ %{__php} -n run-tests.php --show-diff @@ -229,28 +237,52 @@ REPORT_EXIT_STATUS=1 \ : Minimal load test for ZTS extension %{__ztsphp} --no-php-ini \ $modules \ - --define extension=%{buildroot}%{php_ztsextdir}/%{ext_name}.so \ - --modules | grep -i %{ext_name} + --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ + --modules | grep -i %{pecl_name} +%endif + + +%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 %files -%{!?_licensedir:%global license %%doc} -%license LICENSE*.txt -%doc *.md +%{?_licensedir:%license NTS/LICENSE.txt} +%doc %{pecl_docdir}/%{pecl_name} +%{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} -%{php_extdir}/%{ext_name}.so -%exclude %{php_incldir}/ext/%{ext_name}/php_phalcon.h +%{php_extdir}/%{pecl_name}.so +%exclude %{php_incldir}/ext/%{pecl_name}/php_phalcon.h %if %{with_zts} %config(noreplace) %{php_ztsinidir}/%{ini_name} -%{php_ztsextdir}/%{ext_name}.so -%exclude %{php_ztsincldir}/ext/%{ext_name}/php_phalcon.h +%{php_ztsextdir}/%{pecl_name}.so +%exclude %{php_ztsincldir}/ext/%{pecl_name}/php_phalcon.h %endif %changelog +* Mon Jan 13 2020 Remi Collet - 4.0.2-1 +- update to 4.0.2 +- sources from pecl + * Sun Dec 22 2019 Remi Collet - 4.0.0-1 - update to 4.0.0 -- cgit