diff options
author | Brian Evans <grknight@gentoo.org> | 2017-08-04 15:02:54 -0400 |
---|---|---|
committer | Brian Evans <grknight@gentoo.org> | 2017-08-04 15:02:54 -0400 |
commit | 922dbe6f4480345a53ea02ab58e93520618bf0cc (patch) | |
tree | 480a3b3cd8917854d2d19ae41e3ad01ec907a9d1 /dev-php | |
parent | dev-util/rosdep: bump to 0.11.8 (diff) | |
download | gentoo-922dbe6f4480345a53ea02ab58e93520618bf0cc.tar.gz gentoo-922dbe6f4480345a53ea02ab58e93520618bf0cc.tar.bz2 gentoo-922dbe6f4480345a53ea02ab58e93520618bf0cc.zip |
dev-php/PEAR-Net_IPv4: Add upstream patch to remove globals
Package-Manager: Portage-2.3.6, Repoman-2.3.3
Diffstat (limited to 'dev-php')
-rw-r--r-- | dev-php/PEAR-Net_IPv4/PEAR-Net_IPv4-1.3.4-r1.ebuild | 2 | ||||
-rw-r--r-- | dev-php/PEAR-Net_IPv4/files/remove_globals.patch | 96 |
2 files changed, 98 insertions, 0 deletions
diff --git a/dev-php/PEAR-Net_IPv4/PEAR-Net_IPv4-1.3.4-r1.ebuild b/dev-php/PEAR-Net_IPv4/PEAR-Net_IPv4-1.3.4-r1.ebuild index 79a5e32a4408..02a62c1efdb8 100644 --- a/dev-php/PEAR-Net_IPv4/PEAR-Net_IPv4-1.3.4-r1.ebuild +++ b/dev-php/PEAR-Net_IPv4/PEAR-Net_IPv4-1.3.4-r1.ebuild @@ -11,3 +11,5 @@ LICENSE="PHP-3.01" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="" + +PATCHES=( "${FILESDIR}/remove_globals.patch" ) diff --git a/dev-php/PEAR-Net_IPv4/files/remove_globals.patch b/dev-php/PEAR-Net_IPv4/files/remove_globals.patch new file mode 100644 index 000000000000..2403deb0b4af --- /dev/null +++ b/dev-php/PEAR-Net_IPv4/files/remove_globals.patch @@ -0,0 +1,96 @@ +diff -aurN a/Net/IPv4.php b/Net/IPv4.php +--- a/Net/IPv4.php 2010-09-08 06:31:50.000000000 -0400 ++++ b/Net/IPv4.php 2017-08-04 14:57:52.872878217 -0400 +@@ -32,7 +32,37 @@ + *
+ * @global array $GLOBALS['Net_IPv4_Netmask_Map']
+ */
+-$GLOBALS['Net_IPv4_Netmask_Map'] = array(
++$GLOBALS['Net_IPv4_Netmask_Map'] = Net_IPv4::$Net_IPv4_Netmask_Map;
++// }}}
++// {{{ Net_IPv4
++
++/**
++* Class to provide IPv4 calculations
++*
++* Provides methods for validating IP addresses, calculating netmasks,
++* broadcast addresses, network addresses, conversion routines, etc.
++*
++* @category Net
++* @package Net_IPv4
++* @author Eric Kilfoil <edk@ypass.net>
++* @author Marco Kaiser <bate@php.net>
++* @author Florian Anderiasch <fa@php.net>
++* @copyright 1997-2005 The PHP Group
++* @license http://www.php.net/license/3_01.txt PHP License 3.01
++* @version CVS: @package_version@
++* @link http://pear.php.net/package/Net_IPv4
++* @access public
++*/
++class Net_IPv4
++{
++ // {{{ properties
++ var $ip = "";
++ var $bitmask = false;
++ var $netmask = "";
++ var $network = "";
++ var $broadcast = "";
++ var $long = 0;
++public static $Net_IPv4_Netmask_Map = array(
+ 0 => "0.0.0.0",
+ 1 => "128.0.0.0",
+ 2 => "192.0.0.0",
+@@ -67,35 +97,6 @@ + 31 => "255.255.255.254",
+ 32 => "255.255.255.255"
+ );
+-// }}}
+-// {{{ Net_IPv4
+-
+-/**
+-* Class to provide IPv4 calculations
+-*
+-* Provides methods for validating IP addresses, calculating netmasks,
+-* broadcast addresses, network addresses, conversion routines, etc.
+-*
+-* @category Net
+-* @package Net_IPv4
+-* @author Eric Kilfoil <edk@ypass.net>
+-* @author Marco Kaiser <bate@php.net>
+-* @author Florian Anderiasch <fa@php.net>
+-* @copyright 1997-2005 The PHP Group
+-* @license http://www.php.net/license/3_01.txt PHP License 3.01
+-* @version CVS: @package_version@
+-* @link http://pear.php.net/package/Net_IPv4
+-* @access public
+-*/
+-class Net_IPv4
+-{
+- // {{{ properties
+- var $ip = "";
+- var $bitmask = false;
+- var $netmask = "";
+- var $network = "";
+- var $broadcast = "";
+- var $long = 0;
+
+ // }}}
+ // {{{ validateIP()
+@@ -154,7 +155,7 @@ + */
+ function validateNetmask($netmask)
+ {
+- if (! in_array($netmask, $GLOBALS['Net_IPv4_Netmask_Map'])) {
++ if (! in_array($netmask, self::$Net_IPv4_Netmask_Map)) {
+ return false;
+ }
+ return true;
+@@ -264,7 +265,7 @@ + */
+ function calculate()
+ {
+- $validNM = $GLOBALS['Net_IPv4_Netmask_Map'];
++ $validNM = self::$Net_IPv4_Netmask_Map;
+
+ if (! is_a($this, "net_ipv4")) {
+ $myself = new Net_IPv4;
|