memset(r, 0, sizeof(http_request));
r->ch = ch;
- r->url = (url && *url) ? estrdup(url) : NULL;
+ r->url = (url) ? http_absolute_url(url) : NULL;
r->meth = (meth > 0) ? meth : HTTP_GET;
phpstr_init(&r->conv.request);
} catch (HttpRequestPoolException $x) {
var_dump(count($x->exceptionStack));
}
-
-try {
- $p = new HttpRequestPool(new HttpRequest);
-} catch (HttpRequestPoolException $x) {
- var_dump(count($x->exceptionStack));
-}
-
-try {
- $p = new HttpRequestPool(new HttpRequest, new HttpRequest);
-} catch (HttpRequestPoolException $x) {
- var_dump(count($x->exceptionStack));
-}
-
echo "Done\n";
?>
--EXPECTF--
%sTEST
int(2)
int(4)
-int(1)
-int(2)
Done
printf("%2d: %s\n", $i, get_class($x));
}
}
-if (http_support(HTTP_SUPPORT_REQUESTS)) {
- try {
- $tmp = http_get(null);
- } catch (HttpRequestException $x) {
- printf("%s (%d)\n", $x->getMessage(), $x->getCode());
- }
-} else {
- echo "URL using bad/illegal format or missing URL; No URL set!\n ((null)) (8)\n";
-}
echo "Done\n";
?>
--EXPECTF--
10: HttpSocketException
11: HttpResponseException
12: HttpUrlException
-URL using bad/illegal format or missing URL; No URL set!
- ((null)) (8)
Done
function test_zlib()
{
if ($support = http_support(HTTP_SUPPORT_ENCODINGS)) {
- $this->assertEquals(file_get_contents(__FILE__), http_gzdecode(http_gzencode(file_get_contents(__FILE__))));
+ $this->assertEquals(file_get_contents(__FILE__), http_inflate(http_deflate(file_get_contents(__FILE__), HTTP_DEFLATE_TYPE_GZIP)));
$this->assertEquals(file_get_contents(__FILE__), http_inflate(http_deflate(file_get_contents(__FILE__))));
} else {
$this->assertFalse($support);