--SKIPIF--
<?php
include 'skip.inc';
+checkmin(5);
?>
--ENV--
HTTP_HOST=www.example.com
--SKIPIF--
<?php
include 'skip.inc';
+checkmin(5);
?>
--ENV--
HTTP_FOO=bar
--SKIPIF--
<?php
include 'skip.inc';
+checkmin(5);
?>
--ENV--
HTTP_ACCEPT=application/xml, application/xhtml+xml, text/html ; q = .8
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
skipif(!http_support(HTTP_SUPPORT_ENCODINGS), "need zlib");
?>
--ENV--
?>
--EXPECTF--
%sTEST
-object(stdClass)#%d (%d) {
+object(stdClass)%s {
["cookies"]=>
array(3) {
["name"]=>
--SKIPIF--
<?php
include 'skip.inc';
+checkmin(5);
?>
--FILE--
<?php
--FILE--
<?php
echo "-TEST\n";
-echo http_parse_message(http_get('http://www.google.com'))->body;
+$m = http_parse_message(http_get('http://www.google.com'));
+echo $m->body;
echo "Done\n";
--EXPECTF--
%sTEST
?>
--EXPECTF--
%sTEST
-object(stdClass)#1 (7) {
+object(stdClass)%s {
["type"]=>
int(2)
["httpVersion"]=>
["body"]=>
string(10) "1234567890"
["parentMessage"]=>
- object(stdClass)#2 (7) {
+ object(stdClass)%s {
["type"]=>
int(1)
["httpVersion"]=>
["body"]=>
string(0) ""
["parentMessage"]=>
- object(stdClass)#3 (7) {
+ object(stdClass)%s {
["type"]=>
int(2)
["httpVersion"]=>
["body"]=>
string(0) ""
["parentMessage"]=>
- object(stdClass)#4 (7) {
+ object(stdClass)%s {
["type"]=>
int(1)
["httpVersion"]=>
var_dump(http_parse_params('text/html; charset="iso-8859-1"'));
var_dump(http_parse_params('attachment; filename="gol;got,a.ext"'));
var_dump(http_parse_params('public, must-revalidate, max-age=0'));
-var_dump(http_parse_params('a')->params[0]);
-var_dump(http_parse_params('a=b')->params[0]);
+$p = http_parse_params('a'); var_dump($p->params[0]);
+$p = http_parse_params('a=b'); var_dump($p->params[0]);
echo "Done\n";
--EXPECTF--
%sTEST
-object(stdClass)#%d (%d) {
+object(stdClass)%s {
["params"]=>
array(2) {
[0]=>
}
}
}
-object(stdClass)#%d (%d) {
+object(stdClass)%s {
["params"]=>
array(2) {
[0]=>
}
}
}
-object(stdClass)#%d (%d) {
+object(stdClass)%s {
["params"]=>
array(2) {
[0]=>
}
}
}
-object(stdClass)#%d (%d) {
+object(stdClass)%s {
["params"]=>
array(3) {
[0]=>
echo "Done\n";
--EXPECTF--
%sTEST
-object(stdClass)#%d (%d) {
+object(stdClass)%s {
["type"]=>
int(2)
["httpVersion"]=>
<?php
echo "-TEST\n";
-var_dump(str_repeat("abc", 6000) === http_parse_message(http_put_data("http://dev.iworks.at/ext-http/.print_put.php5", str_repeat("abc", 6000/* > CURLBUF_SIZE */)))->body);
+$data = str_repeat("abc", 6000/* > CURLBUF_SIZE */);
+$resp = http_put_data("http://dev.iworks.at/ext-http/.print_put.php5", $data);
+$mess = http_parse_message($resp);
+var_dump($data === $mess->body);
echo "Done\n";
?>
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=-5
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=5-6
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=5981-
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=123,-wtf ?
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=5990-6000
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=0-3, 4-5,9-11
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=0-0
<?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-3, 4-5,9-11
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=0-1
<?php
include 'skip.inc';
checkcgi();
+checkmin(5);
?>
--ENV--
HTTP_RANGE=bytes=0-1
<?php
defined('STDOUT') or define('STDOUT', fopen('php://stdout', 'w'));
+if (!function_exists('fprintf')) {
+ function fprintf(){ $a=func_get_args(); $s=array_shift($a); return fwrite($s, call_user_func_array('sprintf',$a)); }
+}
function skipif($if, $skip) { if ($if) { fprintf(STDOUT, "skip $skip"); exit(); }}
function checkcgi() { skipif(!strncasecmp('CLI', PHP_SAPI, 3), 'need CGI SAPI'); }
function checkext($ext) { skipif(!extension_loaded($ext), "need ext/$ext"); }
--SKIPIF--
<?php
include 'skip.inc';
+checkmin(5);
?>
--FILE--
<?php