commit:     423a019588ed53a26f35654e566bb7b0f034e210
Author:     Brian Evans <grknight <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  7 14:26:25 2017 +0000
Commit:     Brian Evans <grknight <AT> gentoo <DOT> org>
CommitDate: Tue Aug  8 12:49:27 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=423a0195

dev-php/PEAR-HTTP_Client: Add patch for modern PHP versions

Package-Manager: Portage-2.3.6, Repoman-2.3.3

 .../PEAR-HTTP_Client-1.2.1-r1.ebuild               |  2 +
 dev-php/PEAR-HTTP_Client/files/modern-php.patch    | 69 ++++++++++++++++++++++
 2 files changed, 71 insertions(+)

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 546412ed2b7..be135e1f8c4 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 00000000000..6e715452b48
--- /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);
+     }
+ }
+-?>

Reply via email to