11 use http\Message as HttpMessage;
14 echo new HttpMessage(" gosh\n nosh\n ");
15 } catch (Exception $ignore) {
18 $m = new HttpMessage();
22 $m->getType()==HttpMessage::TYPE_NONE,
26 $m = new HttpMessage("GET / HTTP/1.1\r\n");
30 $m->getType()==HttpMessage::TYPE_REQUEST,
31 $m->getRequestMethod(),
36 $m = new HttpMessage("HTTP/1.1 200 Okidoki\r\n");
40 $m->getType()==HttpMessage::TYPE_RESPONSE,
41 $m->getResponseCode(),
42 $m->getResponseStatus(),
48 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty.txt"));
52 $m->getType()==HttpMessage::TYPE_RESPONSE,
53 $m->getResponseCode(),
54 $m->getResponseStatus(),
57 echo $m->getParentMessage();
59 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty_gzip.txt"));
63 $m->getType()==HttpMessage::TYPE_RESPONSE,
64 $m->getResponseCode(),
65 $m->getResponseStatus(),
68 echo $m->getParentMessage();
70 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty_chunked.txt"));
74 $m->getType()==HttpMessage::TYPE_RESPONSE,
75 $m->getResponseCode(),
76 $m->getResponseStatus(),
79 echo $m->getParentMessage();
81 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_helloworld_chunked.txt"));
85 $m->getType()==HttpMessage::TYPE_RESPONSE,
86 $m->getResponseCode(),
87 $m->getResponseStatus(),
90 echo $m->getParentMessage();
94 $m = new HttpMessage(fopen(__DIR__."/data/message_rr_empty.txt", "r+b"));
98 $m->getType()==HttpMessage::TYPE_RESPONSE,
99 $m->getResponseCode(),
100 $m->getResponseStatus(),
103 echo $m->getParentMessage();
105 $m = new HttpMessage(fopen(__DIR__."/data/message_rr_empty_gzip.txt", "r+b"));
108 $m->getHttpVersion(),
109 $m->getType()==HttpMessage::TYPE_RESPONSE,
110 $m->getResponseCode(),
111 $m->getResponseStatus(),
114 echo $m->getParentMessage();
116 $m = new HttpMessage(fopen(__DIR__."/data/message_rr_empty_chunked.txt", "r+b"));
119 $m->getHttpVersion(),
120 $m->getType()==HttpMessage::TYPE_RESPONSE,
121 $m->getResponseCode(),
122 $m->getResponseStatus(),
125 echo $m->getParentMessage();
127 $m = new HttpMessage(fopen(__DIR__."/data/message_rr_helloworld_chunked.txt", "r+b"));
130 $m->getHttpVersion(),
131 $m->getType()==HttpMessage::TYPE_RESPONSE,
132 $m->getResponseCode(),
133 $m->getResponseStatus(),
136 echo $m->getParentMessage();
161 Date: Wed, 25 Aug 2010 12:11:44 GMT
162 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
163 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
164 Etag: "2002a-0-48549d615a35c"
167 Vary: Accept-Encoding
169 Content-Type: text/plain
170 X-Original-Content-Length: 0
177 string(29) "Wed, 25 Aug 2010 12:11:44 GMT"
179 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
181 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
183 string(23) ""2002a-0-48549d615a35c""
189 string(15) "Accept-Encoding"
193 string(10) "text/plain"
194 ["X-Original-Content-Length"]=>
197 GET /default/empty.txt HTTP/1.1
201 Date: Thu, 26 Aug 2010 09:55:09 GMT
202 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
203 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
204 Etag: "2002a-0-48549d615a35c"
206 Vary: Accept-Encoding
208 Content-Type: text/plain
209 X-Original-Content-Length: 20
210 X-Original-Content-Encoding: gzip
217 string(29) "Thu, 26 Aug 2010 09:55:09 GMT"
219 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
221 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
223 string(23) ""2002a-0-48549d615a35c""
227 string(15) "Accept-Encoding"
231 string(10) "text/plain"
232 ["X-Original-Content-Length"]=>
234 ["X-Original-Content-Encoding"]=>
237 GET /default/empty.txt HTTP/1.1
239 Accept-Encoding: gzip
242 Date: Thu, 26 Aug 2010 11:41:02 GMT
243 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
244 X-Powered-By: PHP/5.3.3
245 Vary: Accept-Encoding
247 Content-Type: text/html
248 X-Original-Transfer-Encoding: chunked
256 string(29) "Thu, 26 Aug 2010 11:41:02 GMT"
258 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
260 string(9) "PHP/5.3.3"
262 string(15) "Accept-Encoding"
266 string(9) "text/html"
267 ["X-Original-Transfer-Encoding"]=>
272 GET /default/empty.php HTTP/1.1
276 Date: Thu, 26 Aug 2010 12:51:28 GMT
277 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
278 Vary: Accept-Encoding
280 Content-Type: text/plain
281 X-Original-Transfer-Encoding: chunked
291 string(29) "Thu, 26 Aug 2010 12:51:28 GMT"
293 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
295 string(15) "Accept-Encoding"
299 string(10) "text/plain"
300 ["X-Original-Transfer-Encoding"]=>
305 GET /cgi-bin/chunked.sh HTTP/1.1
310 Date: Wed, 25 Aug 2010 12:11:44 GMT
311 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
312 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
313 Etag: "2002a-0-48549d615a35c"
316 Vary: Accept-Encoding
318 Content-Type: text/plain
319 X-Original-Content-Length: 0
326 string(29) "Wed, 25 Aug 2010 12:11:44 GMT"
328 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
330 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
332 string(23) ""2002a-0-48549d615a35c""
338 string(15) "Accept-Encoding"
342 string(10) "text/plain"
343 ["X-Original-Content-Length"]=>
346 GET /default/empty.txt HTTP/1.1
350 Date: Thu, 26 Aug 2010 09:55:09 GMT
351 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
352 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
353 Etag: "2002a-0-48549d615a35c"
355 Vary: Accept-Encoding
357 Content-Type: text/plain
358 X-Original-Content-Length: 20
359 X-Original-Content-Encoding: gzip
366 string(29) "Thu, 26 Aug 2010 09:55:09 GMT"
368 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
370 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
372 string(23) ""2002a-0-48549d615a35c""
376 string(15) "Accept-Encoding"
380 string(10) "text/plain"
381 ["X-Original-Content-Length"]=>
383 ["X-Original-Content-Encoding"]=>
386 GET /default/empty.txt HTTP/1.1
388 Accept-Encoding: gzip
391 Date: Thu, 26 Aug 2010 11:41:02 GMT
392 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
393 X-Powered-By: PHP/5.3.3
394 Vary: Accept-Encoding
396 Content-Type: text/html
397 X-Original-Transfer-Encoding: chunked
405 string(29) "Thu, 26 Aug 2010 11:41:02 GMT"
407 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
409 string(9) "PHP/5.3.3"
411 string(15) "Accept-Encoding"
415 string(9) "text/html"
416 ["X-Original-Transfer-Encoding"]=>
421 GET /default/empty.php HTTP/1.1
425 Date: Thu, 26 Aug 2010 12:51:28 GMT
426 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
427 Vary: Accept-Encoding
429 Content-Type: text/plain
430 X-Original-Transfer-Encoding: chunked
440 string(29) "Thu, 26 Aug 2010 12:51:28 GMT"
442 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
444 string(15) "Accept-Encoding"
448 string(10) "text/plain"
449 ["X-Original-Transfer-Encoding"]=>
454 GET /cgi-bin/chunked.sh HTTP/1.1