Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-php/PEAR-HTML_TreeMenu/files/, dev-php/PEAR-HTML_TreeMenu/
Date: Fri, 04 Aug 2017 19:40:12
Message-Id: 1501875502.174d3e8bf48eb3fb892b43219c778dcea2cb76bd.grknight@gentoo
1 commit: 174d3e8bf48eb3fb892b43219c778dcea2cb76bd
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 4 19:38:22 2017 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 4 19:38:22 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=174d3e8b
7
8 dev-php/PEAR-HTML_TreeMenu: Add modern-syntax patch
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.3
11
12 .../PEAR-HTML_TreeMenu-1.2.2-r1.ebuild | 2 +
13 .../PEAR-HTML_TreeMenu/files/modern-syntax.patch | 144 +++++++++++++++++++++
14 2 files changed, 146 insertions(+)
15
16 diff --git a/dev-php/PEAR-HTML_TreeMenu/PEAR-HTML_TreeMenu-1.2.2-r1.ebuild b/dev-php/PEAR-HTML_TreeMenu/PEAR-HTML_TreeMenu-1.2.2-r1.ebuild
17 index e16842bc503..e0f2801b3c5 100644
18 --- a/dev-php/PEAR-HTML_TreeMenu/PEAR-HTML_TreeMenu-1.2.2-r1.ebuild
19 +++ b/dev-php/PEAR-HTML_TreeMenu/PEAR-HTML_TreeMenu-1.2.2-r1.ebuild
20 @@ -11,6 +11,8 @@ SLOT="0"
21 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
22 IUSE=""
23
24 +PATCHES=( "${FILESDIR}/modern-syntax.patch" )
25 +
26 src_install() {
27 php-pear-r2_src_install
28 docinto html
29
30 diff --git a/dev-php/PEAR-HTML_TreeMenu/files/modern-syntax.patch b/dev-php/PEAR-HTML_TreeMenu/files/modern-syntax.patch
31 new file mode 100644
32 index 00000000000..8b9773d1235
33 --- /dev/null
34 +++ b/dev-php/PEAR-HTML_TreeMenu/files/modern-syntax.patch
35 @@ -0,0 +1,144 @@
36 +diff -aurN a/HTML/TreeMenu.php b/HTML/TreeMenu.php
37 +--- a/HTML/TreeMenu.php 2010-10-25 05:10:46.000000000 -0400
38 ++++ b/HTML/TreeMenu.php 2017-08-04 15:25:16.730007135 -0400
39 +@@ -83,6 +83,9 @@
40 + *
41 + * @access public
42 + */
43 ++ function __construct()
44 ++ {
45 ++ }
46 + function HTML_TreeMenu()
47 + {
48 + // Not much to do here :(
49 +@@ -206,7 +209,7 @@
50 + case 'heyes_array':
51 + // Need to create a HTML_TreeMenu object ?
52 + if (!isset($params['treeMenu'])) {
53 +- $treeMenu = &new HTML_TreeMenu();
54 ++ $treeMenu = new HTML_TreeMenu();
55 + $parentID = 0;
56 + } else {
57 + $treeMenu = &$params['treeMenu'];
58 +@@ -240,7 +243,7 @@
59 + default:
60 + // Need to create a HTML_TreeMenu object ?
61 + if (!isset($params['treeMenu'])) {
62 +- $treeMenu = &new HTML_TreeMenu();
63 ++ $treeMenu = new HTML_TreeMenu();
64 + } else {
65 + $treeMenu = &$params['treeMenu'];
66 + }
67 +@@ -312,7 +315,7 @@
68 + if (is_string($xml)) {
69 + // Supplied $xml is a string
70 + include_once 'XML/Tree.php';
71 +- $xmlTree = &new XML_Tree();
72 ++ $xmlTree = new XML_Tree();
73 + $xmlTree->getTreeFromString($xml);
74 + } else {
75 + // Supplied $xml is an XML_Tree object
76 +@@ -469,7 +472,7 @@
77 + *
78 + * @access public
79 + */
80 +- function HTML_TreeNode($options = array(), $events = array())
81 ++ function __construct($options = array(), $events = array())
82 + {
83 + $this->text = '';
84 + $this->link = '';
85 +@@ -488,7 +491,10 @@
86 + $this->$option = $value;
87 + }
88 + }
89 +-
90 ++ function HTML_TreeNode($options = array(), $events = array())
91 ++ {
92 ++ self::__construct($options, $events);
93 ++ }
94 + /**
95 + * Allows setting of various parameters after the initial constructor call
96 + *
97 +@@ -585,11 +591,14 @@
98 + *
99 + * @param HTML_TreeMenu &$structure The menu structure
100 + */
101 +- function HTML_TreeMenu_Presentation(&$structure)
102 ++ function __construct(&$structure)
103 + {
104 + $this->menu = &$structure;
105 + }
106 +-
107 ++ function HTML_TreeMenu_Presentation(&$structure)
108 ++ {
109 ++ self::__construct($structure);
110 ++ }
111 + /**
112 + * Prints the HTML generated by the toHTML() method.
113 + * toHTML() must therefore be defined by the derived
114 +@@ -715,7 +724,7 @@
115 + *
116 + * @access public
117 + */
118 +- function HTML_TreeMenu_DHTML(&$structure, $options = array(), $isDynamic = true)
119 ++ function __construct(&$structure, $options = array(), $isDynamic = true)
120 + {
121 + $this->HTML_TreeMenu_Presentation($structure);
122 + $this->isDynamic = $isDynamic;
123 +@@ -733,7 +742,10 @@
124 + $this->$option = $value;
125 + }
126 + }
127 +-
128 ++ function HTML_TreeMenu_DHTML(&$structure, $options = array(), $isDynamic = true)
129 ++ {
130 ++ self::__construct($structure, $options, $isDynamic);
131 ++ }
132 + /**
133 + * Returns the HTML for the menu.
134 + *
135 +@@ -920,7 +932,7 @@
136 + *
137 + * @access public
138 + */
139 +- function HTML_TreeMenu_Listbox($structure, $options = array())
140 ++ function __construct($structure, $options = array())
141 + {
142 + $this->HTML_TreeMenu_Presentation($structure);
143 +
144 +@@ -934,7 +946,10 @@
145 + $this->$option = $value;
146 + }
147 + }
148 +-
149 ++ function HTML_TreeMenu_Listbox($structure, $options = array())
150 ++ {
151 ++ self::__construct($structure, $options);
152 ++ }
153 + /**
154 + * Returns the HTML generated
155 + *
156 +diff -aurN a/tests/testBug_9750.phpt b/tests/testBug_9750.phpt
157 +--- a/tests/testBug_9750.phpt 2010-10-25 05:10:46.000000000 -0400
158 ++++ b/tests/testBug_9750.phpt 2017-08-04 15:27:53.691108758 -0400
159 +@@ -44,17 +44,17 @@
160 + 'nodeOptions' => $nodeOptions
161 + );
162 +
163 +-$menu = &HTML_TreeMenu::createFromStructure($options);
164 ++$menu = HTML_TreeMenu::createFromStructure($options);
165 +
166 + // Chose a generator. You can generate DHTML or a Listbox
167 +-$dhtml = &new HTML_TreeMenu_DHTML(
168 ++$dhtml = new HTML_TreeMenu_DHTML(
169 + $menu,
170 + array(
171 + 'images' => 'images',
172 + 'defaultClass' => 'treeMenuDefault'
173 + )
174 + );
175 +-$listbox = &new HTML_TreeMenu_ListBox(
176 ++$listbox = new HTML_TreeMenu_ListBox(
177 + $menu,
178 + array(
179 + 'images' => 'images',