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
202 Date: Thu, 26 Aug 2010 09:55:09 GMT
203 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
204 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
205 Etag: "2002a-0-48549d615a35c"
207 Vary: Accept-Encoding
210 Content-Type: text/plain
211 X-Original-Content-Length: 20
212 X-Original-Content-Encoding: gzip
219 string(29) "Thu, 26 Aug 2010 09:55:09 GMT"
221 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
223 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
225 string(23) ""2002a-0-48549d615a35c""
229 string(15) "Accept-Encoding"
235 string(10) "text/plain"
236 ["X-Original-Content-Length"]=>
238 ["X-Original-Content-Encoding"]=>
241 GET /default/empty.txt HTTP/1.1
243 Accept-Encoding: gzip
247 Date: Thu, 26 Aug 2010 11:41:02 GMT
248 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
249 X-Powered-By: PHP/5.3.3
250 Vary: Accept-Encoding
252 Content-Type: text/html
253 X-Original-Transfer-Encoding: chunked
261 string(29) "Thu, 26 Aug 2010 11:41:02 GMT"
263 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
265 string(9) "PHP/5.3.3"
267 string(15) "Accept-Encoding"
271 string(9) "text/html"
272 ["X-Original-Transfer-Encoding"]=>
277 GET /default/empty.php HTTP/1.1
282 Date: Thu, 26 Aug 2010 12:51:28 GMT
283 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
284 Vary: Accept-Encoding
286 Content-Type: text/plain
287 X-Original-Transfer-Encoding: chunked
297 string(29) "Thu, 26 Aug 2010 12:51:28 GMT"
299 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
301 string(15) "Accept-Encoding"
305 string(10) "text/plain"
306 ["X-Original-Transfer-Encoding"]=>
311 GET /cgi-bin/chunked.sh HTTP/1.1
317 Date: Wed, 25 Aug 2010 12:11:44 GMT
318 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
319 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
320 Etag: "2002a-0-48549d615a35c"
323 Vary: Accept-Encoding
325 Content-Type: text/plain
326 X-Original-Content-Length: 0
333 string(29) "Wed, 25 Aug 2010 12:11:44 GMT"
335 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
337 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
339 string(23) ""2002a-0-48549d615a35c""
345 string(15) "Accept-Encoding"
349 string(10) "text/plain"
350 ["X-Original-Content-Length"]=>
353 GET /default/empty.txt HTTP/1.1
358 Date: Thu, 26 Aug 2010 09:55:09 GMT
359 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
360 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
361 Etag: "2002a-0-48549d615a35c"
363 Vary: Accept-Encoding
366 Content-Type: text/plain
367 X-Original-Content-Length: 20
368 X-Original-Content-Encoding: gzip
375 string(29) "Thu, 26 Aug 2010 09:55:09 GMT"
377 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
379 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
381 string(23) ""2002a-0-48549d615a35c""
385 string(15) "Accept-Encoding"
391 string(10) "text/plain"
392 ["X-Original-Content-Length"]=>
394 ["X-Original-Content-Encoding"]=>
397 GET /default/empty.txt HTTP/1.1
399 Accept-Encoding: gzip
403 Date: Thu, 26 Aug 2010 11:41:02 GMT
404 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
405 X-Powered-By: PHP/5.3.3
406 Vary: Accept-Encoding
408 Content-Type: text/html
409 X-Original-Transfer-Encoding: chunked
417 string(29) "Thu, 26 Aug 2010 11:41:02 GMT"
419 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
421 string(9) "PHP/5.3.3"
423 string(15) "Accept-Encoding"
427 string(9) "text/html"
428 ["X-Original-Transfer-Encoding"]=>
433 GET /default/empty.php HTTP/1.1
438 Date: Thu, 26 Aug 2010 12:51:28 GMT
439 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
440 Vary: Accept-Encoding
442 Content-Type: text/plain
443 X-Original-Transfer-Encoding: chunked
453 string(29) "Thu, 26 Aug 2010 12:51:28 GMT"
455 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
457 string(15) "Accept-Encoding"
461 string(10) "text/plain"
462 ["X-Original-Transfer-Encoding"]=>
467 GET /cgi-bin/chunked.sh HTTP/1.1