1 |
commit: aa4bb8fde3d0d8393bebb225c75474e88a4636e9 |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Aug 4 14:03:18 2017 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 4 14:06:24 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa4bb8fd |
7 |
|
8 |
dev-php/PEAR-Translation2: Add patch for basic PHP 5 and 7 support |
9 |
|
10 |
Package-Manager: Portage-2.3.6, Repoman-2.3.3 |
11 |
|
12 |
.../PEAR-Translation2-2.0.4-r1.ebuild | 2 +- |
13 |
dev-php/PEAR-Translation2/files/modern-php.patch | 328 +++++++++++++++++++++ |
14 |
2 files changed, 329 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/dev-php/PEAR-Translation2/PEAR-Translation2-2.0.4-r1.ebuild b/dev-php/PEAR-Translation2/PEAR-Translation2-2.0.4-r1.ebuild |
17 |
index 45e54b9d649..95eff3ebbe5 100644 |
18 |
--- a/dev-php/PEAR-Translation2/PEAR-Translation2-2.0.4-r1.ebuild |
19 |
+++ b/dev-php/PEAR-Translation2/PEAR-Translation2-2.0.4-r1.ebuild |
20 |
@@ -19,7 +19,7 @@ RDEPEND="dev-lang/php:*[nls] |
21 |
dev-php/PEAR-File_Gettext |
22 |
>=dev-php/PEAR-I18Nv2-0.9.1 ) |
23 |
xml? ( >=dev-php/PEAR-XML_Serializer-0.13.0 )" |
24 |
- |
25 |
+PATCHES=( "${FILESDIR}/modern-php.patch" ) |
26 |
src_install() { |
27 |
local DOCS=( docs/gettext_readme.txt ) |
28 |
php-pear-r2_src_install |
29 |
|
30 |
diff --git a/dev-php/PEAR-Translation2/files/modern-php.patch b/dev-php/PEAR-Translation2/files/modern-php.patch |
31 |
new file mode 100644 |
32 |
index 00000000000..c9b8ccaacf7 |
33 |
--- /dev/null |
34 |
+++ b/dev-php/PEAR-Translation2/files/modern-php.patch |
35 |
@@ -0,0 +1,328 @@ |
36 |
+diff -uarN a/docs/examples/gettext_admin.php b/docs/examples/gettext_admin.php |
37 |
+--- a/docs/examples/gettext_admin.php 2010-12-05 17:56:30.000000000 -0500 |
38 |
++++ b/docs/examples/gettext_admin.php 2017-08-04 09:22:31.277320045 -0400 |
39 |
+@@ -17,7 +17,7 @@ |
40 |
+ $days = array(); |
41 |
+ $months= array(); |
42 |
+ |
43 |
+-$lc = &new I18Nv2_Locale; |
44 |
++$lc = new I18Nv2_Locale; |
45 |
+ |
46 |
+ foreach ($langs as $lang) { |
47 |
+ $lc->setLocale($lang); |
48 |
+diff -uarN a/docs/examples/gettext_prepare.php b/docs/examples/gettext_prepare.php |
49 |
+--- a/docs/examples/gettext_prepare.php 2010-12-05 17:56:31.000000000 -0500 |
50 |
++++ b/docs/examples/gettext_prepare.php 2017-08-04 09:22:31.278320085 -0400 |
51 |
+@@ -4,7 +4,7 @@ |
52 |
+ require_once 'File/Gettext.php'; |
53 |
+ require_once 'I18Nv2/Locale.php'; |
54 |
+ |
55 |
+-$l = &new I18Nv2_Locale('en'); |
56 |
++$l = new I18Nv2_Locale('en'); |
57 |
+ $g = &File_Gettext::factory('MO'); |
58 |
+ |
59 |
+ $g->meta = array('Content-Type' => 'text/plain; charset=iso-8859-1'); |
60 |
+diff -uarN a/scripts/t2xmlchk.php b/scripts/t2xmlchk.php |
61 |
+--- a/scripts/t2xmlchk.php 2010-12-05 17:56:31.000000000 -0500 |
62 |
++++ b/scripts/t2xmlchk.php 2017-08-04 09:22:31.277320045 -0400 |
63 |
+@@ -39,7 +39,7 @@ |
64 |
+ exit("\n"); |
65 |
+ } |
66 |
+ |
67 |
+-$validator =& new XML_DTD_XmlValidator(); |
68 |
++$validator =new XML_DTD_XmlValidator(); |
69 |
+ |
70 |
+ $dtd_file = tempnam('/tmp', 't2'); |
71 |
+ $fp = fopen($dtd_file, 'w'); |
72 |
+@@ -63,7 +63,7 @@ |
73 |
+ 'string' => 'key', |
74 |
+ 'tr' => 'lang' |
75 |
+ ); |
76 |
+-$unserializer = &new XML_Unserializer(array('keyAttribute' => $keyAttr)); |
77 |
++$unserializer = new XML_Unserializer(array('keyAttribute' => $keyAttr)); |
78 |
+ if (PEAR::isError($status = $unserializer->unserialize($xml_file, true))) { |
79 |
+ exit("FAILED : " . $status->getMessage() . "\n"); |
80 |
+ } else { |
81 |
+diff -uarN a/tests/admin_containers_tests.php b/tests/admin_containers_tests.php |
82 |
+--- a/tests/admin_containers_tests.php 2010-12-05 17:56:31.000000000 -0500 |
83 |
++++ b/tests/admin_containers_tests.php 2017-08-04 09:22:31.272319845 -0400 |
84 |
+@@ -19,7 +19,7 @@ |
85 |
+ |
86 |
+ if (!defined('TEST_RUNNING')) { |
87 |
+ define('TEST_RUNNING', true); |
88 |
+- $test = &new AdminContainersTests(); |
89 |
++ $test = new AdminContainersTests(); |
90 |
+ $test->run(new HtmlReporter()); |
91 |
+ } |
92 |
+ ?> |
93 |
+\ No newline at end of file |
94 |
+diff -uarN a/tests/admin_db_test.php b/tests/admin_db_test.php |
95 |
+--- a/tests/admin_db_test.php 2010-12-05 17:56:31.000000000 -0500 |
96 |
++++ b/tests/admin_db_test.php 2017-08-04 09:22:31.274319925 -0400 |
97 |
+@@ -5,7 +5,7 @@ |
98 |
+ |
99 |
+ if (!defined('TEST_RUNNING')) { |
100 |
+ define('TEST_RUNNING', true); |
101 |
+- $test = &new TestOfAdminContainerDB(); |
102 |
++ $test = new TestOfAdminContainerDB(); |
103 |
+ $test->run(new HtmlReporter()); |
104 |
+ } |
105 |
+ ?> |
106 |
+\ No newline at end of file |
107 |
+diff -uarN a/tests/admin_gettext_mo_test.php b/tests/admin_gettext_mo_test.php |
108 |
+--- a/tests/admin_gettext_mo_test.php 2010-12-05 17:56:31.000000000 -0500 |
109 |
++++ b/tests/admin_gettext_mo_test.php 2017-08-04 09:22:31.274319925 -0400 |
110 |
+@@ -23,7 +23,7 @@ |
111 |
+ |
112 |
+ if (!defined('TEST_RUNNING')) { |
113 |
+ define('TEST_RUNNING', true); |
114 |
+- $test = &new TestOfAdminContainerGettextMO(); |
115 |
++ $test = new TestOfAdminContainerGettextMO(); |
116 |
+ $test->run(new HtmlReporter()); |
117 |
+ } |
118 |
+ ?> |
119 |
+\ No newline at end of file |
120 |
+diff -uarN a/tests/admin_gettext_po_test.php b/tests/admin_gettext_po_test.php |
121 |
+--- a/tests/admin_gettext_po_test.php 2010-12-05 17:56:31.000000000 -0500 |
122 |
++++ b/tests/admin_gettext_po_test.php 2017-08-04 09:22:31.273319885 -0400 |
123 |
+@@ -5,7 +5,7 @@ |
124 |
+ |
125 |
+ if (!defined('TEST_RUNNING')) { |
126 |
+ define('TEST_RUNNING', true); |
127 |
+- $test = &new TestOfAdminContainerGettextPO(); |
128 |
++ $test = new TestOfAdminContainerGettextPO(); |
129 |
+ $test->run(new HtmlReporter()); |
130 |
+ } |
131 |
+ ?> |
132 |
+\ No newline at end of file |
133 |
+diff -uarN a/tests/admin_mdb2_test.php b/tests/admin_mdb2_test.php |
134 |
+--- a/tests/admin_mdb2_test.php 2010-12-05 17:56:31.000000000 -0500 |
135 |
++++ b/tests/admin_mdb2_test.php 2017-08-04 09:22:31.274319925 -0400 |
136 |
+@@ -15,7 +15,7 @@ |
137 |
+ |
138 |
+ if (!defined('TEST_RUNNING')) { |
139 |
+ define('TEST_RUNNING', true); |
140 |
+- $test = &new TestOfAdminContainerMDB2(); |
141 |
++ $test = new TestOfAdminContainerMDB2(); |
142 |
+ $test->run(new HtmlReporter()); |
143 |
+ } |
144 |
+ ?> |
145 |
+\ No newline at end of file |
146 |
+diff -uarN a/tests/admin_mdb_test.php b/tests/admin_mdb_test.php |
147 |
+--- a/tests/admin_mdb_test.php 2010-12-05 17:56:31.000000000 -0500 |
148 |
++++ b/tests/admin_mdb_test.php 2017-08-04 09:22:31.273319885 -0400 |
149 |
+@@ -15,7 +15,7 @@ |
150 |
+ |
151 |
+ if (!defined('TEST_RUNNING')) { |
152 |
+ define('TEST_RUNNING', true); |
153 |
+- $test = &new TestOfAdminContainerMDB(); |
154 |
++ $test = new TestOfAdminContainerMDB(); |
155 |
+ $test->run(new HtmlReporter()); |
156 |
+ } |
157 |
+ ?> |
158 |
+\ No newline at end of file |
159 |
+diff -uarN a/tests/all_tests.php b/tests/all_tests.php |
160 |
+--- a/tests/all_tests.php 2010-12-05 17:56:31.000000000 -0500 |
161 |
++++ b/tests/all_tests.php 2017-08-04 09:22:31.275319965 -0400 |
162 |
+@@ -18,6 +18,6 @@ |
163 |
+ } |
164 |
+ } |
165 |
+ |
166 |
+-$test = &new AllTests(); |
167 |
++$test = new AllTests(); |
168 |
+ $test->run(new HtmlReporter()); |
169 |
+ ?> |
170 |
+\ No newline at end of file |
171 |
+diff -uarN a/tests/containers_tests.php b/tests/containers_tests.php |
172 |
+--- a/tests/containers_tests.php 2010-12-05 17:56:31.000000000 -0500 |
173 |
++++ b/tests/containers_tests.php 2017-08-04 09:22:31.274319925 -0400 |
174 |
+@@ -18,7 +18,7 @@ |
175 |
+ |
176 |
+ if (!defined('TEST_RUNNING')) { |
177 |
+ define('TEST_RUNNING', true); |
178 |
+- $test = &new ContainersTests(); |
179 |
++ $test = new ContainersTests(); |
180 |
+ $test->run(new HtmlReporter()); |
181 |
+ } |
182 |
+ ?> |
183 |
+\ No newline at end of file |
184 |
+diff -uarN a/tests/db_test.php b/tests/db_test.php |
185 |
+--- a/tests/db_test.php 2010-12-05 17:56:31.000000000 -0500 |
186 |
++++ b/tests/db_test.php 2017-08-04 09:22:31.274319925 -0400 |
187 |
+@@ -5,7 +5,7 @@ |
188 |
+ |
189 |
+ if (!defined('TEST_RUNNING')) { |
190 |
+ define('TEST_RUNNING', true); |
191 |
+- $test = &new TestOfContainerDB(); |
192 |
++ $test = new TestOfContainerDB(); |
193 |
+ $test->run(new HtmlReporter()); |
194 |
+ } |
195 |
+ ?> |
196 |
+\ No newline at end of file |
197 |
+diff -uarN a/tests/gettext_mo_test.php b/tests/gettext_mo_test.php |
198 |
+--- a/tests/gettext_mo_test.php 2010-12-05 17:56:31.000000000 -0500 |
199 |
++++ b/tests/gettext_mo_test.php 2017-08-04 09:22:31.273319885 -0400 |
200 |
+@@ -82,7 +82,7 @@ |
201 |
+ |
202 |
+ if (!defined('TEST_RUNNING')) { |
203 |
+ define('TEST_RUNNING', true); |
204 |
+- $test = &new TestOfGettextMO(); |
205 |
++ $test = new TestOfGettextMO(); |
206 |
+ $test->run(new HtmlReporter()); |
207 |
+ } |
208 |
+ ?> |
209 |
+\ No newline at end of file |
210 |
+diff -uarN a/tests/gettext_po_test.php b/tests/gettext_po_test.php |
211 |
+--- a/tests/gettext_po_test.php 2010-12-05 17:56:31.000000000 -0500 |
212 |
++++ b/tests/gettext_po_test.php 2017-08-04 09:22:31.275319965 -0400 |
213 |
+@@ -80,7 +80,7 @@ |
214 |
+ |
215 |
+ if (!defined('TEST_RUNNING')) { |
216 |
+ define('TEST_RUNNING', true); |
217 |
+- $test = &new TestOfGettextPO(); |
218 |
++ $test = new TestOfGettextPO(); |
219 |
+ $test->run(new HtmlReporter()); |
220 |
+ } |
221 |
+ ?> |
222 |
+\ No newline at end of file |
223 |
+diff -uarN a/tests/gettext_prepare.php b/tests/gettext_prepare.php |
224 |
+--- a/tests/gettext_prepare.php 2010-12-05 17:56:31.000000000 -0500 |
225 |
++++ b/tests/gettext_prepare.php 2017-08-04 09:22:31.275319965 -0400 |
226 |
+@@ -4,7 +4,7 @@ |
227 |
+ require_once 'File/Gettext.php'; |
228 |
+ require_once 'I18Nv2/Locale.php'; |
229 |
+ |
230 |
+-$l = &new I18Nv2_Locale('en'); |
231 |
++$l = new I18Nv2_Locale('en'); |
232 |
+ |
233 |
+ foreach (array('mo', 'po') as $fileType) { |
234 |
+ |
235 |
+diff -uarN a/tests/mdb2_test.php b/tests/mdb2_test.php |
236 |
+--- a/tests/mdb2_test.php 2010-12-05 17:56:31.000000000 -0500 |
237 |
++++ b/tests/mdb2_test.php 2017-08-04 09:22:31.273319885 -0400 |
238 |
+@@ -15,7 +15,7 @@ |
239 |
+ |
240 |
+ if (!defined('TEST_RUNNING')) { |
241 |
+ define('TEST_RUNNING', true); |
242 |
+- $test = &new TestOfContainerMDB2(); |
243 |
++ $test = new TestOfContainerMDB2(); |
244 |
+ $test->run(new HtmlReporter()); |
245 |
+ } |
246 |
+ ?> |
247 |
+\ No newline at end of file |
248 |
+diff -uarN a/tests/mdb_test.php b/tests/mdb_test.php |
249 |
+--- a/tests/mdb_test.php 2010-12-05 17:56:31.000000000 -0500 |
250 |
++++ b/tests/mdb_test.php 2017-08-04 09:22:31.273319885 -0400 |
251 |
+@@ -15,7 +15,7 @@ |
252 |
+ |
253 |
+ if (!defined('TEST_RUNNING')) { |
254 |
+ define('TEST_RUNNING', true); |
255 |
+- $test = &new TestOfContainerMDB(); |
256 |
++ $test = new TestOfContainerMDB(); |
257 |
+ $test->run(new HtmlReporter()); |
258 |
+ } |
259 |
+ ?> |
260 |
+\ No newline at end of file |
261 |
+diff -uarN a/Translation2/Container/xml.php b/Translation2/Container/xml.php |
262 |
+--- a/Translation2/Container/xml.php 2010-12-05 17:56:31.000000000 -0500 |
263 |
++++ b/Translation2/Container/xml.php 2017-08-04 09:22:31.277320045 -0400 |
264 |
+@@ -160,7 +160,7 @@ |
265 |
+ return new PEAR_Error ("Can\'t read from the XML source: {$this->_filename}"); |
266 |
+ } |
267 |
+ @flock($fp, LOCK_SH); |
268 |
+- $unserializer = &new XML_Unserializer (array('keyAttribute' => $keyAttr)); |
269 |
++ $unserializer = new XML_Unserializer (array('keyAttribute' => $keyAttr)); |
270 |
+ if (PEAR::isError($status = $unserializer->unserialize($this->_filename, true))) { |
271 |
+ fclose($fp); |
272 |
+ return $status; |
273 |
+diff -uarN a/Translation2/Container.php b/Translation2/Container.php |
274 |
+--- a/Translation2/Container.php 2010-12-05 17:56:31.000000000 -0500 |
275 |
++++ b/Translation2/Container.php 2017-08-04 09:32:40.021575421 -0400 |
276 |
+@@ -80,6 +80,9 @@ |
277 |
+ * |
278 |
+ * @access public |
279 |
+ */ |
280 |
++ function __construct() |
281 |
++ { |
282 |
++ } |
283 |
+ function Translation2_Container() |
284 |
+ { |
285 |
+ } |
286 |
+@@ -357,4 +360,4 @@ |
287 |
+ |
288 |
+ // }}} |
289 |
+ } |
290 |
+-?> |
291 |
+\ No newline at end of file |
292 |
++?> |
293 |
+diff -uarN a/Translation2/Decorator.php b/Translation2/Decorator.php |
294 |
+--- a/Translation2/Decorator.php 2010-12-05 17:56:31.000000000 -0500 |
295 |
++++ b/Translation2/Decorator.php 2017-08-04 09:33:23.341206788 -0400 |
296 |
+@@ -35,7 +35,7 @@ |
297 |
+ * @version CVS: $Id: Decorator.php 305985 2010-12-05 22:55:33Z clockwerx $ |
298 |
+ * @link http://pear.php.net/package/Translation2 |
299 |
+ */ |
300 |
+- |
301 |
++require_once 'Translation2.php'; |
302 |
+ /** |
303 |
+ * Translation2_Decorator. Base Decorator class for Translation2 |
304 |
+ * |
305 |
+@@ -88,7 +88,7 @@ |
306 |
+ * |
307 |
+ * @param object &$translation2 Translation2 object to decorate |
308 |
+ */ |
309 |
+- function Translation2_Decorator(& $translation2) |
310 |
++ function __construct(& $translation2) |
311 |
+ { |
312 |
+ $this->translation2 = & $translation2; |
313 |
+ //used for debug only |
314 |
+@@ -96,7 +96,10 @@ |
315 |
+ $this->currentPageID = & $translation2->currentPageID; |
316 |
+ $this->lang = & $translation2->lang; |
317 |
+ } |
318 |
+- |
319 |
++ function Translation2_Decorator(& $translation2) |
320 |
++ { |
321 |
++ self::__construct($translation2); |
322 |
++ } |
323 |
+ // }}} |
324 |
+ // {{{ setOptions() |
325 |
+ |
326 |
+@@ -413,4 +416,4 @@ |
327 |
+ |
328 |
+ // }}} |
329 |
+ } |
330 |
+-?> |
331 |
+\ No newline at end of file |
332 |
++?> |
333 |
+diff -uarN a/Translation2.php b/Translation2.php |
334 |
+--- a/Translation2.php 2010-12-05 17:56:31.000000000 -0500 |
335 |
++++ b/Translation2.php 2017-08-04 09:31:14.843367708 -0400 |
336 |
+@@ -122,7 +122,7 @@ |
337 |
+ /** |
338 |
+ * Constructor |
339 |
+ */ |
340 |
+- function Translation2() |
341 |
++ function __construct() |
342 |
+ { |
343 |
+ if (func_num_args()) { |
344 |
+ $msg = '<b>Translation2 error:</b>' |
345 |
+@@ -130,7 +130,10 @@ |
346 |
+ trigger_error($msg, E_USER_ERROR); |
347 |
+ } |
348 |
+ } |
349 |
+- |
350 |
++ function Translation2() |
351 |
++ { |
352 |
++ self::__construct(); |
353 |
++ } |
354 |
+ // }}} |
355 |
+ // {{{ factory() |
356 |
+ |
357 |
+@@ -595,4 +598,4 @@ |
358 |
+ |
359 |
+ // }}} |
360 |
+ } |
361 |
+-?> |
362 |
+\ No newline at end of file |
363 |
++?> |