[packages/php-pear-Numbers_Words] Rel 3
arekm
arekm at pld-linux.org
Mon May 4 12:57:53 CEST 2026
commit 395663cded7c6202e5eb600428fcdc7cae485ced
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Mon May 4 12:57:41 2026 +0200
Rel 3
php-pear-Numbers_Words-php8.patch | 36 ++++++++++++++++++++++++++++++++++++
php-pear-Numbers_Words.spec | 10 +++++++---
2 files changed, 43 insertions(+), 3 deletions(-)
---
diff --git a/php-pear-Numbers_Words.spec b/php-pear-Numbers_Words.spec
index 052cbb9..021a7df 100644
--- a/php-pear-Numbers_Words.spec
+++ b/php-pear-Numbers_Words.spec
@@ -4,12 +4,13 @@ Summary: %{pearname} - provides methods for spelling numerals in words
Summary(pl.UTF-8): %{pearname} - metody do słownego przedstawiania liczb
Name: php-pear-%{pearname}
Version: 0.18.2
-Release: 2
+Release: 3
License: PHP 2.02
Group: Development/Languages/PHP
-Source0: http://pear.php.net/get/%{pearname}-%{version}.tgz
+Source0: https://pear.php.net/get/%{pearname}-%{version}.tgz
# Source0-md5: b0bfd299b79e8a40683cb28369a6e7ef
-URL: http://pear.php.net/package/Numbers_Words/
+Patch0: %{name}-php8.patch
+URL: https://pear.php.net/package/Numbers_Words/
BuildRequires: php-pear-PEAR >= 1:1.4.0-0.b1
BuildRequires: rpm-php-pearprov >= 4.4.2-11
BuildRequires: rpmbuild(macros) >= 1.580
@@ -39,6 +40,9 @@ Ta klasa ma w PEAR status: %{status}.
%prep
%pear_package_setup
+cd ./%{php_pear_dir}
+%patch -P0 -p1
+cd -
%install
rm -rf $RPM_BUILD_ROOT
diff --git a/php-pear-Numbers_Words-php8.patch b/php-pear-Numbers_Words-php8.patch
new file mode 100644
index 0000000..a635604
--- /dev/null
+++ b/php-pear-Numbers_Words-php8.patch
@@ -0,0 +1,36 @@
+Replace deprecated curly-brace string offset (removed in PHP 8.0) and
+each() function (removed in PHP 8.0).
+
+--- Numbers_Words-0.18.2.org/Numbers/Words/Locale/ru.php 2020-09-01 00:00:00.000000000 +0200
++++ Numbers_Words-0.18.2/Numbers/Words/Locale/ru.php 2026-05-04 00:00:00.000000000 +0200
+@@ -570,7 +570,7 @@
+ } else {
+ $num = str_pad($num, 3, '0', STR_PAD_LEFT);
+
+- $hundreds = (int)$num{0};
++ $hundreds = (int)$num[0];
+ if ($hundreds) {
+ $ret = $this->_hundreds[$hundreds];
+ if (substr($num, 1) != '00') {
+@@ -580,8 +580,8 @@
+ $case = 3;
+ }
+
+- $tens = (int)$num{1};
+- $ones = (int)$num{2};
++ $tens = (int)$num[1];
++ $ones = (int)$num[2];
+ if ($tens || $ones) {
+ if ($tens == 1 && $ones == 0) {
+ $ret .= 'десять';
+--- Numbers_Words-0.18.2.org/Numbers/Words/Locale/pt/BR.php 2020-09-01 00:00:00.000000000 +0200
++++ Numbers_Words-0.18.2/Numbers/Words/Locale/pt/BR.php 2026-05-04 00:00:00.000000000 +0200
+@@ -384,7 +384,7 @@
+ */
+ reset($chunks);
+ do {
+- list(,$chunk) = each($chunks);
++ $chunk = current($chunks); next($chunks);
+ } while ($chunk === '000');
+
+ if (($chunk < 100) || !($chunk % 100)) {
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-pear-Numbers_Words.git/commitdiff/395663cded7c6202e5eb600428fcdc7cae485ced
More information about the pld-cvs-commit
mailing list