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-HTTP_Client/files/, dev-php/PEAR-HTTP_Client/
Date: Tue, 08 Aug 2017 12:52:59
Message-Id: 1502196567.423a019588ed53a26f35654e566bb7b0f034e210.grknight@gentoo
1 commit: 423a019588ed53a26f35654e566bb7b0f034e210
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 7 14:26:25 2017 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 8 12:49:27 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=423a0195
7
8 dev-php/PEAR-HTTP_Client: Add patch for modern PHP versions
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.3
11
12 .../PEAR-HTTP_Client-1.2.1-r1.ebuild | 2 +
13 dev-php/PEAR-HTTP_Client/files/modern-php.patch | 69 ++++++++++++++++++++++
14 2 files changed, 71 insertions(+)
15
16 diff --git a/dev-php/PEAR-HTTP_Client/PEAR-HTTP_Client-1.2.1-r1.ebuild b/dev-php/PEAR-HTTP_Client/PEAR-HTTP_Client-1.2.1-r1.ebuild
17 index 546412ed2b7..be135e1f8c4 100644
18 --- a/dev-php/PEAR-HTTP_Client/PEAR-HTTP_Client-1.2.1-r1.ebuild
19 +++ b/dev-php/PEAR-HTTP_Client/PEAR-HTTP_Client-1.2.1-r1.ebuild
20 @@ -12,6 +12,8 @@ KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
21 IUSE=""
22 RDEPEND=">=dev-php/PEAR-HTTP_Request-1.2"
23
24 +PATCHES=( "${FILESDIR}/modern-php.patch" )
25 +
26 src_install() {
27 insinto /usr/share/php/HTTP
28 doins -r Client.php Client
29
30 diff --git a/dev-php/PEAR-HTTP_Client/files/modern-php.patch b/dev-php/PEAR-HTTP_Client/files/modern-php.patch
31 new file mode 100644
32 index 00000000000..6e715452b48
33 --- /dev/null
34 +++ b/dev-php/PEAR-HTTP_Client/files/modern-php.patch
35 @@ -0,0 +1,69 @@
36 +diff -aurN a/Client/CookieManager.php b/Client/CookieManager.php
37 +--- a/Client/CookieManager.php 2008-10-25 13:08:26.000000000 -0400
38 ++++ b/Client/CookieManager.php 2017-08-07 10:17:04.495233973 -0400
39 +@@ -75,11 +75,14 @@
40 + * @access public
41 + * @see serializeSessionCookies()
42 + */
43 +- function HTTP_Client_CookieManager($serializeSession = false)
44 ++ function __construct($serializeSession = false)
45 + {
46 + $this->serializeSessionCookies($serializeSession);
47 + }
48 +-
49 ++ function HTTP_Client_CookieManager($serializeSession = false)
50 ++ {
51 ++ self::__construct($serializeSession);
52 ++ }
53 + /**
54 + * Sets whether session cookies should be serialized when serializing object
55 + *
56 +@@ -264,4 +267,3 @@
57 + }
58 + }
59 + }
60 +-?>
61 +diff -aurN a/Client.php b/Client.php
62 +--- a/Client.php 2008-10-25 13:08:26.000000000 -0400
63 ++++ b/Client.php 2017-08-07 10:13:52.524610550 -0400
64 +@@ -171,12 +171,12 @@
65 + * @param array Default headers to send on every request
66 + * @param HTTP_Client_CookieManager Cookie manager object to use
67 + */
68 +- function HTTP_Client($defaultRequestParams = null, $defaultHeaders = null, $cookieManager = null)
69 ++ function __construct($defaultRequestParams = null, $defaultHeaders = null, $cookieManager = null)
70 + {
71 + if (!empty($cookieManager) && is_a($cookieManager, 'HTTP_Client_CookieManager')) {
72 + $this->_cookieManager = $cookieManager;
73 + } else {
74 +- $this->_cookieManager =& new HTTP_Client_CookieManager();
75 ++ $this->_cookieManager = new HTTP_Client_CookieManager();
76 + }
77 + if (isset($defaultHeaders)) {
78 + $this->setDefaultHeader($defaultHeaders);
79 +@@ -185,7 +185,10 @@
80 + $this->setRequestParameter($defaultRequestParams);
81 + }
82 + }
83 +-
84 ++ function HTTP_Client($defaultRequestParams = null, $defaultHeaders = null, $cookieManager = null)
85 ++ {
86 ++ self::__construct($defaultRequestParams, $defaultHeaders, $cookieManager);
87 ++ }
88 +
89 + /**
90 + * Sets the maximum redirects that will be processed.
91 +@@ -225,7 +228,7 @@
92 + */
93 + function &_createRequest($url, $method = HTTP_REQUEST_METHOD_GET, $headers = array())
94 + {
95 +- $req =& new HTTP_Request($url, $this->_defaultRequestParams);
96 ++ $req = new HTTP_Request($url, $this->_defaultRequestParams);
97 + $req->setMethod($method);
98 + foreach ($this->_defaultHeaders as $name => $value) {
99 + $req->addHeader($name, $value);
100 +@@ -716,4 +719,3 @@
101 + return $this->_idx < count($this->_responses);
102 + }
103 + }
104 +-?>