summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Evans <grknight@gentoo.org>2017-08-07 10:26:25 -0400
committerBrian Evans <grknight@gentoo.org>2017-08-08 08:49:27 -0400
commit423a019588ed53a26f35654e566bb7b0f034e210 (patch)
tree2f722e6869349933d61a5a4e80428bd1d7b31b5e /dev-php
parentdev-db/mariadb: Fix pkg_config for bug 626866 (diff)
downloadgentoo-423a019588ed53a26f35654e566bb7b0f034e210.tar.gz
gentoo-423a019588ed53a26f35654e566bb7b0f034e210.tar.bz2
gentoo-423a019588ed53a26f35654e566bb7b0f034e210.zip
dev-php/PEAR-HTTP_Client: Add patch for modern PHP versions
Package-Manager: Portage-2.3.6, Repoman-2.3.3
Diffstat (limited to 'dev-php')
-rw-r--r--dev-php/PEAR-HTTP_Client/PEAR-HTTP_Client-1.2.1-r1.ebuild2
-rw-r--r--dev-php/PEAR-HTTP_Client/files/modern-php.patch69
2 files changed, 71 insertions, 0 deletions
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
index 546412ed2b76..be135e1f8c47 100644
--- 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
@@ -12,6 +12,8 @@ KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
IUSE=""
RDEPEND=">=dev-php/PEAR-HTTP_Request-1.2"
+PATCHES=( "${FILESDIR}/modern-php.patch" )
+
src_install() {
insinto /usr/share/php/HTTP
doins -r Client.php Client
diff --git a/dev-php/PEAR-HTTP_Client/files/modern-php.patch b/dev-php/PEAR-HTTP_Client/files/modern-php.patch
new file mode 100644
index 000000000000..6e715452b481
--- /dev/null
+++ b/dev-php/PEAR-HTTP_Client/files/modern-php.patch
@@ -0,0 +1,69 @@
+diff -aurN a/Client/CookieManager.php b/Client/CookieManager.php
+--- a/Client/CookieManager.php 2008-10-25 13:08:26.000000000 -0400
++++ b/Client/CookieManager.php 2017-08-07 10:17:04.495233973 -0400
+@@ -75,11 +75,14 @@
+ * @access public
+ * @see serializeSessionCookies()
+ */
+- function HTTP_Client_CookieManager($serializeSession = false)
++ function __construct($serializeSession = false)
+ {
+ $this->serializeSessionCookies($serializeSession);
+ }
+-
++ function HTTP_Client_CookieManager($serializeSession = false)
++ {
++ self::__construct($serializeSession);
++ }
+ /**
+ * Sets whether session cookies should be serialized when serializing object
+ *
+@@ -264,4 +267,3 @@
+ }
+ }
+ }
+-?>
+diff -aurN a/Client.php b/Client.php
+--- a/Client.php 2008-10-25 13:08:26.000000000 -0400
++++ b/Client.php 2017-08-07 10:13:52.524610550 -0400
+@@ -171,12 +171,12 @@
+ * @param array Default headers to send on every request
+ * @param HTTP_Client_CookieManager Cookie manager object to use
+ */
+- function HTTP_Client($defaultRequestParams = null, $defaultHeaders = null, $cookieManager = null)
++ function __construct($defaultRequestParams = null, $defaultHeaders = null, $cookieManager = null)
+ {
+ if (!empty($cookieManager) && is_a($cookieManager, 'HTTP_Client_CookieManager')) {
+ $this->_cookieManager = $cookieManager;
+ } else {
+- $this->_cookieManager =& new HTTP_Client_CookieManager();
++ $this->_cookieManager = new HTTP_Client_CookieManager();
+ }
+ if (isset($defaultHeaders)) {
+ $this->setDefaultHeader($defaultHeaders);
+@@ -185,7 +185,10 @@
+ $this->setRequestParameter($defaultRequestParams);
+ }
+ }
+-
++ function HTTP_Client($defaultRequestParams = null, $defaultHeaders = null, $cookieManager = null)
++ {
++ self::__construct($defaultRequestParams, $defaultHeaders, $cookieManager);
++ }
+
+ /**
+ * Sets the maximum redirects that will be processed.
+@@ -225,7 +228,7 @@
+ */
+ function &_createRequest($url, $method = HTTP_REQUEST_METHOD_GET, $headers = array())
+ {
+- $req =& new HTTP_Request($url, $this->_defaultRequestParams);
++ $req = new HTTP_Request($url, $this->_defaultRequestParams);
+ $req->setMethod($method);
+ foreach ($this->_defaultHeaders as $name => $value) {
+ $req->addHeader($name, $value);
+@@ -716,4 +719,3 @@
+ return $this->_idx < count($this->_responses);
+ }
+ }
+-?>