diff options
author | Brian Evans <grknight@gentoo.org> | 2017-08-04 10:03:18 -0400 |
---|---|---|
committer | Brian Evans <grknight@gentoo.org> | 2017-08-04 10:06:24 -0400 |
commit | aa4bb8fde3d0d8393bebb225c75474e88a4636e9 (patch) | |
tree | f42319396ba2a85907aaf6117803991d35639017 | |
parent | dev-lang/swi-prolog: bump 7.5 development version (diff) | |
download | gentoo-aa4bb8fde3d0d8393bebb225c75474e88a4636e9.tar.gz gentoo-aa4bb8fde3d0d8393bebb225c75474e88a4636e9.tar.bz2 gentoo-aa4bb8fde3d0d8393bebb225c75474e88a4636e9.zip |
dev-php/PEAR-Translation2: Add patch for basic PHP 5 and 7 support
Package-Manager: Portage-2.3.6, Repoman-2.3.3
-rw-r--r-- | dev-php/PEAR-Translation2/PEAR-Translation2-2.0.4-r1.ebuild | 2 | ||||
-rw-r--r-- | dev-php/PEAR-Translation2/files/modern-php.patch | 328 |
2 files changed, 329 insertions, 1 deletions
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 index 45e54b9d6497..95eff3ebbe56 100644 --- a/dev-php/PEAR-Translation2/PEAR-Translation2-2.0.4-r1.ebuild +++ b/dev-php/PEAR-Translation2/PEAR-Translation2-2.0.4-r1.ebuild @@ -19,7 +19,7 @@ RDEPEND="dev-lang/php:*[nls] dev-php/PEAR-File_Gettext >=dev-php/PEAR-I18Nv2-0.9.1 ) xml? ( >=dev-php/PEAR-XML_Serializer-0.13.0 )" - +PATCHES=( "${FILESDIR}/modern-php.patch" ) src_install() { local DOCS=( docs/gettext_readme.txt ) php-pear-r2_src_install diff --git a/dev-php/PEAR-Translation2/files/modern-php.patch b/dev-php/PEAR-Translation2/files/modern-php.patch new file mode 100644 index 000000000000..c9b8ccaacf75 --- /dev/null +++ b/dev-php/PEAR-Translation2/files/modern-php.patch @@ -0,0 +1,328 @@ +diff -uarN a/docs/examples/gettext_admin.php b/docs/examples/gettext_admin.php +--- a/docs/examples/gettext_admin.php 2010-12-05 17:56:30.000000000 -0500 ++++ b/docs/examples/gettext_admin.php 2017-08-04 09:22:31.277320045 -0400 +@@ -17,7 +17,7 @@ + $days = array(); + $months= array(); + +-$lc = &new I18Nv2_Locale; ++$lc = new I18Nv2_Locale; + + foreach ($langs as $lang) { + $lc->setLocale($lang); +diff -uarN a/docs/examples/gettext_prepare.php b/docs/examples/gettext_prepare.php +--- a/docs/examples/gettext_prepare.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/docs/examples/gettext_prepare.php 2017-08-04 09:22:31.278320085 -0400 +@@ -4,7 +4,7 @@ + require_once 'File/Gettext.php'; + require_once 'I18Nv2/Locale.php'; + +-$l = &new I18Nv2_Locale('en'); ++$l = new I18Nv2_Locale('en'); + $g = &File_Gettext::factory('MO'); + + $g->meta = array('Content-Type' => 'text/plain; charset=iso-8859-1'); +diff -uarN a/scripts/t2xmlchk.php b/scripts/t2xmlchk.php +--- a/scripts/t2xmlchk.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/scripts/t2xmlchk.php 2017-08-04 09:22:31.277320045 -0400 +@@ -39,7 +39,7 @@ + exit("\n"); + } + +-$validator =& new XML_DTD_XmlValidator(); ++$validator =new XML_DTD_XmlValidator(); + + $dtd_file = tempnam('/tmp', 't2'); + $fp = fopen($dtd_file, 'w'); +@@ -63,7 +63,7 @@ + 'string' => 'key', + 'tr' => 'lang' + ); +-$unserializer = &new XML_Unserializer(array('keyAttribute' => $keyAttr)); ++$unserializer = new XML_Unserializer(array('keyAttribute' => $keyAttr)); + if (PEAR::isError($status = $unserializer->unserialize($xml_file, true))) { + exit("FAILED : " . $status->getMessage() . "\n"); + } else { +diff -uarN a/tests/admin_containers_tests.php b/tests/admin_containers_tests.php +--- a/tests/admin_containers_tests.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/admin_containers_tests.php 2017-08-04 09:22:31.272319845 -0400 +@@ -19,7 +19,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new AdminContainersTests(); ++ $test = new AdminContainersTests(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/admin_db_test.php b/tests/admin_db_test.php +--- a/tests/admin_db_test.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/admin_db_test.php 2017-08-04 09:22:31.274319925 -0400 +@@ -5,7 +5,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new TestOfAdminContainerDB(); ++ $test = new TestOfAdminContainerDB(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/admin_gettext_mo_test.php b/tests/admin_gettext_mo_test.php +--- a/tests/admin_gettext_mo_test.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/admin_gettext_mo_test.php 2017-08-04 09:22:31.274319925 -0400 +@@ -23,7 +23,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new TestOfAdminContainerGettextMO(); ++ $test = new TestOfAdminContainerGettextMO(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/admin_gettext_po_test.php b/tests/admin_gettext_po_test.php +--- a/tests/admin_gettext_po_test.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/admin_gettext_po_test.php 2017-08-04 09:22:31.273319885 -0400 +@@ -5,7 +5,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new TestOfAdminContainerGettextPO(); ++ $test = new TestOfAdminContainerGettextPO(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/admin_mdb2_test.php b/tests/admin_mdb2_test.php +--- a/tests/admin_mdb2_test.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/admin_mdb2_test.php 2017-08-04 09:22:31.274319925 -0400 +@@ -15,7 +15,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new TestOfAdminContainerMDB2(); ++ $test = new TestOfAdminContainerMDB2(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/admin_mdb_test.php b/tests/admin_mdb_test.php +--- a/tests/admin_mdb_test.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/admin_mdb_test.php 2017-08-04 09:22:31.273319885 -0400 +@@ -15,7 +15,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new TestOfAdminContainerMDB(); ++ $test = new TestOfAdminContainerMDB(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/all_tests.php b/tests/all_tests.php +--- a/tests/all_tests.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/all_tests.php 2017-08-04 09:22:31.275319965 -0400 +@@ -18,6 +18,6 @@ + } + } + +-$test = &new AllTests(); ++$test = new AllTests(); + $test->run(new HtmlReporter()); + ?> +\ No newline at end of file +diff -uarN a/tests/containers_tests.php b/tests/containers_tests.php +--- a/tests/containers_tests.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/containers_tests.php 2017-08-04 09:22:31.274319925 -0400 +@@ -18,7 +18,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new ContainersTests(); ++ $test = new ContainersTests(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/db_test.php b/tests/db_test.php +--- a/tests/db_test.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/db_test.php 2017-08-04 09:22:31.274319925 -0400 +@@ -5,7 +5,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new TestOfContainerDB(); ++ $test = new TestOfContainerDB(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/gettext_mo_test.php b/tests/gettext_mo_test.php +--- a/tests/gettext_mo_test.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/gettext_mo_test.php 2017-08-04 09:22:31.273319885 -0400 +@@ -82,7 +82,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new TestOfGettextMO(); ++ $test = new TestOfGettextMO(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/gettext_po_test.php b/tests/gettext_po_test.php +--- a/tests/gettext_po_test.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/gettext_po_test.php 2017-08-04 09:22:31.275319965 -0400 +@@ -80,7 +80,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new TestOfGettextPO(); ++ $test = new TestOfGettextPO(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/gettext_prepare.php b/tests/gettext_prepare.php +--- a/tests/gettext_prepare.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/gettext_prepare.php 2017-08-04 09:22:31.275319965 -0400 +@@ -4,7 +4,7 @@ + require_once 'File/Gettext.php'; + require_once 'I18Nv2/Locale.php'; + +-$l = &new I18Nv2_Locale('en'); ++$l = new I18Nv2_Locale('en'); + + foreach (array('mo', 'po') as $fileType) { + +diff -uarN a/tests/mdb2_test.php b/tests/mdb2_test.php +--- a/tests/mdb2_test.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/mdb2_test.php 2017-08-04 09:22:31.273319885 -0400 +@@ -15,7 +15,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new TestOfContainerMDB2(); ++ $test = new TestOfContainerMDB2(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/tests/mdb_test.php b/tests/mdb_test.php +--- a/tests/mdb_test.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/tests/mdb_test.php 2017-08-04 09:22:31.273319885 -0400 +@@ -15,7 +15,7 @@ + + if (!defined('TEST_RUNNING')) { + define('TEST_RUNNING', true); +- $test = &new TestOfContainerMDB(); ++ $test = new TestOfContainerMDB(); + $test->run(new HtmlReporter()); + } + ?> +\ No newline at end of file +diff -uarN a/Translation2/Container/xml.php b/Translation2/Container/xml.php +--- a/Translation2/Container/xml.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/Translation2/Container/xml.php 2017-08-04 09:22:31.277320045 -0400 +@@ -160,7 +160,7 @@ + return new PEAR_Error ("Can\'t read from the XML source: {$this->_filename}"); + } + @flock($fp, LOCK_SH); +- $unserializer = &new XML_Unserializer (array('keyAttribute' => $keyAttr)); ++ $unserializer = new XML_Unserializer (array('keyAttribute' => $keyAttr)); + if (PEAR::isError($status = $unserializer->unserialize($this->_filename, true))) { + fclose($fp); + return $status; +diff -uarN a/Translation2/Container.php b/Translation2/Container.php +--- a/Translation2/Container.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/Translation2/Container.php 2017-08-04 09:32:40.021575421 -0400 +@@ -80,6 +80,9 @@ + * + * @access public + */ ++ function __construct() ++ { ++ } + function Translation2_Container() + { + } +@@ -357,4 +360,4 @@ + + // }}} + } +-?> +\ No newline at end of file ++?> +diff -uarN a/Translation2/Decorator.php b/Translation2/Decorator.php +--- a/Translation2/Decorator.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/Translation2/Decorator.php 2017-08-04 09:33:23.341206788 -0400 +@@ -35,7 +35,7 @@ + * @version CVS: $Id: Decorator.php 305985 2010-12-05 22:55:33Z clockwerx $ + * @link http://pear.php.net/package/Translation2 + */ +- ++require_once 'Translation2.php'; + /** + * Translation2_Decorator. Base Decorator class for Translation2 + * +@@ -88,7 +88,7 @@ + * + * @param object &$translation2 Translation2 object to decorate + */ +- function Translation2_Decorator(& $translation2) ++ function __construct(& $translation2) + { + $this->translation2 = & $translation2; + //used for debug only +@@ -96,7 +96,10 @@ + $this->currentPageID = & $translation2->currentPageID; + $this->lang = & $translation2->lang; + } +- ++ function Translation2_Decorator(& $translation2) ++ { ++ self::__construct($translation2); ++ } + // }}} + // {{{ setOptions() + +@@ -413,4 +416,4 @@ + + // }}} + } +-?> +\ No newline at end of file ++?> +diff -uarN a/Translation2.php b/Translation2.php +--- a/Translation2.php 2010-12-05 17:56:31.000000000 -0500 ++++ b/Translation2.php 2017-08-04 09:31:14.843367708 -0400 +@@ -122,7 +122,7 @@ + /** + * Constructor + */ +- function Translation2() ++ function __construct() + { + if (func_num_args()) { + $msg = '<b>Translation2 error:</b>' +@@ -130,7 +130,10 @@ + trigger_error($msg, E_USER_ERROR); + } + } +- ++ function Translation2() ++ { ++ self::__construct(); ++ } + // }}} + // {{{ factory() + +@@ -595,4 +598,4 @@ + + // }}} + } +-?> +\ No newline at end of file ++?> |