[packages/php-pear-HTML_QuickForm] Rel 3; php7 fixes
arekm
arekm at pld-linux.org
Mon Jun 8 23:13:33 CEST 2026
commit 9fae44d1d8d66baedb89e43bfa3015a2a0550168
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Mon Jun 8 23:12:16 2026 +0200
Rel 3; php7 fixes
php-pear-HTML_QuickForm-php7.patch | 134 +++++++++++++++++++++++++++++++++++++
php-pear-HTML_QuickForm.spec | 6 +-
2 files changed, 139 insertions(+), 1 deletion(-)
---
diff --git a/php-pear-HTML_QuickForm.spec b/php-pear-HTML_QuickForm.spec
index acf6aed..c240d0f 100644
--- a/php-pear-HTML_QuickForm.spec
+++ b/php-pear-HTML_QuickForm.spec
@@ -4,11 +4,12 @@ Summary: %{pearname} - methods for creating, validating, processing HTML forms
Summary(pl.UTF-8): %{pearname} - metody do tworzenia, kontroli i przetwarzania formularzy HTML
Name: php-pear-%{pearname}
Version: 3.2.16
-Release: 2
+Release: 3
License: PHP 2.02
Group: Development/Languages/PHP
Source0: http://pear.php.net/get/%{pearname}-%{version}.tgz
# Source0-md5: e5adb0bcdc131791897e651f14c6c93a
+Patch0: %{name}-php7.patch
URL: http://pear.php.net/package/HTML_QuickForm/
BuildRequires: php-pear-PEAR >= 1:1.5.4
BuildRequires: rpm-php-pearprov >= 4.4.2-11
@@ -57,6 +58,9 @@ Ta klasa ma w PEAR status: %{status}.
%prep
%pear_package_setup
+cd ./%{php_pear_dir}
+%patch -P0 -p1
+cd -
mv docs/HTML_QuickForm/docs examples
%install
diff --git a/php-pear-HTML_QuickForm-php7.patch b/php-pear-HTML_QuickForm-php7.patch
new file mode 100644
index 0000000..6d73404
--- /dev/null
+++ b/php-pear-HTML_QuickForm-php7.patch
@@ -0,0 +1,134 @@
+Drop PHP-4 reference assignment of new objects ($x =& new Foo()),
+removed in PHP 7.0 -> fatal parse error. Plain $x = new Foo() is
+equivalent since PHP 5 objects are handles.
+
+diff -ur HTML_QuickForm-3.2.16.org/HTML/QuickForm/Renderer/ObjectFlexy.php HTML_QuickForm-3.2.16/HTML/QuickForm/Renderer/ObjectFlexy.php
+--- HTML_QuickForm-3.2.16.org/HTML/QuickForm/Renderer/ObjectFlexy.php 2018-07-20 17:16:50.000000000 +0200
++++ HTML_QuickForm-3.2.16/HTML/QuickForm/Renderer/ObjectFlexy.php 2026-06-08 22:53:09.788325749 +0200
+@@ -34,9 +34,9 @@
+ *
+ * Usage:
+ * <code>
+- * $form =& new HTML_QuickForm('form', 'POST');
+- * $template =& new HTML_Template_Flexy();
+- * $renderer =& new HTML_QuickForm_Renderer_ObjectFlexy(&$template);
++ * $form = new HTML_QuickForm('form', 'POST');
++ * $template = new HTML_Template_Flexy();
++ * $renderer = new HTML_QuickForm_Renderer_ObjectFlexy(&$template);
+ * $renderer->setHtmlTemplate("html.html");
+ * $renderer->setLabelTemplate("label.html");
+ * $form->accept($renderer);
+diff -ur HTML_QuickForm-3.2.16.org/HTML/QuickForm/RuleRegistry.php HTML_QuickForm-3.2.16/HTML/QuickForm/RuleRegistry.php
+--- HTML_QuickForm-3.2.16.org/HTML/QuickForm/RuleRegistry.php 2018-07-20 17:16:50.000000000 +0200
++++ HTML_QuickForm-3.2.16/HTML/QuickForm/RuleRegistry.php 2026-06-08 22:53:09.784624999 +0200
+@@ -125,7 +125,7 @@
+ if (!empty($path)) {
+ include_once($path);
+ }
+- $this->_rules[$class] =& new $class();
++ $this->_rules[$class] = new $class();
+ }
+ $this->_rules[$class]->setName($ruleName);
+ return $this->_rules[$class];
+diff -ur HTML_QuickForm-3.2.16.org/HTML/QuickForm/date.php HTML_QuickForm-3.2.16/HTML/QuickForm/date.php
+--- HTML_QuickForm-3.2.16.org/HTML/QuickForm/date.php 2018-07-20 17:16:50.000000000 +0200
++++ HTML_QuickForm-3.2.16/HTML/QuickForm/date.php 2026-06-08 22:53:09.786878129 +0200
+@@ -423,7 +423,7 @@
+ $options = array($this->_options['emptyOptionValue'] => $this->_options['emptyOptionText']) + $options;
+ }
+ }
+- $this->_elements[] =& new HTML_QuickForm_select($sign, null, $options, $this->getAttributes());
++ $this->_elements[] = new HTML_QuickForm_select($sign, null, $options, $this->getAttributes());
+ }
+ }
+ }
+@@ -511,7 +511,7 @@
+ function toHtml()
+ {
+ include_once('HTML/QuickForm/Renderer/Default.php');
+- $renderer =& new HTML_QuickForm_Renderer_Default();
++ $renderer = new HTML_QuickForm_Renderer_Default();
+ $renderer->setElementTemplate('{element}');
+ parent::accept($renderer);
+ return $this->_wrap[0] . $renderer->toHtml() . $this->_wrap[1];
+diff -ur HTML_QuickForm-3.2.16.org/HTML/QuickForm/group.php HTML_QuickForm-3.2.16/HTML/QuickForm/group.php
+--- HTML_QuickForm-3.2.16.org/HTML/QuickForm/group.php 2018-07-20 17:16:50.000000000 +0200
++++ HTML_QuickForm-3.2.16/HTML/QuickForm/group.php 2026-06-08 22:53:09.786244554 +0200
+@@ -299,7 +299,7 @@
+ function toHtml()
+ {
+ include_once('HTML/QuickForm/Renderer/Default.php');
+- $renderer =& new HTML_QuickForm_Renderer_Default();
++ $renderer = new HTML_QuickForm_Renderer_Default();
+ $renderer->setElementTemplate('{element}');
+ $this->accept($renderer);
+ return $renderer->toHtml();
+diff -ur HTML_QuickForm-3.2.16.org/HTML/QuickForm/hierselect.php HTML_QuickForm-3.2.16/HTML/QuickForm/hierselect.php
+--- HTML_QuickForm-3.2.16.org/HTML/QuickForm/hierselect.php 2018-07-20 17:16:50.000000000 +0200
++++ HTML_QuickForm-3.2.16/HTML/QuickForm/hierselect.php 2026-06-08 22:53:09.785719430 +0200
+@@ -168,7 +168,7 @@
+ // check if all elements have been created
+ $totalNbElements = count($this->_options);
+ for ($i = $this->_nbElements; $i < $totalNbElements; $i ++) {
+- $this->_elements[] =& new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
++ $this->_elements[] = new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
+ $this->_nbElements++;
+ }
+ }
+@@ -223,7 +223,7 @@
+ // check if all elements have been created
+ $totalNbElements = 2;
+ for ($i = $this->_nbElements; $i < $totalNbElements; $i ++) {
+- $this->_elements[] =& new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
++ $this->_elements[] = new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
+ $this->_nbElements++;
+ }
+ }
+@@ -294,7 +294,7 @@
+ function _createElements()
+ {
+ for ($i = 0; $i < $this->_nbElements; $i++) {
+- $this->_elements[] =& new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
++ $this->_elements[] = new HTML_QuickForm_select($i, null, array(), $this->getAttributes());
+ }
+ } // end func _createElements
+
+@@ -472,7 +472,7 @@
+ $this->_convertArrayToJavascript($values) . ";\n";
+ }
+ include_once('HTML/QuickForm/Renderer/Default.php');
+- $renderer =& new HTML_QuickForm_Renderer_Default();
++ $renderer = new HTML_QuickForm_Renderer_Default();
+ $renderer->setElementTemplate('{element}');
+ parent::accept($renderer);
+
+diff -ur HTML_QuickForm-3.2.16.org/HTML/QuickForm.php HTML_QuickForm-3.2.16/HTML/QuickForm.php
+--- HTML_QuickForm-3.2.16.org/HTML/QuickForm.php 2018-07-20 17:16:50.000000000 +0200
++++ HTML_QuickForm-3.2.16/HTML/QuickForm.php 2026-06-08 22:53:09.782773517 +0200
+@@ -598,7 +598,7 @@
+ $className = $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'][$type][1];
+ $includeFile = $GLOBALS['HTML_QUICKFORM_ELEMENT_TYPES'][$type][0];
+ include_once($includeFile);
+- $elementObject =& new $className();
++ $elementObject = new $className();
+ for ($i = 0; $i < 5; $i++) {
+ if (!isset($args[$i])) {
+ $args[$i] = null;
+@@ -1712,7 +1712,7 @@
+ {
+ if (!isset($GLOBALS['_HTML_QuickForm_default_renderer'])) {
+ include_once('HTML/QuickForm/Renderer/Default.php');
+- $GLOBALS['_HTML_QuickForm_default_renderer'] =& new HTML_QuickForm_Renderer_Default();
++ $GLOBALS['_HTML_QuickForm_default_renderer'] = new HTML_QuickForm_Renderer_Default();
+ }
+ return $GLOBALS['_HTML_QuickForm_default_renderer'];
+ } // end func defaultRenderer
+@@ -1869,7 +1869,7 @@
+ function toArray($collectHidden = false)
+ {
+ include_once 'HTML/QuickForm/Renderer/Array.php';
+- $renderer =& new HTML_QuickForm_Renderer_Array($collectHidden);
++ $renderer = new HTML_QuickForm_Renderer_Array($collectHidden);
+ $this->accept($renderer);
+ return $renderer->toArray();
+ } // end func toArray
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-pear-HTML_QuickForm.git/commitdiff/9fae44d1d8d66baedb89e43bfa3015a2a0550168
More information about the pld-cvs-commit
mailing list