%sTEST
HttpRequestPoolException: Exception caused by 2 inner exception(s)
HttpInvalidParamException: Empty or too short HTTP message: ''
- HttpRequestException: couldn't resolve host name; Couldn't resolve host '_____' (http://_____/)
+ HttpRequestException: %souldn't resolve host name; %s (http://_____/)
int(3)
HttpRequestPoolException: Exception caused by 4 inner exception(s)
HttpInvalidParamException: Empty or too short HTTP message: ''
- HttpRequestException: couldn't resolve host name; Couldn't resolve host '_____' (http://_____/)
+ HttpRequestException: %souldn't resolve host name; %s (http://_____/)
HttpInvalidParamException: Empty or too short HTTP message: ''
- HttpRequestException: couldn't resolve host name; Couldn't resolve host '_____' (http://_____/)
+ HttpRequestException: %souldn't resolve host name; %s (http://_____/)
int(5)
Done
%sTEST
First Request
-string(149) "Array
+string(%d) "Array
(
[int] => 1
[dbl] => 3.1415926535898
}
Second Request
-string(285) "Array
+string(%d) "Array
(
[0] => Array
(
}
Third Request
-string(302) "Array
+string(%d) "Array
(
[0] => Array
(
--- /dev/null
+--TEST--
+persistent handles
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkmin(5);
+skipif(!http_support(HTTP_SUPPORT_REQUESTS), "need request support");
+skipif(function_exists('zend_thread_id'), "need non-ZTS build");
+?>
+--INI--
+http.persistent.handles.limit=-1
+http.persistent.handles.ident=GLOBAL
+--FILE--
+<?php
+echo "-TEST\n";
+
+echo "No free handles!\n";
+foreach (http_persistent_handles_count() as $provider => $idents) {
+ foreach ((array)$idents as $ident => $counts) {
+ if (!empty($counts["free"])) {
+ printf("%s, %s, %s\n", $provider, $ident, $counts["free"]);
+ }
+ }
+}
+
+http_get("http://www.google.com/", null, $info[]);
+
+echo "One free request handle within GLOBAL: ";
+$h = http_persistent_handles_count();
+var_dump($h->http_request["GLOBAL"]["free"]);
+
+echo "Reusing request handle: ";
+http_get("http://www.google.com/", null, $info[]);
+var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]);
+
+echo "Handles' been cleaned up:\n";
+http_persistent_handles_clean();
+print_r(http_persistent_handles_count());
+
+echo "Done\n";
+?>
+--EXPECTF--
+%sTEST
+No free handles!
+One free request handle within GLOBAL: int(1)
+Reusing request handle: bool(true)
+float(%f)
+float(%f)
+Handles' been cleaned up:
+stdClass Object
+(
+ [http_request] => Array
+ (
+ [GLOBAL] => Array
+ (
+ [used] => 0
+ [free] => 0
+ )
+
+ )
+
+ [http_request_datashare] => Array
+ (
+ [GLOBAL] => Array
+ (
+ [used] => 0
+ [free] => 0
+ )
+
+ )
+
+ [http_request_pool] => Array
+ (
+ [GLOBAL] => Array
+ (
+ [used] => 0
+ [free] => 0
+ )
+
+ )
+
+)
+Done
--- /dev/null
+--TEST--
+persistent handles
+--SKIPIF--
+<?php
+include 'skip.inc';
+checkmax(4.4);
+skipif(!http_support(HTTP_SUPPORT_REQUESTS), "need request support");
+?>
+--INI--
+http.persistent.handles.limit=-1
+http.persistent.handles.ident=GLOBAL
+--FILE--
+<?php
+echo "-TEST\n";
+
+echo "No free handles!\n";
+foreach (http_persistent_handles_count() as $provider => $idents) {
+ foreach ((array)$idents as $ident => $counts) {
+ if (!empty($counts["free"])) {
+ printf("%s, %s, %s\n", $provider, $ident, $counts["free"]);
+ }
+ }
+}
+
+http_get("http://www.google.com/", null, $info[]);
+
+echo "One free request handle within GLOBAL: ";
+$h = http_persistent_handles_count();
+var_dump($h->http_request["GLOBAL"]["free"]);
+
+echo "Reusing request handle: ";
+http_get("http://www.google.com/", null, $info[]);
+var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]);
+
+echo "Handles' been cleaned up:\n";
+http_persistent_handles_clean();
+print_r(http_persistent_handles_count());
+
+echo "Done\n";
+?>
+--EXPECTF--
+%sTEST
+No free handles!
+One free request handle within GLOBAL: int(1)
+Reusing request handle: bool(true)
+float(%f)
+float(%f)
+Handles' been cleaned up:
+stdClass Object
+(
+ [http_request] => Array
+ (
+ [GLOBAL] => Array
+ (
+ [used] => 0
+ [free] => 0
+ )
+
+ )
+
+)
+Done
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=0-0,-1
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=0-0