From 1627d312e5c119fbba0cd17bcde3f78adf1d1cb0 Mon Sep 17 00:00:00 2001 From: Brian Evans Date: Mon, 10 Jan 2022 12:56:30 -0500 Subject: dev-php/PEAR-XML_Parser: Revbump on 1.3.8 Fix compatibility with PHP 8 Fix tests to modern standards This will break scripts that use the startHandler but is necessary to work with PHP 8. Packages in this repository will be updated. Bug: https://bugs.gentoo.org/830811 Closes: https://bugs.gentoo.org/774795 Signed-off-by: Brian Evans --- .../PEAR-XML_Parser-1.3.8-r1.ebuild | 29 ++++++++++ .../files/XML_Parser-1.3.8-php8.patch | 66 ++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 dev-php/PEAR-XML_Parser/PEAR-XML_Parser-1.3.8-r1.ebuild create mode 100644 dev-php/PEAR-XML_Parser/files/XML_Parser-1.3.8-php8.patch diff --git a/dev-php/PEAR-XML_Parser/PEAR-XML_Parser-1.3.8-r1.ebuild b/dev-php/PEAR-XML_Parser/PEAR-XML_Parser-1.3.8-r1.ebuild new file mode 100644 index 000000000000..461ae05c1155 --- /dev/null +++ b/dev-php/PEAR-XML_Parser/PEAR-XML_Parser-1.3.8-r1.ebuild @@ -0,0 +1,29 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit php-pear-r2 + +DESCRIPTION="XML parsing class based on PHP's SAX parser" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86" +IUSE="" +# This is to match patch compatibility +RDEPEND="! $val) { + $enc = htmlentities($val); + print " $key=\"$enc\""; + } +diff -aruN /tests/002.phpt /tests/002.phpt +--- a/tests/002.phpt 2019-04-10 14:18:52.000000000 -0400 ++++ b/tests/002.phpt 2022-01-10 11:46:58.281433169 -0500 +@@ -13,10 +13,10 @@ + require_once "XML/Parser.php"; + + class __TestParser2 extends XML_Parser { +- function startHandler($xp, $element, &$attribs) { ++ function startHandler($xp, $element, $attribs) { + print "<$element"; + reset($attribs); +- while (list($key, $val) = each($attribs)) { ++ foreach ($attribs as $key => $val) { + $enc = htmlentities($val); + print " $key=\"$enc\""; + } +diff -aruN /tests/003.phpt /tests/003.phpt +--- a/tests/003.phpt 2019-04-10 14:18:52.000000000 -0400 ++++ b/tests/003.phpt 2022-01-10 11:41:03.402573127 -0500 +@@ -13,10 +13,10 @@ + require_once "XML/Parser.php"; + + class __TestParser3 extends XML_Parser { +- function startHandler($xp, $element, &$attribs) { ++ function startHandler($xp, $element, $attribs) { + print "<$element"; + reset($attribs); +- while (list($key, $val) = each($attribs)) { ++ foreach ($attribs as $key => $val) { + $enc = htmlentities($val); + print " $key=\"$enc\""; + } -- cgit v1.2.3-18-g5258