3 <title>Function Summary of ext/http
</title>
7 font-family: sans-serif;
34 border:
1px solid #ccc;
71 <body><h1 id=
"http_functions.c">http_functions.c
</h1>
72 <h2 id=
"http_date">string http_date([int timestamp])
</h2>
73 <p>Compose a valid HTTP date regarding RFC
822/
1123<br />
74 looking like:
"Wed, 22 Dec 2004 11:34:47 GMT"</p>
75 <p>Accepts an optional unix timestamp as parameter.
</p>
76 <p>Returns the HTTP date as string.
</p>
77 <h2 id=
"http_build_url">string http_build_url(mixed url[, mixed parts[, int flags = HTTP_URL_REPLACE[, array &new_url]]])
</h2>
78 <p>Returns the new URL as string on success or FALSE on failure.
</p>
79 <h2 id=
"http_negotiate_language">string http_negotiate_language(array supported[, array &result])
</h2>
80 <p>This function negotiates the clients preferred language based on its
<br />
81 Accept-Language HTTP header. The qualifier is recognized and languages
<br />
82 without qualifier are rated highest. The qualifier will be decreased by
<br />
83 10% for partial matches (i.e. matching primary language).
</p>
84 <p>Expects an array as parameter cotaining the supported languages as values.
<br />
85 If the optional second parameter is supplied, it will be filled with an
<br />
86 array containing the negotiation results.
</p>
87 <p>Returns the negotiated language or the default language (i.e. first array entry)
<br />
89 <p>Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
90 <span style=
"color: #0000BB"><?php
<br />$langs
</span><span style=
"color: #007700">=
array(
<br /> </span><span style=
"color: #DD0000">'en-US'
</span><span style=
"color: #007700">,
</span><span style=
"color: #FF8000">//
default
<br /> </span><span style=
"color: #DD0000">'fr'
</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'fr-FR'
</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'de'
</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'de-DE'
</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'de-AT'
</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'de-CH'
</span><span style=
"color: #007700">,
<br />);
<br /><br />include
</span><span style=
"color: #DD0000">'./langs/'
</span><span style=
"color: #007700">.
</span><span style=
"color: #0000BB">http_negotiate_language
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">$langs
</span><span style=
"color: #007700">,
</span><span style=
"color: #0000BB">$result
</span><span style=
"color: #007700">)
.
</span><span style=
"color: #DD0000">'.php'
</span><span style=
"color: #007700">;
<br /><br /></span><span style=
"color: #0000BB">print_r
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">$result
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">?
></span><br />
91 </span></code></blockquote></p>
93 <h2 id=
"http_negotiate_charset">string http_negotiate_charset(array supported[, array &result])
</h2>
94 <p>This function negotiates the clients preferred charset based on its
<br />
95 Accept-Charset HTTP header. The qualifier is recognized and charsets
<br />
96 without qualifier are rated highest.
</p>
97 <p>Expects an array as parameter cotaining the supported charsets as values.
<br />
98 If the optional second parameter is supplied, it will be filled with an
<br />
99 array containing the negotiation results.
</p>
100 <p>Returns the negotiated charset or the default charset (i.e. first array entry)
<br />
102 <p>Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
103 <span style=
"color: #0000BB"><?php
<br />$charsets
</span><span style=
"color: #007700">=
array(
<br /> </span><span style=
"color: #DD0000">'iso-
8859-
1'
</span><span style=
"color: #007700">,
</span><span style=
"color: #FF8000">//
default
<br /> </span><span style=
"color: #DD0000">'iso-
8859-
2'
</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'iso-
8859-
15'
</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'utf-
8'
<br /></span><span style=
"color: #007700">);
<br /><br /></span><span style=
"color: #0000BB">$pref
</span><span style=
"color: #007700">=
</span><span style=
"color: #0000BB">http_negotiate_charset
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">$charsets
</span><span style=
"color: #007700">,
</span><span style=
"color: #0000BB">$result
</span><span style=
"color: #007700">);
<br /><br />if
(
</span><span style=
"color: #0000BB">strcmp
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">$pref
</span><span style=
"color: #007700">,
</span><span style=
"color: #DD0000">'iso-
8859-
1'
</span><span style=
"color: #007700">))
{
<br /> </span><span style=
"color: #0000BB">iconv_set_encoding
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'internal_encoding'
</span><span style=
"color: #007700">,
</span><span style=
"color: #DD0000">'iso-
8859-
1'
</span><span style=
"color: #007700">);
<br /> </span><span style=
"color: #0000BB">iconv_set_encoding
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'output_encoding'
</span><span style=
"color: #007700">,
</span><span style=
"color: #0000BB">$pref
</span><span style=
"color: #007700">);
<br /> </span><span style=
"color: #0000BB">ob_start
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'ob_iconv_handler'
</span><span style=
"color: #007700">);
<br />}
<br /><br /></span><span style=
"color: #0000BB">print_r
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">$result
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">?
></span><br />
104 </span></code></blockquote></p>
106 <h2 id=
"http_negotiate_content_type">string http_negotiate_ctype(array supported[, array &result])
</h2>
107 <p>This function negotiates the clients preferred content type based on its
<br />
108 Accept HTTP header. The qualifier is recognized and content types
<br />
109 without qualifier are rated highest.
</p>
110 <p>Expects an array as parameter cotaining the supported content types as values.
<br />
111 If the optional second parameter is supplied, it will be filled with an
<br />
112 array containing the negotiation results.
</p>
113 <p>Returns the negotiated content type or the default content type
<br />
114 (i.e. first array entry) if none match.
</p>
115 <p>Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
116 <span style=
"color: #0000BB"><?php
<br />$ctypes
</span><span style=
"color: #007700">=
array(
</span><span style=
"color: #DD0000">'application/xhtml+xml'
</span><span style=
"color: #007700">,
</span><span style=
"color: #DD0000">'text/html'
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">http_send_content_type
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">http_negotiate_content_type
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">$ctypes
</span><span style=
"color: #007700">));
<br /></span><span style=
"color: #0000BB">?
></span><br />
117 </span></code></blockquote></p>
119 <h2 id=
"http_send_status">bool http_send_status(int status)
</h2>
120 <p>Send HTTP status code.
</p>
121 <p>Expects an HTTP status code as parameter.
</p>
122 <p>Returns TRUE on success or FALSE on failure.
</p>
123 <h2 id=
"http_send_last_modified">bool http_send_last_modified([int timestamp])
</h2>
124 <p>Send a
"Last-Modified" header with a valid HTTP date.
</p>
125 <p>Accepts a unix timestamp, converts it to a valid HTTP date and
<br />
126 sends it as
"Last-Modified" HTTP header. If timestamp is
<br />
127 omitted, the current time will be sent.
</p>
128 <p>Returns TRUE on success or FALSE on failure.
</p>
129 <h2 id=
"http_send_content_type">bool http_send_content_type([string content_type = 'application/x-octetstream'])
</h2>
130 <p>Send the Content-Type of the sent entity. This is particularly important
<br />
131 if you use the http_send() API.
</p>
132 <p>Accepts an optional string parameter containing the desired content type
<br />
133 (primary/secondary).
</p>
134 <p>Returns TRUE on success or FALSE on failure.
</p>
135 <h2 id=
"http_send_content_disposition">bool http_send_content_disposition(string filename[, bool inline = false])
</h2>
136 <p>Send the Content-Disposition. The Content-Disposition header is very useful
<br />
137 if the data actually sent came from a file or something similar, that should
<br />
138 be
"saved" by the client/user (i.e. by browsers
"Save as..." popup window).
</p>
139 <p>Expects a string parameter specifying the file name the
"Save as..." dialogue
<br />
140 should display. Optionally accepts a bool parameter, which, if set to true
<br />
141 and the user agent knows how to handle the content type, will probably not
<br />
142 cause the popup window to be shown.
</p>
143 <p>Returns TRUE on success or FALSE on failure.
</p>
144 <h2 id=
"http_match_modified">bool http_match_modified([int timestamp[, bool for_range = false]])
</h2>
145 <p>Matches the given unix timestamp against the clients
"If-Modified-Since" <br />
146 resp.
"If-Unmodified-Since" HTTP headers.
</p>
147 <p>Accepts a unix timestamp which should be matched. Optionally accepts an
<br />
148 additional bool parameter, which if set to true will check the header
<br />
149 usually used to validate HTTP ranges. If timestamp is omitted, the
<br />
150 current time will be used.
</p>
151 <p>Returns TRUE if timestamp represents an earlier date than the header,
<br />
153 <h2 id=
"http_match_etag">bool http_match_etag(string etag[, bool for_range = false])
</h2>
154 <p>Matches the given ETag against the clients
"If-Match" resp.
<br />
155 "If-None-Match" HTTP headers.
</p>
156 <p>Expects a string parameter containing the ETag to compare. Optionally
<br />
157 accepts a bool parameter, which, if set to true, will check the header
<br />
158 usually used to validate HTTP ranges.
</p>
159 <p>Retuns TRUE if ETag matches or the header contained the asterisk (
"*"),
<br />
161 <h2 id=
"http_cache_last_modified">bool http_cache_last_modified([int timestamp_or_expires]])
</h2>
162 <p>Attempts to cache the sent entity by its last modification date.
</p>
163 <p>Accepts a unix timestamp as parameter which is handled as follows:
</p>
164 <p>If timestamp_or_expires is greater than
0, it is handled as timestamp
<br />
165 and will be sent as date of last modification. If it is
0 or omitted,
<br />
166 the current time will be sent as Last-Modified date. If it's negative,
<br />
167 it is handled as expiration time in seconds, which means that if the
<br />
168 requested last modification date is not between the calculated timespan,
<br />
169 the Last-Modified header is updated and the actual body will be sent.
</p>
170 <p>Returns FALSE on failure, or *exits* with
"304 Not Modified" if the entity is cached.
</p>
171 <p>A log entry will be written to the cache log if the INI entry
<br />
172 http.cache_log is set and the cache attempt was successful.
</p>
173 <h2 id=
"http_cache_etag">bool http_cache_etag([string etag])
</h2>
174 <p>Attempts to cache the sent entity by its ETag, either supplied or generated
<br />
175 by the hash algorythm specified by the INI setting
"http.etag_mode".
</p>
176 <p>If the clients
"If-None-Match" header matches the supplied/calculated
<br />
177 ETag, the body is considered cached on the clients side and
<br />
178 a
"304 Not Modified" status code is issued.
</p>
179 <p>Returns FALSE on failure, or *exits* with
"304 Not Modified" if the entity is cached.
</p>
180 <p>A log entry is written to the cache log if the INI entry
<br />
181 "http.cache_log" is set and the cache attempt was successful.
</p>
182 <h2 id=
"ob_etaghandler">string ob_etaghandler(string data, int mode)
</h2>
183 <p>For use with ob_start(). Output buffer handler generating an ETag with
<br />
184 the hash algorythm specified with the INI setting
"http.etag_mode".
</p>
185 <h2 id=
"http_throttle">void http_throttle(double sec[, int bytes =
40960])
</h2>
186 <p>Sets the throttle delay and send buffer size for use with http_send() API.
<br />
187 Provides a basic throttling mechanism, which will yield the current process
<br />
188 resp. thread until the entity has been completely sent, though.
</p>
189 <p>Expects a double parameter specifying the seconds too sleep() after
<br />
190 each chunk sent. Additionally accepts an optional int parameter
<br />
191 representing the chunk size in bytes.
</p>
192 <p>Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
193 <span style=
"color: #0000BB"><?php
<br /></span><span style=
"color: #FF8000">//
~
20 kbyte/s
<br />#
http_throttle(
1,
20000);
<br />#
http_throttle(
0.5,
10000);
<br />#
http_throttle(
0.1,
2000);
<br /></span><span style=
"color: #0000BB">http_send_file
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'document.pdf'
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">?
></span><br />
194 </span></code></blockquote></p>
196 <h2 id=
"http_redirect">void http_redirect([string url[, array params[, bool session = false[, int status =
302]]]])
</h2>
197 <p>Redirect to the given url.
<br />
199 The supplied url will be expanded with http_build_url(), the params array will
<br />
200 be treated with http_build_query() and the session identification will be appended
<br />
201 if session is true.
</p>
202 <p>The HTTP response code will be set according to status.
<br />
203 You can use one of the following constants for convenience:
<br />
204 - HTTP_REDIRECT
302 Found for GET/HEAD, else
303 See Other
<br />
205 - HTTP_REDIRECT_PERM
301 Moved Permanently
<br />
206 - HTTP_REDIRECT_FOUND
302 Found
<br />
207 - HTTP_REDIRECT_POST
303 See Other
<br />
208 - HTTP_REDIRECT_PROXY
305 Use Proxy
<br />
209 - HTTP_REDIRECT_TEMP
307 Temporary Redirect
</p>
210 <p>Please see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3
<br />
211 for which redirect response code to use in which situation.
</p>
212 <p>To be RFC compliant,
"Redirecting to <a>URL</a>." will be displayed,
<br />
213 if the client doesn't redirect immediatly, and the request method was
<br />
214 another one than HEAD.
</p>
215 <p>Returns FALSE on failure, or *exits* on success.
</p>
216 <p>A log entry will be written to the redirect log, if the INI entry
<br />
217 "http.redirect_log" is set and the redirect attempt was successful.
</p>
218 <h2 id=
"http_send_data">bool http_send_data(string data)
</h2>
219 <p>Sends raw data with support for (multiple) range requests.
</p>
220 <p>Retursn TRUE on success, or FALSE on failure.
</p>
221 <h2 id=
"http_send_file">bool http_send_file(string file)
</h2>
222 <p>Sends a file with support for (multiple) range requests.
</p>
223 <p>Expects a string parameter referencing the file to send.
</p>
224 <p>Returns TRUE on success, or FALSE on failure.
</p>
225 <h2 id=
"http_send_stream">bool http_send_stream(resource stream)
</h2>
226 <p>Sends an already opened stream with support for (multiple) range requests.
</p>
227 <p>Expects a resource parameter referncing the stream to read from.
</p>
228 <p>Returns TRUE on success, or FALSE on failure.
</p>
229 <h2 id=
"http_chunked_decode">string http_chunked_decode(string encoded)
</h2>
230 <p>Decodes a string that was HTTP-chunked encoded.
</p>
231 <p>Expects a chunked encoded string as parameter.
</p>
232 <p>Returns the decoded string on success or FALSE on failure.
</p>
233 <h2 id=
"http_parse_message">object http_parse_message(string message)
</h2>
234 <p>Parses (a) http_message(s) into a simple recursive object structure.
</p>
235 <p>Expects a string parameter containing a single HTTP message or
<br />
236 several consecutive HTTP messages.
</p>
237 <p>Returns an hierachical object structure of the parsed messages.
</p>
238 <p>Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
239 <span style=
"color: #0000BB"><?php
<br />print_r
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">http_parse_message
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">http_get
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">URL
</span><span style=
"color: #007700">,
array(
</span><span style=
"color: #DD0000">'redirect'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">3</span><span style=
"color: #007700">)));
<br /><br /></span><span style=
"color: #0000BB">stdClass
object
<br /></span><span style=
"color: #007700">(
<br /> [
</span><span style=
"color: #0000BB">type
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">2<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">httpVersion
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">1.1<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">responseCode
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">200<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">headers
</span><span style=
"color: #007700">]
=
> Array
<br /> (
<br /> [
</span><span style=
"color: #0000BB">Content
</span><span style=
"color: #007700">-
</span><span style=
"color: #0000BB">Length
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">3<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">Server
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">Apache
<br /> </span><span style=
"color: #007700">)
<br /> [
</span><span style=
"color: #0000BB">body
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">Hi
</span><span style=
"color: #007700">!
<br /> [
</span><span style=
"color: #0000BB">parentMessage
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">stdClass
object
<br /> </span><span style=
"color: #007700">(
<br /> [
</span><span style=
"color: #0000BB">type
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">2<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">httpVersion
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">1.1<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">responseCode
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">302<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">headers
</span><span style=
"color: #007700">]
=
> Array
<br /> (
<br /> [
</span><span style=
"color: #0000BB">Content
</span><span style=
"color: #007700">-
</span><span style=
"color: #0000BB">Length
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">0<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">Location
</span><span style=
"color: #007700">]
=
> ...
<br /> )
<br /> [
</span><span style=
"color: #0000BB">body
</span><span style=
"color: #007700">]
=
> <br /> [
</span><span style=
"color: #0000BB">parentMessage
</span><span style=
"color: #007700">]
=
> ...
<br /> )
<br />)
<br /></span><span style=
"color: #0000BB">?
></span><br />
240 </span></code></blockquote></p>
242 <h2 id=
"http_parse_headers">array http_parse_headers(string header)
</h2>
243 <p>Parses HTTP headers into an associative array.
</p>
244 <p>Expects a string parameter containing HTTP headers.
</p>
245 <p>Returns an array on success, or FALSE on failure.
</p>
246 <p>Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
247 <span style=
"color: #0000BB"><?php
<br />$headers
</span><span style=
"color: #007700">=
</span><span style=
"color: #DD0000">"content-type: text/html; charset=UTF-8\r\n"</span><span style=
"color: #007700">.
<br /> </span><span style=
"color: #DD0000">"Server: Funky/1.0\r\n"</span><span style=
"color: #007700">.
<br /> </span><span style=
"color: #DD0000">"Set-Cookie: foo=bar\r\n"</span><span style=
"color: #007700">.
<br /> </span><span style=
"color: #DD0000">"Set-Cookie: baz=quux\r\n"</span><span style=
"color: #007700">.
<br /> </span><span style=
"color: #DD0000">"Folded: works\r\n\ttoo\r\n"</span><span style=
"color: #007700">;
<br /></span><span style=
"color: #0000BB">print_r
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">http_parse_headers
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">$headers
</span><span style=
"color: #007700">));
<br /><br />Array
<br />(
<br /> [
</span><span style=
"color: #0000BB">Content
</span><span style=
"color: #007700">-
</span><span style=
"color: #0000BB">Type
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">text
</span><span style=
"color: #007700">/
</span><span style=
"color: #0000BB">html
</span><span style=
"color: #007700">;
</span><span style=
"color: #0000BB">chatset
</span><span style=
"color: #007700">=
</span><span style=
"color: #0000BB">UTF
</span><span style=
"color: #007700">-
</span><span style=
"color: #0000BB">8<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">Server
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">Funky
</span><span style=
"color: #007700">/
</span><span style=
"color: #0000BB">1.0<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">Set
</span><span style=
"color: #007700">-
</span><span style=
"color: #0000BB">Cookie
</span><span style=
"color: #007700">]
=
> Array
<br /> (
<br /> [
</span><span style=
"color: #0000BB">0</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">foo
</span><span style=
"color: #007700">=
</span><span style=
"color: #0000BB">bar
<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">1</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">baz
</span><span style=
"color: #007700">=
</span><span style=
"color: #0000BB">quux
<br /> </span><span style=
"color: #007700">)
<br /> [
</span><span style=
"color: #0000BB">Folded
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">works
<br /> too
<br /></span><span style=
"color: #007700">)
<br /></span><span style=
"color: #0000BB">?
></span><br />
248 </span></code></blockquote></p>
250 <h2 id=
"http_parse_cookie">object http_parse_cookie(string cookie)
</h2>
251 <p>Parses HTTP cookies like sent in a response into a struct.
</p>
252 <p>Expects a string as parameter containing the value of a Set-Cookie response header.
</p>
253 <p>Returns an stdClass object with the cookie params as properties on success or FALSE on failure.
</p>
254 <p>Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
255 <span style=
"color: #0000BB"><?php
<br />print_r
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">http_parse_cookie
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">"foo=bar; path=/"</span><span style=
"color: #007700">));
<br /><br /></span><span style=
"color: #0000BB">stdClass
Object
<br /></span><span style=
"color: #007700">(
<br /> [
</span><span style=
"color: #0000BB">name
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">foo
<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">value
</span><span style=
"color: #007700">]
=
> </span><span style=
"color: #0000BB">bar
<br /> </span><span style=
"color: #007700">[
</span><span style=
"color: #0000BB">path
</span><span style=
"color: #007700">]
=
> /
<br />)
<br /></span><span style=
"color: #0000BB">?
></span><br />
256 </span></code></blockquote></p>
258 <h2 id=
"http_get_request_headers">array http_get_request_headers(void)
</h2>
259 <p>Get a list of incoming HTTP headers.
</p>
260 <p>Returns an associative array of incoming request headers.
</p>
261 <h2 id=
"http_get_request_body">string http_get_request_body(void)
</h2>
262 <p>Get the raw request body (e.g. POST or PUT data).
</p>
263 <p>This function can not be used after http_get_request_body_stream()
<br />
264 if the request method was another than POST.
</p>
265 <p>Returns the raw request body as string on success or NULL on failure.
</p>
266 <h2 id=
"http_get_request_body_stream">resource http_get_request_body_stream(void)
</h2>
267 <p>Create a stream to read the raw request body (e.g. POST or PUT data).
</p>
268 <p>This function can only be used once if the request method was another than POST.
</p>
269 <p>Returns the raw request body as stream on success or NULL on failure.
</p>
270 <h2 id=
"http_match_request_header">bool http_match_request_header(string header, string value[, bool match_case = false])
</h2>
271 <p>Match an incoming HTTP header.
</p>
272 <p>Expects two string parameters representing the header name (case-insensitive)
<br />
273 and the header value that should be compared. The case sensitivity of the
<br />
274 header value depends on the additional optional bool parameter accepted.
</p>
275 <p>Returns TRUE if header value matches, else FALSE.
</p>
276 <h2 id=
"http_get">string http_get(string url[, array options[, array &info]])
</h2>
277 <p>Performs an HTTP GET request on the supplied url.
</p>
278 <p>The second parameter, if set, is expected to be an associative
<br />
279 array where the following keys will be recognized:
</p><pre> - redirect: int, whether and how many redirects to follow
<br />
280 - unrestrictedauth: bool, whether to continue sending credentials on
<br />
281 redirects to a different host
<br />
282 - proxyhost: string, proxy host in
"host[:port]" format
<br />
283 - proxyport: int, use another proxy port as specified in proxyhost
<br />
284 - proxyauth: string, proxy credentials in
"user:pass" format
<br />
285 - proxyauthtype: int, HTTP_AUTH_BASIC and/or HTTP_AUTH_NTLM
<br />
286 - httpauth: string, http credentials in
"user:pass" format
<br />
287 - httpauthtype: int, HTTP_AUTH_BASIC, DIGEST and/or NTLM
<br />
288 - compress: bool, whether to allow gzip/deflate content encoding
<br />
289 (defaults to true)
<br />
290 - port: int, use another port as specified in the url
<br />
291 - referer: string, the referer to send
<br />
292 - useragent: string, the user agent to send
<br />
293 (defaults to PECL::HTTP/version (PHP/version)))
<br />
294 - headers: array, list of custom headers as associative array
<br />
295 like array(
"header" =
> "value")
<br />
296 - cookies: array, list of cookies as associative array
<br />
297 like array(
"cookie" =
> "value")
<br />
298 - cookiestore: string, path to a file where cookies are/will be stored
<br />
299 - resume: int, byte offset to start the download from;
<br />
300 if the server supports ranges
<br />
301 - maxfilesize: int, maximum file size that should be downloaded;
<br />
302 has no effect, if the size of the requested entity is not known
<br />
303 - lastmodified: int, timestamp for If-(Un)Modified-Since header
<br />
304 - timeout: int, seconds the request may take
<br />
305 - connecttimeout: int, seconds the connect may take
<br />
306 - onprogress: mixed, progress callback
<br />
308 <p>The optional third parameter will be filled with some additional information
<br />
309 in form af an associative array, if supplied, like the following example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
310 <span style=
"color: #0000BB"><?php
<br /></span><span style=
"color: #007700">array
(
<br /> </span><span style=
"color: #DD0000">'effective_url'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #DD0000">'http://localhost'
</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'response_code'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">403</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'total_time'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0.017</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'namelookup_time'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0.013</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'connect_time'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0.014</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'pretransfer_time'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0.014</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'size_upload'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'size_download'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">202</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'speed_download'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">11882</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'speed_upload'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'header_size'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">145</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'request_size'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">62</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'ssl_verifyresult'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'filetime'
</span><span style=
"color: #007700">=
> -
</span><span style=
"color: #0000BB">1</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'content_length_download'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">202</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'content_length_upload'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'starttransfer_time'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0.017</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'content_type'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #DD0000">'text/html;
charset=iso-
8859-
1'
</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'redirect_time'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'redirect_count'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'http_connectcode'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'httpauth_avail'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #DD0000">'proxyauth_avail'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">0</span><span style=
"color: #007700">,
<br />)
<br /></span><span style=
"color: #0000BB">?
></span><br />
311 </span></code></blockquote></p>
313 <p>Returns the HTTP response(s) as string on success, or FALSE on failure.
</p>
314 <h2 id=
"http_head">string http_head(string url[, array options[, array &info]])
</h2>
315 <p>Performs an HTTP HEAD request on the supplied url.
</p>
316 <p>See http_get() for a full list of available parameters and options.
</p>
317 <p>Returns the HTTP response as string on success, or FALSE on failure.
</p>
318 <h2 id=
"http_post_data">string http_post_data(string url, string data[, array options[, array &info]])
</h2>
319 <p>Performs an HTTP POST requeston the supplied url.
</p>
320 <p>Expects a string as second parameter containing the pre-encoded post data.
<br />
321 See http_get() for a full list of available parameters and options.
<br />
323 Returns the HTTP response(s) as string on success, or FALSE on failure.
</p>
324 <h2 id=
"http_post_fields">string http_post_fields(string url, array data[, array files[, array options[, array &info]]])
</h2>
325 <p>Performs an HTTP POST request on the supplied url.
</p>
326 <p>Expecrs an associative array as second parameter, which will be
<br />
327 www-form-urlencoded. See http_get() for a full list of available options.
</p>
328 <p>Returns the HTTP response(s) as string on success, or FALSE on failure.
</p>
329 <h2 id=
"http_put_file">string http_put_file(string url, string file[, array options[, array &info]])
</h2>
330 <p>Performs an HTTP PUT request on the supplied url.
</p>
331 <p>Expects the second parameter to be a string referncing the file to upload.
<br />
332 See http_get() for a full list of available options.
</p>
333 <p>Returns the HTTP response(s) as string on success, or FALSE on failure.
</p>
334 <h2 id=
"http_put_stream">string http_put_stream(string url, resource stream[, array options[, array &info]])
</h2>
335 <p>Performs an HTTP PUT request on the supplied url.
</p>
336 <p>Expects the second parameter to be a resource referencing an already
<br />
337 opened stream, from which the data to upload should be read.
<br />
338 See http_get() for a full list of available options.
</p>
339 <p>Returns the HTTP response(s) as string on success. or FALSE on failure.
</p>
340 <h2 id=
"http_request_method_register">int http_request_method_register(string method)
</h2>
341 <p>Register a custom request method.
</p>
342 <p>Expects a string parameter containing the request method name to register.
</p>
343 <p>Returns the ID of the request method on success, or FALSE on failure.
</p>
344 <h2 id=
"http_request_method_unregister">bool http_request_method_unregister(mixed method)
</h2>
345 <p>Unregister a previously registered custom request method.
</p>
346 <p>Expects either the request method name or ID.
</p>
347 <p>Returns TRUE on success, or FALSE on failure.
</p>
348 <h2 id=
"http_request_method_exists">int http_request_method_exists(mixed method)
</h2>
349 <p>Check if a request method is registered (or available by default).
</p>
350 <p>Expects either the request method name or ID as parameter.
</p>
351 <p>Returns TRUE if the request method is known, else FALSE.
</p>
352 <h2 id=
"http_request_method_name">string http_request_method_name(int method)
</h2>
353 <p>Get the literal string representation of a standard or registered request method.
</p>
354 <p>Expects the request method ID as parameter.
</p>
355 <p>Returns the request method name as string on success, or FALSE on failure.
</p>
356 <h2 id=
"http_build_query">string http_build_query(mixed formdata [, string prefix[, string arg_separator]])
</h2>
357 <p>Generates a form-encoded query string from an associative array or object.
</p>
358 <h2 id=
"http_deflate">string http_deflate(string data[, int flags =
0])
</h2>
359 <p>Compress data with gzip, zlib AKA deflate or raw deflate encoding.
</p>
360 <p>Expects the first parameter to be a string containing the data that should
<br />
362 <p>Returns the encoded string on success, or NULL on failure.
</p>
363 <h2 id=
"http_inflate">string http_inflate(string data)
</h2>
364 <p>Uncompress data compressed with either gzip, deflate AKA zlib or raw
<br />
365 deflate encoding.
</p>
366 <p>Expects a string as parameter containing the compressed data.
</p>
367 <p>Returns the decoded string on success, or NULL on failure.
</p>
368 <h2 id=
"ob_deflatehandler">string ob_deflatehandler(string data, int mode)
</h2>
369 <p>For use with ob_start(). The deflate output buffer handler can only be used once.
<br />
370 It conflicts with ob_gzhanlder and zlib.output_compression as well and should
<br />
371 not be used after ext/mbstrings mb_output_handler and ext/sessions URL-Rewriter (AKA
<br />
372 session.use_trans_sid).
</p>
373 <h2 id=
"ob_inflatehandler">string ob_inflatehandler(string data, int mode)
</h2>
374 <p>For use with ob_start(). Same restrictions as with ob_deflatehandler apply.
</p>
375 <h2 id=
"http_support">int http_support([int feature =
0])
</h2>
376 <p>Check for feature that require external libraries.
</p>
377 <p>Accpepts an optional in parameter specifying which feature to probe for.
<br />
378 If the parameter is
0 or omitted, the return value contains a bitmask of
<br />
379 all supported features that depend on external libraries.
</p>
380 <p>Available features to probe for are:
<br />
382 <li> HTTP_SUPPORT: always set
<br />
383 <li> HTTP_SUPPORT_REQUESTS: whether ext/http was linked against libcurl,
<br />
384 and HTTP requests can be issued
<br />
385 <li> HTTP_SUPPORT_SSLREQUESTS: whether libcurl was linked against openssl,
<br />
386 and SSL requests can be issued
<br />
387 <li> HTTP_SUPPORT_ENCODINGS: whether ext/http was linked against zlib,
<br />
388 and compressed HTTP responses can be decoded
<br />
389 <li> HTTP_SUPPORT_MAGICMIME: whether ext/http was linked against libmagic,
<br />
390 and the HttpResponse::guessContentType() method is usable
<br />
392 <p>Returns int, whether requested feature is supported, or a bitmask with
<br />
393 all supported features.
</p>
395 <h1 id=
"http_deflatestream_object.c">http_deflatestream_object.c
</h1>
396 <h2 id=
"HttpDeflateStream" class=
"o">HttpDeflateStream
</h2>
397 <h3 id=
"HttpDeflateStream___construct">void HttpDeflateStream::__construct([int flags =
0])
</h3>
398 <p>Creates a new HttpDeflateStream object instance.
</p>
399 <p>Accepts an optional int parameter specifying how to initialize the deflate stream.
</p>
400 <h3 id=
"HttpDeflateStream_update">string HttpDeflateStream::update(string data)
</h3>
401 <p>Passes more data through the deflate stream.
</p>
402 <p>Expects a string parameter containing (a part of) the data to deflate.
</p>
403 <p>Returns deflated data on success or FALSE on failure.
</p>
404 <h3 id=
"HttpDeflateStream_flush">string HttpDeflateStream::flush([string data])
</h3>
405 <p>Flushes the deflate stream.
</p>
406 <p>Returns some deflated data as string on success or FALSE on failure.
</p>
407 <h3 id=
"HttpDeflateStream_finish">string HttpDeflateStream::finish([string data])
</h3>
408 <p>Finalizes the deflate stream. The deflate stream can be reused after finalizing.
</p>
409 <p>Returns the final part of deflated data.
</p>
411 <h1 id=
"http_inflatestream_object.c">http_inflatestream_object.c
</h1>
412 <h2 id=
"HttpInflateStream" class=
"o">HttpInflateStream
</h2>
413 <h3 id=
"HttpInflateStream_update">string HttpInflateStream::update(string data)
</h3>
414 <p>Passes more data through the inflate stream.
</p>
415 <p>Expects a string parameter containing (a part of) the data to inflate.
</p>
416 <p>Returns inflated data on success or FALSE on failure.
</p>
417 <h3 id=
"HttpInflateStream_flush">string HttpInflateStream::flush([string data])
</h3>
418 <p>Flush the inflate stream.
</p>
419 <p>Returns some inflated data as string on success or FALSE on failure.
</p>
420 <h3 id=
"HttpInflateStream_finish">string HttpInflateStream::finish([string data])
</h3>
421 <p>Finalizes the inflate stream. The inflate stream can be reused after finalizing.
</p>
422 <p>Returns the final part of inflated data.
</p>
424 <h1 id=
"http_message_object.c">http_message_object.c
</h1>
425 <h2 id=
"HttpMessage" class=
"o">HttpMessage
</h2>
426 <h3 id=
"HttpMessage___construct">void HttpMessage::__construct([string message])
</h3>
427 <p>Instantiate a new HttpMessage object.
</p>
428 <p>Accepts an optional string parameter containing a single or several
<br />
429 consecutive HTTP messages. The constructed object will actually
<br />
430 represent the *last* message of the passed string. If there were
<br />
431 prior messages, those can be accessed by HttpMessage::getParentMessage().
</p>
432 <p>Throws HttpMalformedHeaderException.
</p>
433 <h3 id=
"HttpMessage_fromString">static HttpMessage HttpMessage::fromString(string raw_message[, string class_name =
"HttpMessage"])
</h3>
434 <p>Create an HttpMessage object from a string. Kind of a static constructor.
</p>
435 <p>Expects a string parameter containing a sinlge or several consecutive
<br />
436 HTTP messages. Accepts an optionsl string parameter specifying the class to use.
</p>
437 <p>Returns an HttpMessage object on success or NULL on failure.
</p>
438 <p>Throws HttpMalformedHeadersException.
</p>
439 <h3 id=
"HttpMessage_getBody">string HttpMessage::getBody()
</h3>
440 <p>Get the body of the parsed HttpMessage.
</p>
441 <p>Returns the message body as string.
</p>
442 <h3 id=
"HttpMessage_setBody">void HttpMessage::setBody(string body)
</h3>
443 <p>Set the body of the HttpMessage.
<br />
444 NOTE: Don't forget to update any headers accordingly.
</p>
445 <p>Expects a string parameter containing the new body of the message.
</p>
446 <h3 id=
"HttpMessage_getHeaders">array HttpMessage::getHeaders()
</h3>
447 <p>Get Message Headers.
</p>
448 <p>Returns an associative array containing the messages HTTP headers.
</p>
449 <h3 id=
"HttpMessage_setHeaders">void HttpMessage::setHeaders(array headers)
</h3>
450 <p>Sets new headers.
</p>
451 <p>Expects an associative array as parameter containing the new HTTP headers,
<br />
452 which will replace *all* previous HTTP headers of the message.
</p>
453 <h3 id=
"HttpMessage_addHeaders">void HttpMessage::addHeaders(array headers[, bool append = false])
</h3>
454 <p>Add headers. If append is true, headers with the same name will be separated, else overwritten.
</p>
455 <p>Expects an associative array as parameter containing the additional HTTP headers
<br />
456 to add to the messages existing headers. If the optional bool parameter is true,
<br />
457 and a header with the same name of one to add exists already, this respective
<br />
458 header will be converted to an array containing both header values, otherwise
<br />
459 it will be overwritten with the new header value.
</p>
460 <h3 id=
"HttpMessage_getType">int HttpMessage::getType()
</h3>
461 <p>Get Message Type. (HTTP_MSG_NONE|HTTP_MSG_REQUEST|HTTP_MSG_RESPONSE)
</p>
462 <p>Returns the HttpMessage::TYPE.
</p>
463 <h3 id=
"HttpMessage_setType">void HttpMessage::setType(int type)
</h3>
464 <p>Set Message Type. (HTTP_MSG_NONE|HTTP_MSG_REQUEST|HTTP_MSG_RESPONSE)
</p>
465 <p>Exptects an int parameter, the HttpMessage::TYPE.
</p>
466 <h3 id=
"HttpMessage_getResponseCode">int HttpMessage::getResponseCode()
</h3>
467 <p>Get the Response Code of the Message.
</p>
468 <p>Returns the HTTP response code if the message is of type
<br />
469 HttpMessage::TYPE_RESPONSE, else FALSE.
</p>
470 <h3 id=
"HttpMessage_setResponseCode">bool HttpMessage::setResponseCode(int code)
</h3>
471 <p>Set the response code of an HTTP Response Message.
</p>
472 <p>Expects an int parameter with the HTTP response code.
</p>
473 <p>Returns TRUE on success, or FALSE if the message is not of type
<br />
474 HttpMessage::TYPE_RESPONSE or the response code is out of range (
100-
510).
</p>
475 <h3 id=
"HttpMessage_getRequestMethod">string HttpMessage::getRequestMethod()
</h3>
476 <p>Get the Request Method of the Message.
</p>
477 <p>Returns the request method name on success, or FALSE if the message is
<br />
478 not of type HttpMessage::TYPE_REQUEST.
</p>
479 <h3 id=
"HttpMessage_setRequestMethod">bool HttpMessage::setRequestMethod(string method)
</h3>
480 <p>Set the Request Method of the HTTP Message.
</p>
481 <p>Expects a string parameter containing the request method name.
</p>
482 <p>Returns TRUE on success, or FALSE if the message is not of type
<br />
483 HttpMessage::TYPE_REQUEST or an invalid request method was supplied.
</p>
484 <h3 id=
"HttpMessage_getRequestUrl">string HttpMessage::getRequestUrl()
</h3>
485 <p>Get the Request URL of the Message.
</p>
486 <p>Returns the request url as string on success, or FALSE if the message
<br />
487 is not of type HttpMessage::TYPE_REQUEST.
</p>
488 <h3 id=
"HttpMessage_setRequestUrl">bool HttpMessage::setRequestUrl(string url)
</h3>
489 <p>Set the Request URL of the HTTP Message.
</p>
490 <p>Expects a string parameters containing the request url.
</p>
491 <p>Returns TRUE on success, or FALSE if the message is not of type
<br />
492 HttpMessage::TYPE_REQUEST or supplied URL was empty.
</p>
493 <h3 id=
"HttpMessage_getHttpVersion">string HttpMessage::getHttpVersion()
</h3>
494 <p>Get the HTTP Protocol Version of the Message.
</p>
495 <p>Returns the HTTP protocol version as string.
</p>
496 <h3 id=
"HttpMessage_setHttpVersion">bool HttpMessage::setHttpVersion(string version)
</h3>
497 <p>Set the HTTP Protocol version of the Message.
</p>
498 <p>Expects a string parameter containing the HTTP protocol version.
</p>
499 <p>Returns TRUE on success, or FALSE if supplied version is out of range (
1.0/
1.1).
</p>
500 <h3 id=
"HttpMessage_getParentMessage">HttpMessage HttpMessage::getParentMessage()
</h3>
501 <p>Get parent Message.
</p>
502 <p>Returns the parent HttpMessage on success, or NULL if there's none.
</p>
503 <h3 id=
"HttpMessage_send">bool HttpMessage::send()
</h3>
504 <p>Send the Message according to its type as Response or Request.
<br />
505 This provides limited functionality compared to HttpRequest and HttpResponse.
</p>
506 <p>Returns TRUE on success, or FALSE on failure.
</p>
507 <h3 id=
"HttpMessage_toString">string HttpMessage::toString([bool include_parent = false])
</h3>
508 <p>Get the string representation of the Message.
</p>
509 <p>Accepts a bool parameter which specifies whether the returned string
<br />
510 should also contain any parent messages.
</p>
511 <p>Returns the full message as string.
</p>
512 <h3 id=
"HttpMessage_toMessageTypeObject">HttpRequest|HttpResponse HttpMessage::toMessageTypeObject(void)
</h3>
513 <p>Creates an object regarding to the type of the message.
</p>
514 <p>Returns either an HttpRequest or HttpResponse object on success, or NULL on failure.
</p>
515 <p>Throws HttpRuntimeException, HttpMessageTypeException, HttpHeaderException.
</p>
516 <h3 id=
"HttpMessage_count">int HttpMessage::count()
</h3>
517 <p>Implements Countable.
</p>
518 <p>Returns the number of parent messages +
1.
</p>
519 <h3 id=
"HttpMessage_serialize">string HttpMessage::serialize()
</h3>
520 <p>Implements Serializable.
</p>
521 <p>Returns the serialized representation of the HttpMessage.
</p>
522 <h3 id=
"HttpMessage_unserialize">void HttpMessage::unserialize(string serialized)
</h3>
523 <p>Implements Serializable.
</p>
524 <p>Re-constructs the HttpMessage based upon the serialized string.
</p>
525 <h3 id=
"HttpMessage_detach">HttpMessage HttpMessage::detach(void)
</h3>
526 <p>Returns a clone of an HttpMessage object detached from any parent messages.
</p>
527 <h3 id=
"HttpMessage_prepend">void HttpMessage::prepend(HttpMessage message)
</h3>
528 <p>Prepends message(s) to the HTTP message.
</p>
529 <p>Expects an HttpMessage object as parameter.
</p>
530 <h3 id=
"HttpMessage_rewind">void HttpMessage::rewind(void)
</h3>
531 <p>Implements Iterator.
</p>
532 <h3 id=
"HttpMessage_valid">bool HttpMessage::valid(void)
</h3>
533 <p>Implements Iterator.
</p>
534 <h3 id=
"HttpMessage_next">void HttpMessage::next(void)
</h3>
535 <p>Implements Iterator.
</p>
536 <h3 id=
"HttpMessage_key">int HttpMessage::key(void)
</h3>
537 <p>Implements Iterator.
</p>
538 <h3 id=
"HttpMessage_current">HttpMessage HttpMessage::current(void)
</h3>
539 <p>Implements Iterator.
</p>
541 <h1 id=
"http_querystring_object.c">http_querystring_object.c
</h1>
542 <h2 id=
"HttpQueryString" class=
"o">HttpQueryString
</h2>
543 <h3 id=
"HttpQueryString___construct">void HttpQueryString::__construct([bool global = true[, mixed add])
</h3>
544 <p>Creates a new HttpQueryString object instance.
<br />
545 Operates on and modifies $_GET and $_SERVER['QUERY_STRING'] if global is TRUE.
</p>
546 <h3 id=
"HttpQueryString_toString">string HttpQueryString::toString()
</h3>
547 <p>Returns the string representation.
</p>
548 <h3 id=
"HttpQueryString_toArray">array HttpQueryString::toArray()
</h3>
549 <p>Returns the array representation.
</p>
550 <h3 id=
"HttpQueryString_get">mixed HttpQueryString::get([string key[, mixed type =
0[, mixed defval = NULL[, bool delete = false]]]])
</h3>
551 <p>Get (part of) the query string.
</p>
552 <p>The type parameter is either one of the HttpQueryString::TYPE_* constants or a type abbreviation like
<br />
553 "b" for bool,
"i" for int,
"f" for float,
"s" for string,
"a" for array and
"o" for a stdClass object.
</p>
554 <h3 id=
"HttpQueryString_set">string HttpQueryString::set(mixed params)
</h3>
555 <p>Set query string entry/entries. NULL values will unset the variable.
</p>
556 <h3 id=
"HttpQueryString_getInstance">HttpQueryString HttpQueryString::getInstance([bool global = true])
</h3>
557 <p>Get a single instance (differentiates between the global setting).
</p>
559 <h1 id=
"http_request_object.c">http_request_object.c
</h1>
560 <h2 id=
"HttpRequest" class=
"o">HttpRequest
</h2>
561 <h3 id=
"HttpRequest___construct">void HttpRequest::__construct([string url[, int request_method = HTTP_METH_GET[, array options]]])
</h3>
562 <p>Instantiate a new HttpRequest object.
</p>
563 <p>Accepts a string as optional parameter containing the target request url.
<br />
564 Additianally accepts an optional int parameter specifying the request method
<br />
565 to use and an associative array as optional third parameter which will be
<br />
566 passed to HttpRequest::setOptions().
</p>
567 <p>Throws HttpException.
</p>
568 <h3 id=
"HttpRequest_setOptions">bool HttpRequest::setOptions([array options])
</h3>
569 <p>Set the request options to use. See http_get() for a full list of available options.
</p>
570 <p>Accepts an array as optional parameters, wich values will overwrite the
<br />
571 currently set request options. If the parameter is empty or mitted,
<br />
572 the optoions of the HttpRequest object will be reset.
</p>
573 <p>Returns TRUE on success, or FALSE on failure.
</p>
574 <h3 id=
"HttpRequest_getOptions">array HttpRequest::getOptions()
</h3>
575 <p>Get currently set options.
</p>
576 <p>Returns an associative array containing currently set options.
</p>
577 <h3 id=
"HttpRequest_setSslOptions">bool HttpRequest::setSslOptions([array options])
</h3>
578 <p>Set SSL options.
</p>
579 <p>Accepts an associative array as parameter containing any SSL specific options.
<br />
580 If the parameter is empty or omitted, the SSL options will be reset.
</p>
581 <p>Returns TRUE on success, or FALSE on failure.
</p>
582 <h3 id=
"HttpRequest_addSslOptions">bool HttpRequest::addSslOptions(array options)
</h3>
583 <p>Set additional SSL options.
</p>
584 <p>Expects an associative array as parameter containing additional SSL specific options.
</p>
585 <p>Returns TRUE on success, or FALSE on failure.
</p>
586 <h3 id=
"HttpRequest_getSslOptions">array HttpRequest::getSslOtpions()
</h3>
587 <p>Get previously set SSL options.
</p>
588 <p>Returns an associative array containing any previously set SSL options.
</p>
589 <h3 id=
"HttpRequest_addHeaders">bool HttpRequest::addHeaders(array headers)
</h3>
590 <p>Add request header name/value pairs.
</p>
591 <p>Expects an ssociative array as parameter containing additional header
<br />
592 name/value pairs.
</p>
593 <p>Returns TRUE on success, or FALSE on failure.
</p>
594 <h3 id=
"HttpRequest_setHeaders">bool HttpRequest::setHeaders([array headers])
</h3>
595 <p>Set request header name/value pairs.
</p>
596 <p>Accepts an associative array as parameter containing header name/value pairs.
<br />
597 If the parameter is empty or omitted, all previously set headers will be unset.
</p>
598 <p>Returns TRUE on success, or FALSE on failure.
</p>
599 <h3 id=
"HttpRequest_getHeaders">array HttpRequest::getHeaders()
</h3>
600 <p>Get previously set request headers.
</p>
601 <p>Returns an associative array containing all currently set headers.
</p>
602 <h3 id=
"HttpRequest_setCookies">bool HttpRequest::setCookies([array cookies])
</h3>
604 <p>Accepts an associative array as parameter containing cookie name/value pairs.
<br />
605 If the parameter is empty or omitted, all previously set cookies will be unset.
</p>
606 <p>Returns TRUE on success, or FALSE on failure.
</p>
607 <h3 id=
"HttpRequest_addCookies">bool HttpRequest::addCookies(array cookies)
</h3>
609 <p>Expects an associative array as parameter containing any cookie name/value
<br />
611 <p>Returns TRUE on success, or FALSE on failure.
</p>
612 <h3 id=
"HttpRequest_getCookies">array HttpRequest::getCookies()
</h3>
613 <p>Get previously set cookies.
</p>
614 <p>Returns an associative array containing any previously set cookies.
</p>
615 <h3 id=
"HttpRequest_setUrl">bool HttpRequest::setUrl(string url)
</h3>
616 <p>Set the request URL.
</p>
617 <p>Expects a string as parameter specifying the request url.
</p>
618 <p>Returns TRUE on success, or FALSE on failure.
</p>
619 <h3 id=
"HttpRequest_getUrl">string HttpRequest::getUrl()
</h3>
620 <p>Get the previously set request URL.
</p>
621 <p>Returns the currently set request url as string.
</p>
622 <h3 id=
"HttpRequest_setMethod">bool HttpRequest::setMethod(int request_method)
</h3>
623 <p>Set the request method.
</p>
624 <p>Expects an int as parameter specifying the request method to use.
<br />
625 In PHP
5.1+ HttpRequest::METH_*, otherwise the HTTP_METH_* constants can be used.
</p>
626 <p>Returns TRUE on success, or FALSE on failure.
</p>
627 <h3 id=
"HttpRequest_getMethod">int HttpRequest::getMethod()
</h3>
628 <p>Get the previously set request method.
</p>
629 <p>Returns the currently set request method.
</p>
630 <h3 id=
"HttpRequest_setContentType">bool HttpRequest::setContentType(string content_type)
</h3>
631 <p>Set the content type the post request should have.
</p>
632 <p>Expects a string as parameters containing the content type of the request
<br />
633 (primary/secondary).
</p>
634 <p>Returns TRUE on success, or FALSE if the content type does not seem to
<br />
635 contain a primary and a secondary part.
</p>
636 <h3 id=
"HttpRequest_getContentType">string HttpRequest::getContentType()
</h3>
637 <p>Get the previously content type.
</p>
638 <p>Returns the previously set content type as string.
</p>
639 <h3 id=
"HttpRequest_setQueryData">bool HttpRequest::setQueryData([mixed query_data])
</h3>
640 <p>Set the URL query parameters to use, overwriting previously set query parameters.
<br />
641 Affects any request types.
</p>
642 <p>Accepts a string or associative array parameter containing the pre-encoded
<br />
643 query string or to be encoded query fields. If the parameter is empty or
<br />
644 omitted, the query data will be unset.
</p>
645 <p>Returns TRUE on success, or FALSE on failure.
</p>
646 <h3 id=
"HttpRequest_getQueryData">string HttpRequest::getQueryData()
</h3>
647 <p>Get the current query data in form of an urlencoded query string.
</p>
648 <p>Returns a string containing the urlencoded query.
</p>
649 <h3 id=
"HttpRequest_addQueryData">bool HttpRequest::addQueryData(array query_params)
</h3>
650 <p>Add parameters to the query parameter list, leaving previously set unchanged.
<br />
651 Affects any request type.
</p>
652 <p>Expects an associative array as parameter containing the query fields to add.
</p>
653 <p>Returns TRUE on success, or FALSE on failure.
</p>
654 <h3 id=
"HttpRequest_addPostFields">bool HttpRequest::addPostFields(array post_data)
</h3>
655 <p>Adds POST data entries, leaving previously set unchanged, unless a
<br />
656 post entry with the same name already exists.
<br />
657 Affects only POST and custom requests.
</p>
658 <p>Expects an associative array as parameter containing the post fields.
</p>
659 <p>Returns TRUE on success, or FALSE on failure.
</p>
660 <h3 id=
"HttpRequest_setPostFields">bool HttpRequest::setPostFields([array post_data])
</h3>
661 <p>Set the POST data entries, overwriting previously set POST data.
<br />
662 Affects only POST and custom requests.
</p>
663 <p>Accepts an associative array as parameter containing the post fields.
<br />
664 If the parameter is empty or omitted, the post data will be unset.
</p>
665 <p>Returns TRUE on success, or FALSE on failure.
</p>
666 <h3 id=
"HttpRequest_getPostFields">array HttpRequest::getPostFields()
</h3>
667 <p>Get previously set POST data.
</p>
668 <p>Returns the currently set post fields as associative array.
</p>
669 <h3 id=
"HttpRequest_setRawPostData">bool HttpRequest::setRawPostData([string raw_post_data])
</h3>
670 <p>Set raw post data to send, overwriting previously set raw post data. Don't
<br />
671 forget to specify a content type. Affects only POST and custom requests.
<br />
672 Only either post fields or raw post data can be used for each request.
<br />
673 Raw post data has higher precedence and will be used even if post fields
<br />
675 <p>Accepts a string as parameter containing the *raw* post data.
</p>
676 <p>Returns TRUE on success, or FALSE on failure.
</p>
677 <h3 id=
"HttpRequest_addRawPostData">bool HttpRequest::addRawPostData(string raw_post_data)
</h3>
678 <p>Add raw post data, leaving previously set raw post data unchanged.
<br />
679 Affects only POST and custom requests.
</p>
680 <p>Expects a string as parameter containing the raw post data to concatenate.
</p>
681 <p>Returns TRUE on success, or FALSE on failure.
</p>
682 <h3 id=
"HttpRequest_getRawPostData">string HttpRequest::getRawPostData()
</h3>
683 <p>Get previously set raw post data.
</p>
684 <p>Returns a string containing the currently set raw post data.
</p>
685 <h3 id=
"HttpRequest_addPostFile">bool HttpRequest::addPostFile(string name, string file[, string content_type =
"application/x-octetstream"])
</h3>
686 <p>Add a file to the POST request, leaving prefiously set files unchanged.
<br />
687 Affects only POST and custom requests. Cannot be used with raw post data.
</p>
688 <p>Expects a string parameter containing the form element name, and a string
<br />
689 paremeter containing the path to the file which should be uploaded.
<br />
690 Additionally accepts an optional string parameter which chould contain
<br />
691 the content type of the file.
</p>
692 <p>Returns TRUE on success, or FALSE if the content type seems not to contain a
<br />
693 primary and a secondary content type part.
</p>
694 <h3 id=
"HttpRequest_setPostFiles">bool HttpRequest::setPostFiles([array post_files])
</h3>
695 <p>Set files to post, overwriting previously set post files.
<br />
696 Affects only POST and requests. Cannot be used with raw post data.
</p>
697 <p>Accepts an array containing the files to post. Each entry should be an
<br />
698 associative array with
"name",
"file" and
"type" keys. If the parameter
<br />
699 is empty or omitted the post files will be unset.
</p>
700 <p>Returns TRUE on success, or FALSE on failure.
</p>
701 <h3 id=
"HttpRequest_getPostFiles">array HttpRequest::getPostFiles()
</h3>
702 <p>Get all previously added POST files.
</p>
703 <p>Returns an array containing currently set post files.
</p>
704 <h3 id=
"HttpRequest_setPutFile">bool HttpRequest::setPutFile([string file])
</h3>
705 <p>Set file to put. Affects only PUT requests.
</p>
706 <p>Accepts a string as parameter referencing the path to file.
<br />
707 If the parameter is empty or omitted the put file will be unset.
</p>
708 <p>Returns TRUE on success, or FALSE on failure.
</p>
709 <h3 id=
"HttpRequest_getPutFile">string HttpRequest::getPutFile()
</h3>
710 <p>Get previously set put file.
</p>
711 <p>Returns a string containing the path to the currently set put file.
</p>
712 <h3 id=
"HttpRequest_getResponseData">array HttpRequest::getResponseData()
</h3>
713 <p>Get all response data after the request has been sent.
</p>
714 <p>Returns an associative array with the key
"headers" containing an associative
<br />
715 array holding all response headers, as well as the ley
"body" containing a
<br />
716 string with the response body.
</p>
717 <p>If redirects were allowed and several responses were received, the data
<br />
718 references the last received response.
</p>
719 <h3 id=
"HttpRequest_getResponseHeader">mixed HttpRequest::getResponseHeader([string name])
</h3>
720 <p>Get response header(s) after the request has been sent.
</p>
721 <p>Accepts an string as optional parameter specifying a certain header to read.
<br />
722 If the parameter is empty or omitted all response headers will be returned.
</p>
723 <p>Returns either a string with the value of the header matching name if requested,
<br />
724 FALSE on failure, or an associative array containing all reponse headers.
</p>
725 <p>If redirects were allowed and several responses were received, the data
<br />
726 references the last received response.
</p>
727 <h3 id=
"HttpRequest_getResponseCookie">array HttpRequest::getResponseCookie([string name])
</h3>
728 <p>Get response cookie(s) after the request has been sent.
</p>
729 <p>Accepts a string as optional parameter specifying the name of the cookie to read.
<br />
730 If the parameter is empty or omitted, an associative array with all received
<br />
731 cookies will be returned.
</p>
732 <p>Returns either an associative array with the cookie's name, value and any
<br />
733 additional params of the cookie matching name if requested, FALSE on failure,
<br />
734 or an array containing all received cookies as arrays.
</p>
735 <p>If redirects were allowed and several responses were received, the data
<br />
736 references the last received response.
</p>
737 <h3 id=
"HttpRequest_getResponseBody">string HttpRequest::getResponseBody()
</h3>
738 <p>Get the response body after the request has been sent.
</p>
739 <p>Returns a string containing the response body.
</p>
740 <p>If redirects were allowed and several responses were received, the data
<br />
741 references the last received response.
</p>
742 <h3 id=
"HttpRequest_getResponseCode">int HttpRequest::getResponseCode()
</h3>
743 <p>Get the response code after the request has been sent.
</p>
744 <p>Returns an int representing the response code.
</p>
745 <p>If redirects were allowed and several responses were received, the data
<br />
746 references the last received response.
</p>
747 <h3 id=
"HttpRequest_getResponseInfo">mixed HttpRequest::getResponseInfo([string name])
</h3>
748 <p>Get response info after the request has been sent.
<br />
749 See http_get() for a full list of returned info.
</p>
750 <p>Accepts a string as optional parameter specifying the info to read.
<br />
751 If the parameter is empty or omitted, an associative array containing
<br />
752 all available info will be returned.
</p>
753 <p>Returns either a scalar containing the value of the info matching name if
<br />
754 requested, FALSE on failure, or an associative array containing all
<br />
756 <p>If redirects were allowed and several responses were received, the data
<br />
757 references the last received response.
</p>
758 <h3 id=
"HttpRequest_getResponseMessage">HttpMessage HttpRequest::getResponseMessage()
</h3>
759 <p>Get the full response as HttpMessage object after the request has been sent.
</p>
760 <p>Returns an HttpMessage object of the response.
</p>
761 <p>If redirects were allowed and several responses were received, the data
<br />
762 references the last received response. Use HttpMessage::getParentMessage()
<br />
763 to access the data of previously received responses whithin this request
<br />
765 <p>Throws HttpException.
</p>
766 <h3 id=
"HttpRequest_getRequestMessage">HttpMessage HttpRequest::getRequestMessage()
</h3>
767 <p>Get sent HTTP message.
</p>
768 <p>Returns an HttpMessage object representing the sent request.
</p>
769 <p>If redirects were allowed and several responses were received, the data
<br />
770 references the last received response. Use HttpMessage::getParentMessage()
<br />
771 to access the data of previously sent requests whithin this request
<br />
773 <p>Note that the internal request message is immutable, that means that the
<br />
774 request message received through HttpRequest::getRequestMessage() will
<br />
775 always look the same for the same request, regardless of any changes you
<br />
776 may have made to the returned object.
</p>
777 <p>Throws HttpMalformedHeadersException, HttpEncodingException.
</p>
778 <h3 id=
"HttpRequest_getRawRequestMessage">string HttpRequest::getRawRequestMessage()
</h3>
779 <p>Get sent HTTP message.
</p>
780 <p>Returns an HttpMessage in a form of a string
</p>
781 <h3 id=
"HttpRequest_getRawResponseMessage">string HttpRequest::getRawResponseMessage()
</h3>
782 <p>Get the entire HTTP response.
</p>
783 <p>Returns the complete web server response, including the headers in a form of a string.
</p>
784 <h3 id=
"HttpRequest_getHistory">HttpMessage HttpRequest::getHistory()
</h3>
785 <p>Get all sent requests and received responses as an HttpMessage object.
</p>
786 <p>If you don't want to record history at all, set the instance variable
<br />
787 HttpRequest::$recoedHistory to FALSE.
</p>
788 <p>Returns an HttpMessage object representing the complete request/response
<br />
790 <p>The object references the last received response, use HttpMessage::getParentMessage()
<br />
791 to access the data of previously sent requests and received responses.
</p>
792 <p>Note that the internal history is immutable, that means that any changes
<br />
793 you make the the message list won't affect a history message list newly
<br />
794 created by another call to HttpRequest::getHistory().
</p>
795 <p>Throws HttpMalformedHeaderException, HttpEncodingException.
</p>
796 <h3 id=
"HttpRequest_clearHistory">void HttpRequest::clearHistory()
</h3>
797 <p>Clear the history.
</p>
798 <h3 id=
"HttpRequest_send">HttpMessage HttpRequest::send()
</h3>
799 <p>Send the HTTP request.
</p>
800 <p>Returns the received response as HttpMessage object.
</p>
801 <p>NOTE: While an exception may be thrown, the transfer could have succeeded
<br />
802 at least partially, so you might want to check the return values of various
<br />
803 HttpRequest::getResponse*() methods.
</p>
804 <p>Throws HttpRuntimeException, HttpRequestException,
<br />
805 HttpMalformedHeaderException, HttpEncodingException.
</p>
806 <p>GET example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
807 <span style=
"color: #0000BB"><?php
<br />$r
</span><span style=
"color: #007700">=
new
</span><span style=
"color: #0000BB">HttpRequest
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'http://example.com/feed.rss'
</span><span style=
"color: #007700">,
</span><span style=
"color: #0000BB">HttpRequest
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">METH_GET
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">setOptions
</span><span style=
"color: #007700">(array(
</span><span style=
"color: #DD0000">'lastmodified'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">filemtime
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'local.rss'
</span><span style=
"color: #007700">)));
<br /></span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">addQueryData
</span><span style=
"color: #007700">(array(
</span><span style=
"color: #DD0000">'category'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #0000BB">3</span><span style=
"color: #007700">));
<br />try
{
<br /> </span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">send
</span><span style=
"color: #007700">();
<br /> if
(
</span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">getResponseCode
</span><span style=
"color: #007700">()
==
</span><span style=
"color: #0000BB">200</span><span style=
"color: #007700">)
{
<br /> </span><span style=
"color: #0000BB">file_put_contents
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'local.rss'
</span><span style=
"color: #007700">,
</span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">getResponseBody
</span><span style=
"color: #007700">());
<br /> }
<br />}
catch
(
</span><span style=
"color: #0000BB">HttpException
$ex
</span><span style=
"color: #007700">)
{
<br /> echo
</span><span style=
"color: #0000BB">$ex
</span><span style=
"color: #007700">;
<br />}
<br /></span><span style=
"color: #0000BB">?
></span><br />
808 </span></code></blockquote></p>
810 <p>POST example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
811 <span style=
"color: #0000BB"><?php
<br />$r
</span><span style=
"color: #007700">=
new
</span><span style=
"color: #0000BB">HttpRequest
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'http://example.com/form.php'
</span><span style=
"color: #007700">,
</span><span style=
"color: #0000BB">HttpRequest
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">METH_POST
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">setOptions
</span><span style=
"color: #007700">(array(
</span><span style=
"color: #DD0000">'cookies'
</span><span style=
"color: #007700">=
> array(
</span><span style=
"color: #DD0000">'lang'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #DD0000">'de'
</span><span style=
"color: #007700">)));
<br /></span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">addPostFields
</span><span style=
"color: #007700">(array(
</span><span style=
"color: #DD0000">'user'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #DD0000">'mike'
</span><span style=
"color: #007700">,
</span><span style=
"color: #DD0000">'pass'
</span><span style=
"color: #007700">=
> </span><span style=
"color: #DD0000">'s3c|r3t'
</span><span style=
"color: #007700">));
<br /></span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">addPostFile
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'image'
</span><span style=
"color: #007700">,
</span><span style=
"color: #DD0000">'profile.jpg'
</span><span style=
"color: #007700">,
</span><span style=
"color: #DD0000">'image/jpeg'
</span><span style=
"color: #007700">);
<br />try
{
<br /> echo
</span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">send
</span><span style=
"color: #007700">()-
></span><span style=
"color: #0000BB">getBody
</span><span style=
"color: #007700">();
<br />}
catch
(
</span><span style=
"color: #0000BB">HttpException
$ex
</span><span style=
"color: #007700">)
{
<br /> echo
</span><span style=
"color: #0000BB">$ex
</span><span style=
"color: #007700">;
<br />}
<br /></span><span style=
"color: #0000BB">?
></span><br />
812 </span></code></blockquote></p>
815 <h1 id=
"http_requestpool_object.c">http_requestpool_object.c
</h1>
816 <h2 id=
"HttpRequestPool" class=
"o">HttpRequestPool
</h2>
817 <h3 id=
"HttpRequestPool___construct">void HttpRequestPool::__construct([HttpRequest request[, ...]])
</h3>
818 <p>Instantiate a new HttpRequestPool object. An HttpRequestPool is
<br />
819 able to send several HttpRequests in parallel.
</p>
820 <p>WARNING: Don't attach/detach HttpRequest objects to the HttpRequestPool
<br />
821 object while you're using the implemented Iterator interface.
</p>
822 <p>Accepts virtual infinite optional parameters each referencing an
<br />
823 HttpRequest object.
</p>
824 <p>Throws HttpRequestPoolException (HttpRequestException, HttpInvalidParamException).
</p>
825 <p>Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
826 <span style=
"color: #0000BB"><?php
<br /></span><span style=
"color: #007700">try
{
<br /> </span><span style=
"color: #0000BB">$pool
</span><span style=
"color: #007700">=
new
</span><span style=
"color: #0000BB">HttpRequestPool
</span><span style=
"color: #007700">(
<br /> new
</span><span style=
"color: #0000BB">HttpRequest
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'http://www.google.com/'
</span><span style=
"color: #007700">,
</span><span style=
"color: #0000BB">HttpRequest
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">METH_HEAD
</span><span style=
"color: #007700">),
<br /> new
</span><span style=
"color: #0000BB">HttpRequest
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'http://www.php.net/'
</span><span style=
"color: #007700">,
</span><span style=
"color: #0000BB">HttpRequest
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">METH_HEAD
</span><span style=
"color: #007700">)
<br /> );
<br /> </span><span style=
"color: #0000BB">$pool
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">send
</span><span style=
"color: #007700">();
<br /> foreach(
</span><span style=
"color: #0000BB">$pool
</span><span style=
"color: #007700">as
</span><span style=
"color: #0000BB">$request
</span><span style=
"color: #007700">)
{
<br /> </span><span style=
"color: #0000BB">printf
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">"%s is %s (%d)\n"</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #0000BB">$request
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">getUrl
</span><span style=
"color: #007700">(),
<br /> </span><span style=
"color: #0000BB">$request
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">getResponseCode
</span><span style=
"color: #007700">()
?
</span><span style=
"color: #DD0000">'alive'
</span><span style=
"color: #007700">:
</span><span style=
"color: #DD0000">'not
alive'
</span><span style=
"color: #007700">,
<br /> </span><span style=
"color: #0000BB">$request
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">getResponseCode
</span><span style=
"color: #007700">()
<br /> );
<br /> }
<br />}
catch
(
</span><span style=
"color: #0000BB">HttpException
$e
</span><span style=
"color: #007700">)
{
<br /> echo
</span><span style=
"color: #0000BB">$e
</span><span style=
"color: #007700">;
<br />}
<br /></span><span style=
"color: #0000BB">?
></span><br />
827 </span></code></blockquote></p>
829 <h3 id=
"HttpRequestPool___destruct">void HttpRequestPool::__destruct()
</h3>
830 <p>Clean up HttpRequestPool object.
</p>
831 <h3 id=
"HttpRequestPool_reset">void HttpRequestPool::reset()
</h3>
832 <p>Detach all attached HttpRequest objects.
</p>
833 <h3 id=
"HttpRequestPool_attach">bool HttpRequestPool::attach(HttpRequest request)
</h3>
834 <p>Attach an HttpRequest object to this HttpRequestPool.
<br />
835 WARNING: set all options prior attaching!
</p>
836 <p>Expects the parameter to be an HttpRequest object not alread attached to
<br />
837 antother HttpRequestPool object.
</p>
838 <p>Returns TRUE on success, or FALSE on failure.
</p>
839 <p>Throws HttpInvalidParamException, HttpRequestException,
<br />
840 HttpRequestPoolException, HttpEncodingException.
</p>
841 <h3 id=
"HttpRequestPool_detach">bool HttpRequestPool::detach(HttpRequest request)
</h3>
842 <p>Detach an HttpRequest object from this HttpRequestPool.
</p>
843 <p>Expects the parameter to be an HttpRequest object attached to this
<br />
844 HttpRequestPool object.
</p>
845 <p>Returns TRUE on success, or FALSE on failure.
</p>
846 <p>Throws HttpInvalidParamException, HttpRequestPoolException.
</p>
847 <h3 id=
"HttpRequestPool_send">bool HttpRequestPool::send()
</h3>
848 <p>Send all attached HttpRequest objects in parallel.
</p>
849 <p>Returns TRUE on success, or FALSE on failure.
</p>
850 <p>Throws HttpRequestPoolException (HttpSocketException, HttpRequestException, HttpMalformedHeaderException).
</p>
851 <h3 id=
"HttpRequestPool_socketPerform">protected bool HttpRequestPool::socketPerform()
</h3>
852 <p>Returns TRUE until each request has finished its transaction.
</p>
853 <p>Usage:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
854 <span style=
"color: #0000BB"><?php
<br /></span><span style=
"color: #007700">class
</span><span style=
"color: #0000BB">MyPool
</span><span style=
"color: #007700">extends
</span><span style=
"color: #0000BB">HttpRequestPool
<br /></span><span style=
"color: #007700">{
<br /> public
function
</span><span style=
"color: #0000BB">send
</span><span style=
"color: #007700">()
<br /> {
<br /> while
(
</span><span style=
"color: #0000BB">$this
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">socketPerform
</span><span style=
"color: #007700">())
{
<br /> if
(!
</span><span style=
"color: #0000BB">$this
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">socketSelect
</span><span style=
"color: #007700">())
{
<br /> throw
new
</span><span style=
"color: #0000BB">HttpSocketExcpetion
</span><span style=
"color: #007700">;
<br /> }
<br /> }
<br /> }
<br /> <br /> protected
final
function
</span><span style=
"color: #0000BB">socketPerform
</span><span style=
"color: #007700">()
<br /> {
<br /> </span><span style=
"color: #0000BB">$result
</span><span style=
"color: #007700">=
</span><span style=
"color: #0000BB">parent
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">socketPerform
</span><span style=
"color: #007700">();
<br /> foreach
(
</span><span style=
"color: #0000BB">$this
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">getFinishedRequests
</span><span style=
"color: #007700">()
as
</span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">)
{
<br /> </span><span style=
"color: #0000BB">$this
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">detach
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">$r
</span><span style=
"color: #007700">);
<br /> </span><span style=
"color: #FF8000">//
handle
response
of
finished
request
<br /> </span><span style=
"color: #007700">}
<br /> return
</span><span style=
"color: #0000BB">$result
</span><span style=
"color: #007700">;
<br /> }
<br />}
<br /></span><span style=
"color: #0000BB">?
></span><br />
855 </span></code></blockquote></p>
857 <h3 id=
"HttpRequestPool_socketSelect">protected bool HttpRequestPool::socketSelect()
</h3>
858 <p>See HttpRequestPool::socketPerform().
</p>
859 <p>Returns TRUE on success, or FALSE on failure.
</p>
860 <h3 id=
"HttpRequestPool_valid">bool HttpRequestPool::valid()
</h3>
861 <p>Implements Iterator::valid().
</p>
862 <h3 id=
"HttpRequestPool_current">HttpRequest HttpRequestPool::current()
</h3>
863 <p>Implements Iterator::current().
</p>
864 <h3 id=
"HttpRequestPool_key">int HttpRequestPool::key()
</h3>
865 <p>Implements Iterator::key().
</p>
866 <h3 id=
"HttpRequestPool_next">void HttpRequestPool::next()
</h3>
867 <p>Implements Iterator::next().
</p>
868 <h3 id=
"HttpRequestPool_rewind">void HttpRequestPool::rewind()
</h3>
869 <p>Implements Iterator::rewind().
</p>
870 <h3 id=
"HttpRequestPool_count">int HttpRequestPool::count()
</h3>
871 <p>Implements Countable.
</p>
872 <p>Returns the number of attached HttpRequest objects.
</p>
873 <h3 id=
"HttpRequestPool_getAttachedRequests">array HttpRequestPool::getAttachedRequests()
</h3>
874 <p>Get attached HttpRequest objects.
</p>
875 <p>Returns an array containing all currently attached HttpRequest objects.
</p>
876 <h3 id=
"HttpRequestPool_getFinishedRequests">array HttpRequestPool::getFinishedRequests()
</h3>
877 <p>Get attached HttpRequest objects that already have finished their work.
</p>
878 <p>Returns an array containing all attached HttpRequest objects that
<br />
879 already have finished their work.
</p>
881 <h1 id=
"http_response_object.c">http_response_object.c
</h1>
882 <h2 id=
"HttpResponse" class=
"o">HttpResponse
</h2>
883 <h3 id=
"HttpResponse_setHeader">static bool HttpResponse::setHeader(string name, mixed value[, bool replace = true])
</h3>
884 <p>Send an HTTP header.
</p>
885 <p>Expects a string parameter containing the name of the header and a mixed
<br />
886 parameter containing the value of the header, which will be converted to
<br />
887 a string. Additionally accepts an optional boolean parameter, which
<br />
888 specifies whether an existing header should be replaced. If the second
<br />
889 parameter is unset no header with this name will be sent.
</p>
890 <p>Returns TRUE on success, or FALSE on failure.
</p>
891 <p>Throws HttpHeaderException if http.only_exceptions is TRUE.
</p>
892 <h3 id=
"HttpResponse_getHeader">static mixed HttpResponse::getHeader([string name])
</h3>
893 <p>Get header(s) about to be sent.
</p>
894 <p>Accepts a string as optional parameter which specifies the name of the
<br />
895 header to read. If the parameter is empty or omitted, an associative array
<br />
896 with all headers will be returned.
</p>
897 <p>Returns either a string containing the value of the header matching name,
<br />
898 FALSE on failure, or an associative array with all headers.
</p>
899 <h3 id=
"HttpResponse_setCache">static bool HttpResponse::setCache(bool cache)
</h3>
900 <p>Whether it sould be attempted to cache the entitity.
<br />
901 This will result in necessary caching headers and checks of clients
<br />
902 "If-Modified-Since" and
"If-None-Match" headers. If one of those headers
<br />
903 matches a
"304 Not Modified" status code will be issued.
</p>
904 <p>NOTE: If you're using sessions, be shure that you set session.cache_limiter
<br />
905 to something more appropriate than
"no-cache"!
</p>
906 <p>Expects a boolean as parameter specifying whether caching should be attempted.
</p>
907 <p>Returns TRUE ons success, or FALSE on failure.
</p>
908 <h3 id=
"HttpResponse_getCache">static bool HttpResponse::getCache()
</h3>
909 <p>Get current caching setting.
</p>
910 <p>Returns TRUE if caching should be attempted, else FALSE.
</p>
911 <h3 id=
"HttpResponse_setGzip">static bool HttpResponse::setGzip(bool gzip)
</h3>
912 <p>Enable on-thy-fly gzipping of the sent entity.
</p>
913 <p>Expects a boolean as parameter indicating if GZip compression should be enabled.
</p>
914 <p>Returns TRUE on success, or FALSE on failure.
</p>
915 <h3 id=
"HttpResponse_getGzip">static bool HttpResponse::getGzip()
</h3>
916 <p>Get current gzipping setting.
</p>
917 <p>Returns TRUE if GZip compression is enabled, else FALSE.
</p>
918 <h3 id=
"HttpResponse_setCacheControl">static bool HttpResponse::setCacheControl(string control[, int max_age =
0])
</h3>
919 <p>Set a custom cache-control header, usually being
"private" or
"public";
<br />
920 The max_age parameter controls how long the cache entry is valid on the client side.
</p>
921 <p>Expects a string parameter containing the primary cache control setting.
<br />
922 Addtitionally accepts an int parameter specifying the max-age setting.
</p>
923 <p>Returns TRUE on success, or FALSE if control does not match one of
<br />
924 "public" ,
"private" or
"no-cache".
</p>
925 <p>Throws HttpInvalidParamException if http.only_exceptions is TRUE.
</p>
926 <h3 id=
"HttpResponse_getCacheControl">static string HttpResponse::getCacheControl()
</h3>
927 <p>Get current Cache-Control header setting.
</p>
928 <p>Returns the current cache control setting as a string like sent in a header.
</p>
929 <h3 id=
"HttpResponse_setContentType">static bool HttpResponse::setContentType(string content_type)
</h3>
930 <p>Set the content-type of the sent entity.
</p>
931 <p>Expects a string as parameter specifying the content type of the sent entity.
</p>
932 <p>Returns TRUE on success, or FALSE if the content type does not seem to
<br />
933 contain a primary and secondary content type part.
</p>
934 <p>Throws HttpInvalidParamException if http.only_exceptions is TRUE.
</p>
935 <h3 id=
"HttpResponse_getContentType">static string HttpResponse::getContentType()
</h3>
936 <p>Get current Content-Type header setting.
</p>
937 <p>Returns the currently set content type as string.
</p>
938 <h3 id=
"HttpResponse_guessContentType">static string HttpResponse::guessContentType(string magic_file[, int magic_mode = MAGIC_MIME])
</h3>
939 <p>Attempts to guess the content type of supplied payload through libmagic.
<br />
940 If the attempt is successful, the guessed content type will automatically
<br />
941 be set as response content type.
</p>
942 <p>Expects a string parameter specifying the magic.mime database to use.
<br />
943 Additionally accepts an optional int parameter, being flags for libmagic.
</p>
944 <p>Returns the guessed content type on success, or FALSE on failure.
</p>
945 <p>Throws HttpRuntimeException, HttpInvalidParamException
<br />
946 if http.only_exceptions is TRUE.
</p>
947 <h3 id=
"HttpResponse_setContentDisposition">static bool HttpResponse::setContentDisposition(string filename[, bool inline = false])
</h3>
948 <p>Set the Content-Disposition. The Content-Disposition header is very useful
<br />
949 if the data actually sent came from a file or something similar, that should
<br />
950 be
"saved" by the client/user (i.e. by browsers
"Save as..." popup window).
</p>
951 <p>Expects a string parameter specifying the file name the
"Save as..." dialogue
<br />
952 should display. Optionally accepts a bool parameter, which, if set to true
<br />
953 and the user agent knows how to handle the content type, will probably not
<br />
954 cause the popup window to be shown.
</p>
955 <p>Returns TRUE on success or FALSE on failure.
</p>
956 <h3 id=
"HttpResponse_getContentDisposition">static string HttpResponse::getContentDisposition()
</h3>
957 <p>Get current Content-Disposition setting.
</p>
958 <p>Returns the current content disposition as string like sent in a header.
</p>
959 <h3 id=
"HttpResponse_setETag">static bool HttpResponse::setETag(string etag)
</h3>
960 <p>Set a custom ETag. Use this only if you know what you're doing.
</p>
961 <p>Expects an unquoted string as parameter containing the ETag.
</p>
962 <p>Returns TRUE on success, or FALSE on failure.
</p>
963 <h3 id=
"HttpResponse_getETag">static string HttpResponse::getETag()
</h3>
964 <p>Get calculated or previously set custom ETag.
</p>
965 <p>Returns the calculated or previously set ETag as unquoted string.
</p>
966 <h3 id=
"HttpResponse_setLastModified">static bool HttpResponse::setLastModified(int timestamp)
</h3>
967 <p>Set a custom Last-Modified date.
</p>
968 <p>Expects an unix timestamp as parameter representing the last modification
<br />
969 time of the sent entity.
</p>
970 <p>Returns TRUE on success, or FALSE on failure.
</p>
971 <h3 id=
"HttpResponse_getLastModified">static int HttpResponse::getLastModified()
</h3>
972 <p>Get calculated or previously set custom Last-Modified date.
</p>
973 <p>Returns the calculated or previously set unix timestamp.
</p>
974 <h3 id=
"HttpResponse_setThrottleDelay">static bool HttpResponse::setThrottleDelay(double seconds)
</h3>
975 <p>Sets the throttle delay for use with HttpResponse::setBufferSize().
</p>
976 <p>Provides a basic throttling mechanism, which will yield the current process
<br />
977 resp. thread until the entity has been completely sent, though.
</p>
978 <p>Note: This doesn't really work with the FastCGI SAPI.
</p>
979 <p>Expects a double parameter specifying the seconds too sleep() after
<br />
981 <p>Returns TRUE on success, or FALSE on failure.
</p>
982 <h3 id=
"HttpResponse_getThrottleDelay">static double HttpResponse::getThrottleDelay()
</h3>
983 <p>Get the current throttle delay.
</p>
984 <p>Returns a double representing the throttle delay in seconds.
</p>
985 <h3 id=
"HttpResponse_setBufferSize">static bool HttpResponse::setBufferSize(int bytes)
</h3>
986 <p>Sets the send buffer size for use with HttpResponse::setThrottleDelay().
</p>
987 <p>Provides a basic throttling mechanism, which will yield the current process
<br />
988 resp. thread until the entity has been completely sent, though.
</p>
989 <p>Note: This doesn't really work with the FastCGI SAPI.
</p>
990 <p>Expects an int parameter representing the chunk size in bytes.
</p>
991 <p>Returns TRUE on success, or FALSE on failure.
</p>
992 <h3 id=
"HttpResponse_getBufferSize">static int HttpResponse::getBufferSize()
</h3>
993 <p>Get current buffer size.
</p>
994 <p>Returns an int representing the current buffer size in bytes.
</p>
995 <h3 id=
"HttpResponse_setData">static bool HttpResponse::setData(mixed data)
</h3>
996 <p>Set the data to be sent.
</p>
997 <p>Expects one parameter, which will be converted to a string and contains
<br />
998 the data to send.
</p>
999 <p>Returns TRUE on success, or FALSE on failure.
</p>
1000 <h3 id=
"HttpResponse_getData">static string HttpResponse::getData()
</h3>
1001 <p>Get the previously set data to be sent.
</p>
1002 <p>Returns a string containing the previously set data to send.
</p>
1003 <h3 id=
"HttpResponse_setStream">static bool HttpResponse::setStream(resource stream)
</h3>
1004 <p>Set the resource to be sent.
</p>
1005 <p>Expects a resource parameter referencing an already opened stream from
<br />
1006 which the data to send will be read.
</p>
1007 <p>Returns TRUE on success, or FALSE on failure.
</p>
1008 <h3 id=
"HttpResponse_getStream">static resource HttpResponse::getStream()
</h3>
1009 <p>Get the previously set resource to be sent.
</p>
1010 <p>Returns the previously set resource.
</p>
1011 <h3 id=
"HttpResponse_setFile">static bool HttpResponse::setFile(string file)
</h3>
1012 <p>Set the file to be sent.
</p>
1013 <p>Expects a string as parameter, specifying the path to the file to send.
</p>
1014 <p>Returns TRUE on success, or FALSE on failure.
</p>
1015 <h3 id=
"HttpResponse_getFile">static string HttpResponse::getFile()
</h3>
1016 <p>Get the previously set file to be sent.
</p>
1017 <p>Returns the previously set path to the file to send as string.
</p>
1018 <h3 id=
"HttpResponse_send">static bool HttpResponse::send([bool clean_ob = true])
</h3>
1019 <p>Finally send the entity.
</p>
1020 <p>Accepts an optional boolean parameter, specifying wheter the ouput
<br />
1021 buffers should be discarded prior sending. A successful caching attempt
<br />
1022 will cause a script termination, and write a log entry if the INI setting
<br />
1023 http.cache_log is set.
</p>
1024 <p>Returns TRUE on success, or FALSE on failure.
</p>
1025 <p>Throws HttpHeaderException, HttpResponseException if http.onyl_excpetions is TRUE.
</p>
1026 <p>Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
1027 <span style=
"color: #0000BB"><?php
<br />HttpResponse
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">setCache
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">true
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">HttpResponse
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">setContentType
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'application/pdf'
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">HttpResponse
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">setContentDisposition
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">"$user.pdf"</span><span style=
"color: #007700">,
</span><span style=
"color: #0000BB">false
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">HttpResponse
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">setFile
</span><span style=
"color: #007700">(
</span><span style=
"color: #DD0000">'sheet.pdf'
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">HttpResponse
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">send
</span><span style=
"color: #007700">();
<br /></span><span style=
"color: #0000BB">?
></span><br />
1028 </span></code></blockquote></p>
1030 <h3 id=
"HttpResponse_capture">static void HttpResponse::capture()
</h3>
1031 <p>Capture script output.
</p>
1032 <p>Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
1033 <span style=
"color: #0000BB"><?php
<br />HttpResponse
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">setCache
</span><span style=
"color: #007700">(
</span><span style=
"color: #0000BB">true
</span><span style=
"color: #007700">);
<br /></span><span style=
"color: #0000BB">HttpResponse
</span><span style=
"color: #007700">::
</span><span style=
"color: #0000BB">capture
</span><span style=
"color: #007700">();
<br /></span><span style=
"color: #FF8000">//
script
follows
<br /></span><span style=
"color: #0000BB">?
></span><br />
1034 </span></code></blockquote></p>
1037 <div class=
"toc"><strong>Table of Contents
</strong>
1039 <li><a class=
"tocfile" href=
"#http_functions.c">http_functions.c
</a>
1041 <li><a href=
"#http_date">http_date
</a>
1043 <li><a href=
"#http_build_url">http_build_url
</a>
1045 <li><a href=
"#http_negotiate_language">http_negotiate_language
</a>
1047 <li><a href=
"#http_negotiate_charset">http_negotiate_charset
</a>
1049 <li><a href=
"#http_negotiate_content_type">http_negotiate_content_type
</a>
1051 <li><a href=
"#http_send_status">http_send_status
</a>
1053 <li><a href=
"#http_send_last_modified">http_send_last_modified
</a>
1055 <li><a href=
"#http_send_content_type">http_send_content_type
</a>
1057 <li><a href=
"#http_send_content_disposition">http_send_content_disposition
</a>
1059 <li><a href=
"#http_match_modified">http_match_modified
</a>
1061 <li><a href=
"#http_match_etag">http_match_etag
</a>
1063 <li><a href=
"#http_cache_last_modified">http_cache_last_modified
</a>
1065 <li><a href=
"#http_cache_etag">http_cache_etag
</a>
1067 <li><a href=
"#ob_etaghandler">ob_etaghandler
</a>
1069 <li><a href=
"#http_throttle">http_throttle
</a>
1071 <li><a href=
"#http_redirect">http_redirect
</a>
1073 <li><a href=
"#http_send_data">http_send_data
</a>
1075 <li><a href=
"#http_send_file">http_send_file
</a>
1077 <li><a href=
"#http_send_stream">http_send_stream
</a>
1079 <li><a href=
"#http_chunked_decode">http_chunked_decode
</a>
1081 <li><a href=
"#http_parse_message">http_parse_message
</a>
1083 <li><a href=
"#http_parse_headers">http_parse_headers
</a>
1085 <li><a href=
"#http_parse_cookie">http_parse_cookie
</a>
1087 <li><a href=
"#http_get_request_headers">http_get_request_headers
</a>
1089 <li><a href=
"#http_get_request_body">http_get_request_body
</a>
1091 <li><a href=
"#http_get_request_body_stream">http_get_request_body_stream
</a>
1093 <li><a href=
"#http_match_request_header">http_match_request_header
</a>
1095 <li><a href=
"#http_get">http_get
</a>
1097 <li><a href=
"#http_head">http_head
</a>
1099 <li><a href=
"#http_post_data">http_post_data
</a>
1101 <li><a href=
"#http_post_fields">http_post_fields
</a>
1103 <li><a href=
"#http_put_file">http_put_file
</a>
1105 <li><a href=
"#http_put_stream">http_put_stream
</a>
1107 <li><a href=
"#http_request_method_register">http_request_method_register
</a>
1109 <li><a href=
"#http_request_method_unregister">http_request_method_unregister
</a>
1111 <li><a href=
"#http_request_method_exists">http_request_method_exists
</a>
1113 <li><a href=
"#http_request_method_name">http_request_method_name
</a>
1115 <li><a href=
"#http_build_query">http_build_query
</a>
1117 <li><a href=
"#http_deflate">http_deflate
</a>
1119 <li><a href=
"#http_inflate">http_inflate
</a>
1121 <li><a href=
"#ob_deflatehandler">ob_deflatehandler
</a>
1123 <li><a href=
"#ob_inflatehandler">ob_inflatehandler
</a>
1125 <li><a href=
"#http_support">http_support
</a>
1129 <li><a class=
"tocfile" href=
"#http_deflatestream_object.c">http_deflatestream_object.c
</a>
1131 <li><a href=
"#HttpDeflateStream___construct">HttpDeflateStream::__construct()
</a></li>
1132 <li><a href=
"#HttpDeflateStream_update">HttpDeflateStream::update()
</a></li>
1133 <li><a href=
"#HttpDeflateStream_flush">HttpDeflateStream::flush()
</a></li>
1134 <li><a href=
"#HttpDeflateStream_finish">HttpDeflateStream::finish()
</a></li>
1138 <li><a class=
"tocfile" href=
"#http_inflatestream_object.c">http_inflatestream_object.c
</a>
1140 <li><a href=
"#HttpInflateStream_update">HttpInflateStream::update()
</a></li>
1141 <li><a href=
"#HttpInflateStream_flush">HttpInflateStream::flush()
</a></li>
1142 <li><a href=
"#HttpInflateStream_finish">HttpInflateStream::finish()
</a></li>
1146 <li><a class=
"tocfile" href=
"#http_message_object.c">http_message_object.c
</a>
1148 <li><a href=
"#HttpMessage___construct">HttpMessage::__construct()
</a></li>
1149 <li><a href=
"#HttpMessage_fromString">HttpMessage::fromString()
</a></li>
1150 <li><a href=
"#HttpMessage_getBody">HttpMessage::getBody()
</a></li>
1151 <li><a href=
"#HttpMessage_setBody">HttpMessage::setBody()
</a></li>
1152 <li><a href=
"#HttpMessage_getHeaders">HttpMessage::getHeaders()
</a></li>
1153 <li><a href=
"#HttpMessage_setHeaders">HttpMessage::setHeaders()
</a></li>
1154 <li><a href=
"#HttpMessage_addHeaders">HttpMessage::addHeaders()
</a></li>
1155 <li><a href=
"#HttpMessage_getType">HttpMessage::getType()
</a></li>
1156 <li><a href=
"#HttpMessage_setType">HttpMessage::setType()
</a></li>
1157 <li><a href=
"#HttpMessage_getResponseCode">HttpMessage::getResponseCode()
</a></li>
1158 <li><a href=
"#HttpMessage_setResponseCode">HttpMessage::setResponseCode()
</a></li>
1159 <li><a href=
"#HttpMessage_getRequestMethod">HttpMessage::getRequestMethod()
</a></li>
1160 <li><a href=
"#HttpMessage_setRequestMethod">HttpMessage::setRequestMethod()
</a></li>
1161 <li><a href=
"#HttpMessage_getRequestUrl">HttpMessage::getRequestUrl()
</a></li>
1162 <li><a href=
"#HttpMessage_setRequestUrl">HttpMessage::setRequestUrl()
</a></li>
1163 <li><a href=
"#HttpMessage_getHttpVersion">HttpMessage::getHttpVersion()
</a></li>
1164 <li><a href=
"#HttpMessage_setHttpVersion">HttpMessage::setHttpVersion()
</a></li>
1165 <li><a href=
"#HttpMessage_getParentMessage">HttpMessage::getParentMessage()
</a></li>
1166 <li><a href=
"#HttpMessage_send">HttpMessage::send()
</a></li>
1167 <li><a href=
"#HttpMessage_toString">HttpMessage::toString()
</a></li>
1168 <li><a href=
"#HttpMessage_toMessageTypeObject">HttpMessage::toMessageTypeObject()
</a></li>
1169 <li><a href=
"#HttpMessage_count">HttpMessage::count()
</a></li>
1170 <li><a href=
"#HttpMessage_serialize">HttpMessage::serialize()
</a></li>
1171 <li><a href=
"#HttpMessage_unserialize">HttpMessage::unserialize()
</a></li>
1172 <li><a href=
"#HttpMessage_detach">HttpMessage::detach()
</a></li>
1173 <li><a href=
"#HttpMessage_prepend">HttpMessage::prepend()
</a></li>
1174 <li><a href=
"#HttpMessage_rewind">HttpMessage::rewind()
</a></li>
1175 <li><a href=
"#HttpMessage_valid">HttpMessage::valid()
</a></li>
1176 <li><a href=
"#HttpMessage_next">HttpMessage::next()
</a></li>
1177 <li><a href=
"#HttpMessage_key">HttpMessage::key()
</a></li>
1178 <li><a href=
"#HttpMessage_current">HttpMessage::current()
</a></li>
1182 <li><a class=
"tocfile" href=
"#http_querystring_object.c">http_querystring_object.c
</a>
1184 <li><a href=
"#HttpQueryString___construct">HttpQueryString::__construct()
</a></li>
1185 <li><a href=
"#HttpQueryString_toString">HttpQueryString::toString()
</a></li>
1186 <li><a href=
"#HttpQueryString_toArray">HttpQueryString::toArray()
</a></li>
1187 <li><a href=
"#HttpQueryString_get">HttpQueryString::get()
</a></li>
1188 <li><a href=
"#HttpQueryString_set">HttpQueryString::set()
</a></li>
1189 <li><a href=
"#HttpQueryString_getInstance">HttpQueryString::getInstance()
</a></li>
1193 <li><a class=
"tocfile" href=
"#http_request_object.c">http_request_object.c
</a>
1195 <li><a href=
"#HttpRequest___construct">HttpRequest::__construct()
</a></li>
1196 <li><a href=
"#HttpRequest_setOptions">HttpRequest::setOptions()
</a></li>
1197 <li><a href=
"#HttpRequest_getOptions">HttpRequest::getOptions()
</a></li>
1198 <li><a href=
"#HttpRequest_setSslOptions">HttpRequest::setSslOptions()
</a></li>
1199 <li><a href=
"#HttpRequest_addSslOptions">HttpRequest::addSslOptions()
</a></li>
1200 <li><a href=
"#HttpRequest_getSslOptions">HttpRequest::getSslOptions()
</a></li>
1201 <li><a href=
"#HttpRequest_addHeaders">HttpRequest::addHeaders()
</a></li>
1202 <li><a href=
"#HttpRequest_setHeaders">HttpRequest::setHeaders()
</a></li>
1203 <li><a href=
"#HttpRequest_getHeaders">HttpRequest::getHeaders()
</a></li>
1204 <li><a href=
"#HttpRequest_setCookies">HttpRequest::setCookies()
</a></li>
1205 <li><a href=
"#HttpRequest_addCookies">HttpRequest::addCookies()
</a></li>
1206 <li><a href=
"#HttpRequest_getCookies">HttpRequest::getCookies()
</a></li>
1207 <li><a href=
"#HttpRequest_setUrl">HttpRequest::setUrl()
</a></li>
1208 <li><a href=
"#HttpRequest_getUrl">HttpRequest::getUrl()
</a></li>
1209 <li><a href=
"#HttpRequest_setMethod">HttpRequest::setMethod()
</a></li>
1210 <li><a href=
"#HttpRequest_getMethod">HttpRequest::getMethod()
</a></li>
1211 <li><a href=
"#HttpRequest_setContentType">HttpRequest::setContentType()
</a></li>
1212 <li><a href=
"#HttpRequest_getContentType">HttpRequest::getContentType()
</a></li>
1213 <li><a href=
"#HttpRequest_setQueryData">HttpRequest::setQueryData()
</a></li>
1214 <li><a href=
"#HttpRequest_getQueryData">HttpRequest::getQueryData()
</a></li>
1215 <li><a href=
"#HttpRequest_addQueryData">HttpRequest::addQueryData()
</a></li>
1216 <li><a href=
"#HttpRequest_addPostFields">HttpRequest::addPostFields()
</a></li>
1217 <li><a href=
"#HttpRequest_setPostFields">HttpRequest::setPostFields()
</a></li>
1218 <li><a href=
"#HttpRequest_getPostFields">HttpRequest::getPostFields()
</a></li>
1219 <li><a href=
"#HttpRequest_setRawPostData">HttpRequest::setRawPostData()
</a></li>
1220 <li><a href=
"#HttpRequest_addRawPostData">HttpRequest::addRawPostData()
</a></li>
1221 <li><a href=
"#HttpRequest_getRawPostData">HttpRequest::getRawPostData()
</a></li>
1222 <li><a href=
"#HttpRequest_addPostFile">HttpRequest::addPostFile()
</a></li>
1223 <li><a href=
"#HttpRequest_setPostFiles">HttpRequest::setPostFiles()
</a></li>
1224 <li><a href=
"#HttpRequest_getPostFiles">HttpRequest::getPostFiles()
</a></li>
1225 <li><a href=
"#HttpRequest_setPutFile">HttpRequest::setPutFile()
</a></li>
1226 <li><a href=
"#HttpRequest_getPutFile">HttpRequest::getPutFile()
</a></li>
1227 <li><a href=
"#HttpRequest_getResponseData">HttpRequest::getResponseData()
</a></li>
1228 <li><a href=
"#HttpRequest_getResponseHeader">HttpRequest::getResponseHeader()
</a></li>
1229 <li><a href=
"#HttpRequest_getResponseCookie">HttpRequest::getResponseCookie()
</a></li>
1230 <li><a href=
"#HttpRequest_getResponseBody">HttpRequest::getResponseBody()
</a></li>
1231 <li><a href=
"#HttpRequest_getResponseCode">HttpRequest::getResponseCode()
</a></li>
1232 <li><a href=
"#HttpRequest_getResponseInfo">HttpRequest::getResponseInfo()
</a></li>
1233 <li><a href=
"#HttpRequest_getResponseMessage">HttpRequest::getResponseMessage()
</a></li>
1234 <li><a href=
"#HttpRequest_getRequestMessage">HttpRequest::getRequestMessage()
</a></li>
1235 <li><a href=
"#HttpRequest_getRawRequestMessage">HttpRequest::getRawRequestMessage()
</a></li>
1236 <li><a href=
"#HttpRequest_getRawResponseMessage">HttpRequest::getRawResponseMessage()
</a></li>
1237 <li><a href=
"#HttpRequest_getHistory">HttpRequest::getHistory()
</a></li>
1238 <li><a href=
"#HttpRequest_clearHistory">HttpRequest::clearHistory()
</a></li>
1239 <li><a href=
"#HttpRequest_send">HttpRequest::send()
</a></li>
1243 <li><a class=
"tocfile" href=
"#http_requestpool_object.c">http_requestpool_object.c
</a>
1245 <li><a href=
"#HttpRequestPool___construct">HttpRequestPool::__construct()
</a></li>
1246 <li><a href=
"#HttpRequestPool___destruct">HttpRequestPool::__destruct()
</a></li>
1247 <li><a href=
"#HttpRequestPool_reset">HttpRequestPool::reset()
</a></li>
1248 <li><a href=
"#HttpRequestPool_attach">HttpRequestPool::attach()
</a></li>
1249 <li><a href=
"#HttpRequestPool_detach">HttpRequestPool::detach()
</a></li>
1250 <li><a href=
"#HttpRequestPool_send">HttpRequestPool::send()
</a></li>
1251 <li><a href=
"#HttpRequestPool_socketPerform">HttpRequestPool::socketPerform()
</a></li>
1252 <li><a href=
"#HttpRequestPool_socketSelect">HttpRequestPool::socketSelect()
</a></li>
1253 <li><a href=
"#HttpRequestPool_valid">HttpRequestPool::valid()
</a></li>
1254 <li><a href=
"#HttpRequestPool_current">HttpRequestPool::current()
</a></li>
1255 <li><a href=
"#HttpRequestPool_key">HttpRequestPool::key()
</a></li>
1256 <li><a href=
"#HttpRequestPool_next">HttpRequestPool::next()
</a></li>
1257 <li><a href=
"#HttpRequestPool_rewind">HttpRequestPool::rewind()
</a></li>
1258 <li><a href=
"#HttpRequestPool_count">HttpRequestPool::count()
</a></li>
1259 <li><a href=
"#HttpRequestPool_getAttachedRequests">HttpRequestPool::getAttachedRequests()
</a></li>
1260 <li><a href=
"#HttpRequestPool_getFinishedRequests">HttpRequestPool::getFinishedRequests()
</a></li>
1264 <li><a class=
"tocfile" href=
"#http_response_object.c">http_response_object.c
</a>
1266 <li><a href=
"#HttpResponse_setHeader">HttpResponse::setHeader()
</a></li>
1267 <li><a href=
"#HttpResponse_getHeader">HttpResponse::getHeader()
</a></li>
1268 <li><a href=
"#HttpResponse_setCache">HttpResponse::setCache()
</a></li>
1269 <li><a href=
"#HttpResponse_getCache">HttpResponse::getCache()
</a></li>
1270 <li><a href=
"#HttpResponse_setGzip">HttpResponse::setGzip()
</a></li>
1271 <li><a href=
"#HttpResponse_getGzip">HttpResponse::getGzip()
</a></li>
1272 <li><a href=
"#HttpResponse_setCacheControl">HttpResponse::setCacheControl()
</a></li>
1273 <li><a href=
"#HttpResponse_getCacheControl">HttpResponse::getCacheControl()
</a></li>
1274 <li><a href=
"#HttpResponse_setContentType">HttpResponse::setContentType()
</a></li>
1275 <li><a href=
"#HttpResponse_getContentType">HttpResponse::getContentType()
</a></li>
1276 <li><a href=
"#HttpResponse_guessContentType">HttpResponse::guessContentType()
</a></li>
1277 <li><a href=
"#HttpResponse_setContentDisposition">HttpResponse::setContentDisposition()
</a></li>
1278 <li><a href=
"#HttpResponse_getContentDisposition">HttpResponse::getContentDisposition()
</a></li>
1279 <li><a href=
"#HttpResponse_setETag">HttpResponse::setETag()
</a></li>
1280 <li><a href=
"#HttpResponse_getETag">HttpResponse::getETag()
</a></li>
1281 <li><a href=
"#HttpResponse_setLastModified">HttpResponse::setLastModified()
</a></li>
1282 <li><a href=
"#HttpResponse_getLastModified">HttpResponse::getLastModified()
</a></li>
1283 <li><a href=
"#HttpResponse_setThrottleDelay">HttpResponse::setThrottleDelay()
</a></li>
1284 <li><a href=
"#HttpResponse_getThrottleDelay">HttpResponse::getThrottleDelay()
</a></li>
1285 <li><a href=
"#HttpResponse_setBufferSize">HttpResponse::setBufferSize()
</a></li>
1286 <li><a href=
"#HttpResponse_getBufferSize">HttpResponse::getBufferSize()
</a></li>
1287 <li><a href=
"#HttpResponse_setData">HttpResponse::setData()
</a></li>
1288 <li><a href=
"#HttpResponse_getData">HttpResponse::getData()
</a></li>
1289 <li><a href=
"#HttpResponse_setStream">HttpResponse::setStream()
</a></li>
1290 <li><a href=
"#HttpResponse_getStream">HttpResponse::getStream()
</a></li>
1291 <li><a href=
"#HttpResponse_setFile">HttpResponse::setFile()
</a></li>
1292 <li><a href=
"#HttpResponse_getFile">HttpResponse::getFile()
</a></li>
1293 <li><a href=
"#HttpResponse_send">HttpResponse::send()
</a></li>
1294 <li><a href=
"#HttpResponse_capture">HttpResponse::capture()
</a></li>
1300 <p><b>Generated at: Fri,
03 Feb
2006 10:
38:
18 +
0100</b></p>