From: Michael Wallner Date: Wed, 7 Sep 2016 06:01:09 +0000 (+0200) Subject: Merge branch 'v2.6.x' X-Git-Tag: RELEASE_3_1_0_BETA2~1 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=faf7a7899fa8ffb24f8105a921f359d6b97ec34e;hp=06e6ed638087fb1f8ee2a5c950c7bd71d4b12eef Merge branch 'v2.6.x' --- diff --git a/package.xml b/package.xml index e104c7e..f8d65e0 100644 --- a/package.xml +++ b/package.xml @@ -31,7 +31,7 @@ https://mdref.m6w6.name/http mike@php.net yes - 2016-08-22 + 2016-09-07 3.1.0beta2 3.1.0 @@ -65,6 +65,9 @@ https://mdref.m6w6.name/http * Fix gh-issue #34: allow setting multiple headers with the same name (Mike, @rcanavan) * Fix gh-issue #33: allow setting prodyhost request option to NULL (Mike, @rcanavan) * Fix gh-issue #31: add/improve configure checks for default CA bundle/path (Mike, @rcanavan) + +Changes from beta1: +* Fixed recursive calls to the event loop dispatcher ]]> @@ -273,6 +276,7 @@ https://mdref.m6w6.name/http + diff --git a/scripts/gen_travis_yml.php b/scripts/gen_travis_yml.php index f83d0b4..311a4cd 100755 --- a/scripts/gen_travis_yml.php +++ b/scripts/gen_travis_yml.php @@ -23,8 +23,6 @@ $env = $gen([ "enable_json", "enable_hash" => ["yes"], "enable_iconv" => ["yes"], - "enable_phar" => ["yes"], - "enable_posix" => ["yes"] ]); foreach ($env as $e) { printf(" - %s\n", $e); diff --git a/src/php_http_client.c b/src/php_http_client.c index d0e6e80..4118ab1 100644 --- a/src/php_http_client.c +++ b/src/php_http_client.c @@ -1270,7 +1270,8 @@ static PHP_METHOD(HttpClient, getAvailableConfiguration) } ZEND_BEGIN_ARG_INFO_EX(ai_HttpClient_setDebug, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 1) + /* using IS_CALLABLE type hint would create a forwards compatibility break */ + ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO(); static PHP_METHOD(HttpClient, setDebug) { diff --git a/src/php_http_client_curl_user.c b/src/php_http_client_curl_user.c index 225ce1c..66edae6 100644 --- a/src/php_http_client_curl_user.c +++ b/src/php_http_client_curl_user.c @@ -260,7 +260,8 @@ zend_class_entry *php_http_client_curl_user_get_class_entry() } ZEND_BEGIN_ARG_INFO_EX(ai_init, 0, 0, 1) - ZEND_ARG_TYPE_INFO(0, run, IS_CALLABLE, 0) + /* using IS_CALLABLE type hint would create a forwards compatibility break */ + ZEND_ARG_INFO(0, run) ZEND_END_ARG_INFO(); ZEND_BEGIN_ARG_INFO_EX(ai_timer, 0, 0, 1) #if PHP_VERSION_ID >= 70000 diff --git a/tests/bug69357.phpt b/tests/bug69357.phpt index ac93baf..8d731c5 100644 --- a/tests/bug69357.phpt +++ b/tests/bug69357.phpt @@ -12,11 +12,11 @@ echo "Test\n"; include "helper/server.inc"; server("upload.inc", function($port) { - $r = new \http\Client\Request("PUT", "http://localhost:$port/", [], - (new \http\Message\Body)->append("foo") - ); + $b = new \http\Message\Body; + $b->append("foo"); + $r = new \http\Client\Request("PUT", "http://localhost:$port/", array(), $b); $c = new \http\Client; - $c->setOptions(["expect_100_timeout" => 0]); + $c->setOptions(array("expect_100_timeout" => 0)); $c->enqueue($r)->send(); var_dump($c->getResponse($r)->getInfo()); diff --git a/tests/bug71719.phpt b/tests/bug71719.phpt index f75bac9..fb0138b 100644 --- a/tests/bug71719.phpt +++ b/tests/bug71719.phpt @@ -20,6 +20,6 @@ try { Test %r(exception ')?%rhttp\Exception\BadMessageException%r(' with message '|: )%rhttp\Message::__construct(): Could not parse HTTP protocol version 'HTTP/%s.0'%r'?%r in %sbug71719.php:5 Stack trace: -#0 %sbug71719.php(5): http\Message->__construct('\x80\xACTd 5 HTTP/1.1...', false) +#0 %sbug71719.php(5): http\Message->__construct('%r(\?\?|\\x80\\xAC)%rTd 5 HTTP/1.1...', false) #1 {main} ===DONE=== diff --git a/tests/client021.phpt b/tests/client021.phpt index ef64909..e819003 100644 --- a/tests/client021.phpt +++ b/tests/client021.phpt @@ -110,8 +110,10 @@ dump($tmpfile); }); -(new http\Client("curl", "test"))->configure(["share_cookies" => false]); -$request->setOptions(["cookiestore" => null]); +$c = new http\Client("curl", "test"); +$c->configure(array("share_cookies" => false)); +$c = null; +$request->setOptions(array("cookiestore" => null)); server("cookie.inc", function($port) use($request, $tmpfile) { $request->setOptions(array("port" => $port)); diff --git a/tests/client027.phpt b/tests/client027.phpt index 5d81194..d33a58d 100644 --- a/tests/client027.phpt +++ b/tests/client027.phpt @@ -15,7 +15,7 @@ echo "Test\n"; server("cookie.inc", function($port) { $client = new http\Client(null, "cookies"); - $client->configure(["pipelining" => false]); + $client->configure(array("pipelining" => false)); $request = new http\Client\Request("GET", "http://localhost:$port?r1"); $client->enqueue($request); $client->send(); diff --git a/tests/client028.phpt b/tests/client028.phpt index 27ab2b6..232f562 100644 --- a/tests/client028.phpt +++ b/tests/client028.phpt @@ -13,19 +13,19 @@ class UserHandler implements http\Client\Curl\User { private $client; private $run; - private $fds = [ - "R" => [], - "W" => [] - ]; - private $R = []; - private $W = []; + private $fds = array( + "R" => array(), + "W" => array() + ); + private $R = array(); + private $W = array(); private $timeout = 1000; function __construct(http\Client $client) { $this->client = $client; } - function init(callable $run) { + function init($run) { $this->run = $run; } @@ -124,9 +124,9 @@ include "helper/server.inc"; server("proxy.inc", function($port) { $client = new http\Client; - $client->configure([ + $client->configure(array( "use_eventloop" => new UserHandler($client) - ]); + )); $client->enqueue(new http\Client\Request("GET", "http://localhost:$port/"), function($r) { var_dump($r->getResponseCode()); }); diff --git a/tests/client029.phpt b/tests/client029.phpt index 70f1005..1c8dc4f 100644 --- a/tests/client029.phpt +++ b/tests/client029.phpt @@ -25,7 +25,7 @@ class UserHandler implements http\Client\Curl\User $this->client = $client; } - function init(callable $run) { + function init($run) { $this->run = $run; } diff --git a/tests/client030.phpt b/tests/client030.phpt index 582087f..2a07128 100644 --- a/tests/client030.phpt +++ b/tests/client030.phpt @@ -17,9 +17,9 @@ class test implements SplObserver { } server("proxy.inc", function($port) { $client = new http\Client; - $client->configure([ + $client->configure(array( "use_eventloop" => true, - ]); + )); $client->attach(new test); $client->enqueue(new http\Client\Request("GET", "http://localhost:$port/"), function($r) { var_dump($r->getResponseCode()); diff --git a/tests/gh-issue12.phpt b/tests/gh-issue12.phpt index 0721586..8b2e378 100644 --- a/tests/gh-issue12.phpt +++ b/tests/gh-issue12.phpt @@ -14,7 +14,8 @@ $urls = array( foreach ($urls as $url) { try { - (new http\Client\Request)->setRequestUrl($url); + $c = new http\Client\Request; + $c->setRequestUrl($url); printf("OK: %s\n", $url); } catch (Exception $e) { printf("%s\n", $e->getMessage()); diff --git a/tests/gh-issue47.phpt b/tests/gh-issue47.phpt index 1a09b8d..29205ec 100644 --- a/tests/gh-issue47.phpt +++ b/tests/gh-issue47.phpt @@ -8,10 +8,10 @@ include "skipif.inc"; mod($urls[1]); diff --git a/tests/gh-issue50.phpt b/tests/gh-issue50.phpt index 6cef7d9..52c7648 100644 --- a/tests/gh-issue50.phpt +++ b/tests/gh-issue50.phpt @@ -33,7 +33,7 @@ Test http\Exception\RuntimeException: http\Client::dequeue(): Could not dequeue request while executing callbacks in %sgh-issue50.php:9 Stack trace: #0 %sgh-issue50.php(9): http\Client->dequeue(Object(http\Client\Request)) -#1 [internal function]: {closure}(Object(http\Client), Object(http\Client\Request), 18, 'GET / HTTP/1.1\r...') +#1 [internal function]: {closure}(Object(http\Client), Object(http\Client\Request), 18, 'GET / HTTP/1.1%s...') #2 %sgh-issue50.php(14): http\Client->send() #3 {main} ===DONE=== diff --git a/tests/gh-issue6.phpt b/tests/gh-issue6.phpt index 3de34bd..470bfea 100644 --- a/tests/gh-issue6.phpt +++ b/tests/gh-issue6.phpt @@ -7,9 +7,11 @@ url - unsafe characters echo "Test\n"; -echo (new http\Url("?__utma=1152894289.1017686999.9107388726.1439222726.1494721726.1&__utmb=115739289.1.10.1437388726&__utmc=115883619&__utmx=-&__utmz=115111289.14310476.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)&__utmv=-&__utmk=112678937"))->query; +$url = new http\Url("?__utma=1152894289.1017686999.9107388726.1439222726.1494721726.1&__utmb=115739289.1.10.1437388726&__utmc=115883619&__utmx=-&__utmz=115111289.14310476.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)&__utmv=-&__utmk=112678937"); +echo $url->query; echo "\n"; -echo (new http\Url("?id={\$id}"))->query; +$url = new http\Url("?id={\$id}"); +echo $url->query; echo "\n"; ?>