diff options
author | Remi Collet <remi@remirepo.net> | 2017-12-19 10:33:06 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2017-12-19 10:33:06 +0100 |
commit | 0ee897cccc3883aec17805dfc38078cc86898923 (patch) | |
tree | c777da6ae8f6c92a8667b89a38add93c9e34e08c | |
parent | f1ed2dd8a6f98265f2559f40295484b656dcd4fe (diff) |
add upstream patch for PHP 7.2
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | 6018b26b20a78654c113da04ad9e816b1ac0c5e9.patch | 24 | ||||
-rw-r--r-- | php-horde-Horde-Stream-Wrapper.spec | 26 |
3 files changed, 49 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc9aa8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/6018b26b20a78654c113da04ad9e816b1ac0c5e9.patch b/6018b26b20a78654c113da04ad9e816b1ac0c5e9.patch new file mode 100644 index 0000000..5a928e1 --- /dev/null +++ b/6018b26b20a78654c113da04ad9e816b1ac0c5e9.patch @@ -0,0 +1,24 @@ +From 6018b26b20a78654c113da04ad9e816b1ac0c5e9 Mon Sep 17 00:00:00 2001 +From: Jan Schneider <jan@horde.org> +Date: Mon, 13 Feb 2017 14:57:35 +0100 +Subject: [PATCH] Don't use each(). + +For modern PHP versions there is no improved performance or memory usage compared to foreach() anymore. Beside that it's deprecated in PHP 7.2. +--- + lib/Horde/Stream/Wrapper/Combine.php | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/lib/Horde/Stream/Wrapper/Combine.php b/lib/Horde/Stream/Wrapper/Combine.php +index 309d705..167f368 100644 +--- a/lib/Horde/Stream/Wrapper/Combine.php ++++ b/lib/Horde/Stream/Wrapper/Combine.php +@@ -125,8 +125,7 @@ public function stream_open($path, $mode, $options, &$opened_path) + throw new Exception('Use ' . __CLASS__ . '::getStream() to initialize the stream.'); + } + +- reset($data); +- while (list(,$val) = each($data)) { ++ foreach ($data as $val) { + if (is_string($val)) { + $fp = fopen('php://temp', 'r+'); + fwrite($fp, $val); diff --git a/php-horde-Horde-Stream-Wrapper.spec b/php-horde-Horde-Stream-Wrapper.spec index ee82062..b1d8c77 100644 --- a/php-horde-Horde-Stream-Wrapper.spec +++ b/php-horde-Horde-Stream-Wrapper.spec @@ -19,7 +19,7 @@ Name: php-horde-Horde-Stream-Wrapper Version: 2.1.3 -Release: 1%{?dist} +Release: 4%{?dist} Summary: Horde Stream wrappers Group: Development/Libraries @@ -27,7 +27,8 @@ License: BSD URL: http://pear.horde.org Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root +Patch0: https://github.com/horde/Stream_Wrapper/commit/6018b26b20a78654c113da04ad9e816b1ac0c5e9.patch + BuildArch: noarch BuildRequires: php(language) >= 5.3.0 BuildRequires: php-pear(PEAR) >= 1.7.0 @@ -55,7 +56,9 @@ This package provides various stream wrappers. %setup -q -c cd %{pear_name}-%{version} -mv ../package.xml %{name}.xml +%patch0 -p1 -b .upstream + +sed -e 's/md5sum="[^"]*"//' ../package.xml >%{name}.xml %build @@ -78,11 +81,14 @@ install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir} %check %if %{with_tests} cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g) -%{_bindir}/phpunit . -if which php70; then - php70 %{_bindir}/phpunit . -fi +ret=0 +for cmd in php php56 php70 php71 php72; do + if which $cmd; then + $cmd %{_bindir}/phpunit --verbose . || ret=1 + fi +done +exit $ret %else : Tests disabled, use --with tests to enable them %endif @@ -100,14 +106,16 @@ fi %files -%defattr(-,root,root,-) %{pear_xmldir}/%{name}.xml %{pear_phpdir}/Horde %doc %{pear_docdir}/%{pear_name} -%{pear_testdir}/%{pear_name} +%doc %{pear_testdir}/%{pear_name} %changelog +* Tue Dec 19 2017 Remi Collet <remi@remirepo.net> - 2.1.3-4 +- add upstream patch for PHP 7.2 + * Tue Feb 02 2016 Remi Collet <remi@fedoraproject.org> - 2.1.3-1 - Update to 2.1.3 - PHP 7 compatible version |