11 use http\Message as HttpMessage;
13 $m = new HttpMessage();
17 $m->getType()==HttpMessage::TYPE_NONE,
21 $m = new HttpMessage("GET / HTTP/1.1\r\n");
25 $m->getType()==HttpMessage::TYPE_REQUEST,
26 $m->getRequestMethod(),
31 $m = new HttpMessage("HTTP/1.1 200 Okidoki\r\n");
35 $m->getType()==HttpMessage::TYPE_RESPONSE,
36 $m->getResponseCode(),
37 $m->getResponseStatus(),
41 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty.txt"));
45 $m->getType()==HttpMessage::TYPE_RESPONSE,
46 $m->getResponseCode(),
47 $m->getResponseStatus(),
50 echo $m->getParentMessage();
52 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty_gzip.txt"));
56 $m->getType()==HttpMessage::TYPE_RESPONSE,
57 $m->getResponseCode(),
58 $m->getResponseStatus(),
61 echo $m->getParentMessage();
63 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_empty_chunked.txt"));
67 $m->getType()==HttpMessage::TYPE_RESPONSE,
68 $m->getResponseCode(),
69 $m->getResponseStatus(),
72 echo $m->getParentMessage();
74 $m = new HttpMessage(file_get_contents(__DIR__."/data/message_rr_helloworld_chunked.txt"));
78 $m->getType()==HttpMessage::TYPE_RESPONSE,
79 $m->getResponseCode(),
80 $m->getResponseStatus(),
83 echo $m->getParentMessage();
107 Date: Wed, 25 Aug 2010 12:11:44 GMT
108 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
109 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
110 Etag: "2002a-0-48549d615a35c"
113 Vary: Accept-Encoding
115 Content-Type: text/plain
116 X-Original-Content-Length: 0
123 string(29) "Wed, 25 Aug 2010 12:11:44 GMT"
125 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
127 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
129 string(23) ""2002a-0-48549d615a35c""
135 string(15) "Accept-Encoding"
139 string(10) "text/plain"
140 ["X-Original-Content-Length"]=>
143 GET /default/empty.txt HTTP/1.1
148 Date: Thu, 26 Aug 2010 09:55:09 GMT
149 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
150 Last-Modified: Wed, 28 Apr 2010 10:54:37 GMT
151 Etag: "2002a-0-48549d615a35c"
153 Vary: Accept-Encoding
156 Content-Type: text/plain
157 X-Original-Content-Length: 20
158 X-Original-Content-Encoding: gzip
165 string(29) "Thu, 26 Aug 2010 09:55:09 GMT"
167 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
169 string(29) "Wed, 28 Apr 2010 10:54:37 GMT"
171 string(23) ""2002a-0-48549d615a35c""
175 string(15) "Accept-Encoding"
181 string(10) "text/plain"
182 ["X-Original-Content-Length"]=>
184 ["X-Original-Content-Encoding"]=>
187 GET /default/empty.txt HTTP/1.1
189 Accept-Encoding: gzip
193 Date: Thu, 26 Aug 2010 11:41:02 GMT
194 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
195 X-Powered-By: PHP/5.3.3
196 Vary: Accept-Encoding
198 Content-Type: text/html
199 X-Original-Transfer-Encoding: chunked
207 string(29) "Thu, 26 Aug 2010 11:41:02 GMT"
209 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
211 string(9) "PHP/5.3.3"
213 string(15) "Accept-Encoding"
217 string(9) "text/html"
218 ["X-Original-Transfer-Encoding"]=>
223 GET /default/empty.php HTTP/1.1
228 Date: Thu, 26 Aug 2010 12:51:28 GMT
229 Server: Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6
230 Vary: Accept-Encoding
232 Content-Type: text/plain
233 X-Original-Transfer-Encoding: chunked
244 string(29) "Thu, 26 Aug 2010 12:51:28 GMT"
246 string(68) "Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/1.0.0a mod_fastcgi/2.4.6"
248 string(15) "Accept-Encoding"
252 string(10) "text/plain"
253 ["X-Original-Transfer-Encoding"]=>
258 GET /cgi-bin/chunked.sh HTTP/1.1