3 <title>Function Summary of ext/http
</title>
7 font-family: sans-serif;
34 border:
1px solid #ccc;
48 <body><h1>http_functions.c
</h1>
49 <h2 id=
"http_date">string http_date([int timestamp])
</h2>
50 <p>This function returns a valid HTTP date regarding RFC
822/
1123<br />
51 looking like:
"Wed, 22 Dec 2004 11:34:47 GMT"</p>
52 <h2 id=
"http_absolute_uri">string http_absolute_uri(string url[, string proto[, string host[, int port]]])
</h2>
53 <p>This function returns an absolute URI constructed from url.
<br />
54 If the url is already abolute but a different proto was supplied,
<br />
55 only the proto part of the URI will be updated. If url has no
<br />
56 path specified, the path of the current REQUEST_URI will be taken.
<br />
57 The host will be taken either from the Host HTTP header of the client
<br />
58 the SERVER_NAME or just localhost if prior are not available.
<br />
60 Some examples:
</p><pre> url =
"page.php" =
> http://www.example.com/current/path/page.php
<br />
61 url =
"/page.php" =
> http://www.example.com/page.php
<br />
62 url =
"/page.php", proto =
"https" =
> https://www.example.com/page.php
<br />
64 <h2 id=
"http_negotiate_language">string http_negotiate_language(array supported[, string default = 'en-US'])
</h2>
65 <p>This function negotiates the clients preferred language based on its
<br />
66 Accept-Language HTTP header. It returns the negotiated language or
<br />
67 the default language if none match.
<br />
69 The qualifier is recognized and languages without qualifier are rated highest.
<br />
71 The supported parameter is expected to be an array having
<br />
72 the supported languages as array values.
<br />
74 Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
75 <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 />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: #DD0000">'.php'
</span><span style=
"color: #007700">;
<br /></span><span style=
"color: #0000BB">?
></span><br />
77 </code></blockquote><br />
80 <h2 id=
"http_negotiate_charset">string http_negotiate_charset(array supported[, string default = 'iso-
8859-
1'])
</h2>
81 <p>This function negotiates the clients preferred charset based on its
<br />
82 Accept-Charset HTTP header. It returns the negotiated charset or
<br />
83 the default charset if none match.
<br />
85 The qualifier is recognized and charset without qualifier are rated highest.
<br />
87 The supported parameter is expected to be an array having
<br />
88 the supported charsets as array values.
<br />
90 Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
91 <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 /></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">);
<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 /></span><span style=
"color: #0000BB">?
></span><br />
93 </code></blockquote><br />
96 <h2 id=
"http_send_status">bool http_send_status(int status)
</h2>
97 <p>Send HTTP status code.
</p>
98 <h2 id=
"http_send_last_modified">bool http_send_last_modified([int timestamp])
</h2>
99 <p>This converts the given timestamp to a valid HTTP date and
<br />
100 sends it as
"Last-Modified" HTTP header. If timestamp is
<br />
101 omitted, current time is sent.
</p>
102 <h2 id=
"http_send_content_type">bool http_send_content_type([string content_type = 'application/x-octetstream'])
</h2>
103 <p>Sets the content type.
</p>
104 <h2 id=
"http_send_content_disposition">bool http_send_content_disposition(string filename[, bool inline = false])
</h2>
105 <p>Set the Content Disposition. The Content-Disposition header is very useful
<br />
106 if the data actually sent came from a file or something similar, that should
<br />
107 be
"saved" by the client/user (i.e. by browsers
"Save as..." popup window).
</p>
108 <h2 id=
"http_match_modified">bool http_match_modified([int timestamp[, for_range = false]])
</h2>
109 <p>Matches the given timestamp against the clients
"If-Modified-Since" resp.
<br />
110 "If-Unmodified-Since" HTTP headers.
</p>
111 <h2 id=
"http_match_etag">bool http_match_etag(string etag[, for_range = false])
</h2>
112 <p>This matches the given ETag against the clients
<br />
113 "If-Match" resp.
"If-None-Match" HTTP headers.
</p>
114 <h2 id=
"http_cache_last_modified">bool http_cache_last_modified([int timestamp_or_expires]])
</h2>
115 <p>If timestamp_or_expires is greater than
0, it is handled as timestamp
<br />
116 and will be sent as date of last modification. If it is
0 or omitted,
<br />
117 the current time will be sent as Last-Modified date. If it's negative,
<br />
118 it is handled as expiration time in seconds, which means that if the
<br />
119 requested last modification date is not between the calculated timespan,
<br />
120 the Last-Modified header is updated and the actual body will be sent.
</p>
121 <h2 id=
"http_cache_etag">bool http_cache_etag([string etag])
</h2>
122 <p>This function attempts to cache the HTTP body based on an ETag,
<br />
123 either supplied or generated through calculation of the MD5
<br />
124 checksum of the output (uses output buffering).
<br />
126 If clients
"If-None-Match" header matches the supplied/calculated
<br />
127 ETag, the body is considered cached on the clients side and
<br />
128 a
"304 Not Modified" status code is issued.
</p>
129 <h2 id=
"ob_etaghandler">string ob_etaghandler(string data, int mode)
</h2>
130 <p>For use with ob_start().
</p>
131 <h2 id=
"http_throttle">void http_throttle(double sec[, long bytes =
2097152])
</h2>
132 <p>Use with http_send() API.
<br />
134 Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
135 <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 />
137 </code></blockquote><br />
140 <h2 id=
"http_redirect">void http_redirect([string url[, array params[, bool session,[ bool permanent]]]])
</h2>
141 <p>Redirect to a given url.
<br />
142 The supplied url will be expanded with http_absolute_uri(), the params array will
<br />
143 be treated with http_build_query() and the session identification will be appended
<br />
144 if session is true.
<br />
146 Depending on permanent the redirection will be issued with a permanent
<br />
147 (
"301 Moved Permanently") or a temporary (
"302 Found") redirection
<br />
150 To be RFC compliant,
"Redirecting to <a>URI</a>." will be displayed,
<br />
151 if the client doesn't redirect immediatly.
</p>
152 <h2 id=
"http_send_data">bool http_send_data(string data)
</h2>
153 <p>Sends raw data with support for (multiple) range requests.
</p>
154 <h2 id=
"http_send_file">bool http_send_file(string file)
</h2>
155 <p>Sends a file with support for (multiple) range requests.
</p>
156 <h2 id=
"http_send_stream">bool http_send_stream(resource stream)
</h2>
157 <p>Sends an already opened stream with support for (multiple) range requests.
</p>
158 <h2 id=
"http_chunked_decode">string http_chunked_decode(string encoded)
</h2>
159 <p>This function decodes a string that was HTTP-chunked encoded.
<br />
160 Returns false on failure.
</p>
161 <h2 id=
"http_parse_message">object http_parse_message(string message)
</h2>
162 <p>Parses (a) http_message(s) into a simple recursive object structure:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
163 <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 />
165 </code></blockquote><br />
168 <h2 id=
"http_parse_headers">array http_parse_headers(string header)
</h2>
170 <h2 id=
"http_get_request_headers">array http_get_request_headers(void)
</h2>
171 <p>Get a list of incoming HTTP headers.
</p>
172 <h2 id=
"http_get_request_body">string http_get_request_body(void)
</h2>
173 <p>Get the raw request body (e.g. POST or PUT data).
</p>
174 <h2 id=
"http_match_request_header">bool http_match_request_header(string header, string value[, bool match_case = false])
</h2>
175 <p>Match an incoming HTTP header.
</p>
176 <h2 id=
"http_get">string http_get(string url[, array options[, array &info]])
</h2>
177 <p>Performs an HTTP GET request on the supplied url.
<br />
179 The second parameter is expected to be an associative
<br />
180 array where the following keys will be recognized:
</p><pre> - redirect: int, whether and how many redirects to follow
<br />
181 - unrestrictedauth: bool, whether to continue sending credentials on
<br />
182 redirects to a different host
<br />
183 - proxyhost: string, proxy host in
"host[:port]" format
<br />
184 - proxyport: int, use another proxy port as specified in proxyhost
<br />
185 - proxyauth: string, proxy credentials in
"user:pass" format
<br />
186 - proxyauthtype: int, HTTP_AUTH_BASIC and/or HTTP_AUTH_NTLM
<br />
187 - httpauth: string, http credentials in
"user:pass" format
<br />
188 - httpauthtype: int, HTTP_AUTH_BASIC, DIGEST and/or NTLM
<br />
189 - compress: bool, whether to allow gzip/deflate content encoding
<br />
190 (defaults to true)
<br />
191 - port: int, use another port as specified in the url
<br />
192 - referer: string, the referer to sends
<br />
193 - useragent: string, the user agent to send
<br />
194 (defaults to PECL::HTTP/version (PHP/version)))
<br />
195 - headers: array, list of custom headers as associative array
<br />
196 like array(
"header" =
> "value")
<br />
197 - cookies: array, list of cookies as associative array
<br />
198 like array(
"cookie" =
> "value")
<br />
199 - cookiestore: string, path to a file where cookies are/will be stored
<br />
200 - resume: int, byte offset to start the download from;
<br />
201 if the server supports ranges
<br />
202 - maxfilesize: int, maximum file size that should be downloaded;
<br />
203 has no effect, if the size of the requested entity is not known
<br />
204 - lastmodified: int, timestamp for If-(Un)Modified-Since header
<br />
205 - timeout: int, seconds the request may take
<br />
206 - connecttimeout: int, seconds the connect may take
<br />
207 - onprogress: mixed, progress callback
</pre><p>The optional third parameter will be filled with some additional information
<br />
208 in form af an associative array, if supplied, like the following example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
209 <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 />
211 </code></blockquote><br />
214 <h2 id=
"http_head">string http_head(string url[, array options[, array &info]])
</h2>
215 <p>Performs an HTTP HEAD request on the suppied url.
<br />
216 Returns the HTTP response as string.
<br />
217 See http_get() for a full list of available options.
</p>
218 <h2 id=
"http_post_data">string http_post_data(string url, string data[, array options[, array &info]])
</h2>
219 <p>Performs an HTTP POST request, posting data.
<br />
220 Returns the HTTP response as string.
<br />
221 See http_get() for a full list of available options.
</p>
222 <h2 id=
"http_post_fields">string http_post_fields(string url, array data[, array files[, array options[, array &info]]])
</h2>
223 <p>Performs an HTTP POST request, posting www-form-urlencoded array data.
<br />
224 Returns the HTTP response as string.
<br />
225 See http_get() for a full list of available options.
</p>
226 <h2 id=
"http_put_file">string http_put_file(string url, string file[, array options[, array &info]])
</h2>
227 <p>Performs an HTTP PUT request, uploading file.
<br />
228 Returns the HTTP response as string.
<br />
229 See http_get() for a full list of available options.
</p>
230 <h2 id=
"http_put_stream">string http_put_stream(string url, resource stream[, array options[, array &info]])
</h2>
231 <p>Performs an HTTP PUT request, uploading stream.
<br />
232 Returns the HTTP response as string.
<br />
233 See http_get() for a full list of available options.
</p>
234 <h2 id=
"http_request_method_register">long http_request_method_register(string method)
</h2>
235 <p>Register a custom request method.
</p>
236 <h2 id=
"http_request_method_unregister">bool http_request_method_unregister(mixed method)
</h2>
237 <p>Unregister a previously registered custom request method.
</p>
238 <h2 id=
"http_request_method_exists">long http_request_method_exists(mixed method)
</h2>
239 <p>Check if a request method is registered (or available by default).
</p>
240 <h2 id=
"http_request_method_name">string http_request_method_name(long method)
</h2>
241 <p>Get the literal string representation of a standard or registered request method.
</p>
242 <h2 id=
"http_build_query">string http_build_query(mixed formdata [, string prefix[, string arg_separator]])
</h2>
243 <p>Generates a form-encoded query string from an associative array or object.
</p>
245 <h1>http_message_object.c
</h1>
246 <h2 id=
"HttpMessage" class=
"o">HttpMessage
</h2>
247 <h3 id=
"HttpMessage___construct">void HttpMessage::__construct([string message])
</h3>
248 <p>Instantiate a new HttpMessage object.
</p>
249 <h3 id=
"HttpMessage_fromString">static HttpMessage HttpMessage::fromString(string raw_message)
</h3>
250 <p>Create an HttpMessage object from a string.
</p>
251 <h3 id=
"HttpMessage_getBody">string HttpMessage::getBody()
</h3>
252 <p>Get the body of the parsed Message.
</p>
253 <h3 id=
"HttpMessage_getHeaders">array HttpMessage::getHeaders()
</h3>
254 <p>Get Message Headers.
</p>
255 <h3 id=
"HttpMessage_setHeaders">void HttpMessage::setHeaders(array headers)
</h3>
256 <p>Sets new headers.
</p>
257 <h3 id=
"HttpMessage_addHeaders">void HttpMessage::addHeaders(array headers[, bool append = false])
</h3>
258 <p>Add headers. If append is true, headers with the same name will be separated, else overwritten.
</p>
259 <h3 id=
"HttpMessage_getType">long HttpMessage::getType()
</h3>
260 <p>Get Message Type. (HTTP_MSG_NONE|HTTP_MSG_REQUEST|HTTP_MSG_RESPONSE)
</p>
261 <h3 id=
"HttpMessage_setType">void HttpMessage::setType(long type)
</h3>
262 <p>Set Message Type. (HTTP_MSG_NONE|HTTP_MSG_REQUEST|HTTP_MSG_RESPONSE)
</p>
263 <h3 id=
"HttpMessage_getResponseCode">long HttpMessage::getResponseCode()
</h3>
264 <p>Get the Response Code of the Message.
</p>
265 <h3 id=
"HttpMessage_setResponseCode">bool HttpMessage::setResponseCode(long code)
</h3>
266 <p>Set the response code of an HTTP Response Message.
<br />
267 Returns false if the Message is not of type HTTP_MSG_RESPONSE,
<br />
268 or if the response code is out of range (
100-
510).
</p>
269 <h3 id=
"HttpMessage_getRequestMethod">string HttpMessage::getRequestMethod()
</h3>
270 <p>Get the Request Method of the Message.
<br />
271 Returns false if the Message is not of type HTTP_MSG_REQUEST.
</p>
272 <h3 id=
"HttpMessage_setRequestMethod">bool HttpMessage::setRequestMethod(string method)
</h3>
273 <p>Set the Request Method of the HTTP Message.
<br />
274 Returns false if the Message is not of type HTTP_MSG_REQUEST.
</p>
275 <h3 id=
"HttpMessage_getRequestUri">string HttpMessage::getRequestUri()
</h3>
276 <p>Get the Request URI of the Message.
</p>
277 <h3 id=
"HttpMessage_setRequestUri">bool HttpMessage::setRequestUri(string URI)
</h3>
278 <p>Set the Request URI of the HTTP Message.
<br />
279 Returns false if the Message is not of type HTTP_MSG_REQUEST,
<br />
280 or if paramtere URI was empty.
</p>
281 <h3 id=
"HttpMessage_getHttpVersion">string HttpMessage::getHttpVersion()
</h3>
282 <p>Get the HTTP Protocol Version of the Message.
</p>
283 <h3 id=
"HttpMessage_setHttpVersion">bool HttpMessage::setHttpVersion(string version)
</h3>
284 <p>Set the HTTP Protocol version of the Message.
<br />
285 Returns false if version is invalid (
1.0 and
1.1).
</p>
286 <h3 id=
"HttpMessage_getParentMessage">HttpMessage HttpMessage::getParentMessage()
</h3>
287 <p>Get parent Message.
</p>
288 <h3 id=
"HttpMessage_send">bool HttpMessage::send()
</h3>
289 <p>Send the Message according to its type as Response or Request.
</p>
290 <h3 id=
"HttpMessage_toString">string HttpMessage::toString([bool include_parent = true])
</h3>
291 <p>Get the string representation of the Message.
</p>
293 <h1>http_request_object.c
</h1>
294 <h2 id=
"HttpRequest" class=
"o">HttpRequest
</h2>
295 <h3 id=
"HttpRequest___construct">void HttpRequest::__construct([string url[, long request_method = HTTP_GET]])
</h3>
296 <p>Instantiate a new HttpRequest object which can be used to issue HEAD, GET
<br />
297 and POST (including posting files) HTTP requests.
</p>
298 <h3 id=
"HttpRequest___destruct">void HttpRequest::__destruct()
</h3>
299 <p>Destroys the HttpRequest object.
</p>
300 <h3 id=
"HttpRequest_setOptions">bool HttpRequest::setOptions([array options])
</h3>
301 <p>Set the request options to use. See http_get() for a full list of available options.
</p>
302 <h3 id=
"HttpRequest_getOptions">array HttpRequest::getOptions()
</h3>
303 <p>Get currently set options.
</p>
304 <h3 id=
"HttpRequest_setSslOptions">bool HttpRequest::setSslOptions([array options])
</h3>
305 <p>Set SSL options.
</p>
306 <h3 id=
"HttpRequest_addSslOptions">bool HttpRequest::addSslOptions(array options)
</h3>
307 <p>Set additional SSL options.
</p>
308 <h3 id=
"HttpRequest_getSslOptions">array HttpRequest::getSslOtpions()
</h3>
309 <p>Get previously set SSL options.
</p>
310 <h3 id=
"HttpRequest_addHeaders">bool HttpRequest::addHeaders(array headers)
</h3>
311 <p>Add request header name/value pairs.
</p>
312 <h3 id=
"HttpRequest_setHeaders">bool HttpRequest::setHeaders([array headers])
</h3>
313 <p>Set request header name/value pairs.
</p>
314 <h3 id=
"HttpRequest_getHeaders">array HttpRequest::getHeaders()
</h3>
315 <p>Get previously set request headers.
</p>
316 <h3 id=
"HttpRequest_setCookies">bool HttpRequest::setCookies([array cookies])
</h3>
318 <h3 id=
"HttpRequest_addCookies">bool HttpRequest::addCookies(array cookies)
</h3>
320 <h3 id=
"HttpRequest_getCookies">array HttpRequest::getCookies()
</h3>
321 <p>Get previously set cookies.
</p>
322 <h3 id=
"HttpRequest_setUrl">bool HttpRequest::setUrl(string url)
</h3>
323 <p>Set the request URL.
</p>
324 <h3 id=
"HttpRequest_getUrl">string HttpRequest::getUrl()
</h3>
325 <p>Get the previously set request URL.
</p>
326 <h3 id=
"HttpRequest_setMethod">bool HttpRequest::setMethod(long request_method)
</h3>
327 <p>Set the request methods; one of the
<tt>HTTP_HEAD
</tt>,
<tt>HTTP_GET
</tt> or
<br />
328 <tt>HTTP_POST
</tt> constants.
</p>
329 <h3 id=
"HttpRequest_getMethod">long HttpRequest::getMethod()
</h3>
330 <p>Get the previously set request method.
</p>
331 <h3 id=
"HttpRequest_setContentType">bool HttpRequest::setContentType(string content_type)
</h3>
332 <p>Set the content type the post request should have.
<br />
333 Use this only if you know what you're doing.
</p>
334 <h3 id=
"HttpRequest_getContentType">string HttpRequest::getContentType()
</h3>
335 <p>Get the previously content type.
</p>
336 <h3 id=
"HttpRequest_setQueryData">bool HttpRequest::setQueryData([mixed query_data])
</h3>
337 <p>Set the URL query parameters to use.
<br />
338 Overwrites previously set query parameters.
<br />
339 Affects any request types.
</p>
340 <h3 id=
"HttpRequest_getQueryData">string HttpRequest::getQueryData()
</h3>
341 <p>Get the current query data in form of an urlencoded query string.
</p>
342 <h3 id=
"HttpRequest_addQueryData">bool HttpRequest::addQueryData(array query_params)
</h3>
343 <p>Add parameters to the query parameter list.
<br />
344 Affects any request type.
</p>
345 <h3 id=
"HttpRequest_addPostFields">bool HttpRequest::addPostFields(array post_data)
</h3>
346 <p>Adds POST data entries.
<br />
347 Affects only POST requests.
</p>
348 <h3 id=
"HttpRequest_setPostFields">bool HttpRequest::setPostFields([array post_data])
</h3>
349 <p>Set the POST data entries.
<br />
350 Overwrites previously set POST data.
<br />
351 Affects only POST requests.
</p>
352 <h3 id=
"HttpRequest_getPostFields">array HttpRequest::getPostFields()
</h3>
353 <p>Get previously set POST data.
</p>
354 <h3 id=
"HttpRequest_addPostFile">bool HttpRequest::addPostFile(string name, string file[, string content_type =
"application/x-octetstream"])
</h3>
355 <p>Add a file to the POST request.
<br />
356 Affects only POST requests.
</p>
357 <h3 id=
"HttpRequest_setPostFiles">bool HttpRequest::setPostFiles([array post_files])
</h3>
358 <p>Set files to post.
<br />
359 Overwrites previously set post files.
<br />
360 Affects only POST requests.
</p>
361 <h3 id=
"HttpRequest_getPostFiles">array HttpRequest::getPostFiles()
</h3>
362 <p>Get all previously added POST files.
</p>
363 <h3 id=
"HttpRequest_setPutFile">bool HttpRequest::setPutFile([string file])
</h3>
364 <p>Set file to put.
<br />
365 Affects only PUT requests.
</p>
366 <h3 id=
"HttpRequest_getPutFile">string HttpRequest::getPutFile()
</h3>
367 <p>Get previously set put file.
</p>
368 <h3 id=
"HttpRequest_getResponseData">array HttpRequest::getResponseData()
</h3>
369 <p>Get all response data after the request has been sent.
</p>
370 <h3 id=
"HttpRequest_getResponseHeader">mixed HttpRequest::getResponseHeader([string name])
</h3>
371 <p>Get response header(s) after the request has been sent.
</p>
372 <h3 id=
"HttpRequest_getResponseCookie">array HttpRequest::getResponseCookie([string name])
</h3>
373 <p>Get response cookie(s) after the request has been sent.
</p>
374 <h3 id=
"HttpRequest_getResponseBody">string HttpRequest::getResponseBody()
</h3>
375 <p>Get the response body after the request has been sent.
</p>
376 <h3 id=
"HttpRequest_getResponseCode">int HttpRequest::getResponseCode()
</h3>
377 <p>Get the response code after the request has been sent.
</p>
378 <h3 id=
"HttpRequest_getResponseInfo">array HttpRequest::getResponseInfo([string name])
</h3>
379 <p>Get response info after the request has been sent.
<br />
380 See http_get() for a full list of returned info.
</p>
381 <h3 id=
"HttpRequest_getResponseMessage">HttpMessage HttpRequest::getResponseMessage()
</h3>
382 <p>Get the full response as HttpMessage object.
</p>
383 <h3 id=
"HttpRequest_getRequestMessage">HttpMessage HttpRequest::getRequestMessage()
</h3>
384 <p>Get sent HTTP message.
</p>
385 <h3 id=
"HttpRequest_send">HttpMessage HttpRequest::send()
</h3>
386 <p>Send the HTTP request.
<br />
388 GET example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
389 <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">HTTP_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 />
391 </code></blockquote></pre><p>POST example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
392 <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">HTTP_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 />
394 </code></blockquote><br />
398 <h1>http_requestpool_object.c
</h1>
399 <h2 id=
"HttpRequestPool" class=
"o">HttpRequestPool
</h2>
400 <h3 id=
"HttpRequestPool___construct">void HttpRequestPool::__construct([HttpRequest request[, ...]])
</h3>
401 <p>Instantiate a new HttpRequestPool object. An HttpRequestPool is
<br />
402 able to send several HttpRequests in parallel.
<br />
404 Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
405 <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">HTTP_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">HTTP_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 />
407 </code></blockquote><br />
410 <h3 id=
"HttpRequestPool___destruct">void HttpRequestPool::__destruct()
</h3>
411 <p>Clean up HttpRequestPool object.
</p>
412 <h3 id=
"HttpRequestPool_reset">void HttpRequestPool::reset()
</h3>
413 <p>Detach all attached HttpRequest objects.
</p>
414 <h3 id=
"HttpRequestPool_attach">bool HttpRequestPool::attach(HttpRequest request)
</h3>
415 <p>Attach an HttpRequest object to this HttpRequestPool.
<br />
416 NOTE: set all options prior attaching!
</p>
417 <h3 id=
"HttpRequestPool_detach">bool HttpRequestPool::detach(HttpRequest request)
</h3>
418 <p>Detach an HttpRequest object from this HttpRequestPool.
</p>
419 <h3 id=
"HttpRequestPool_send">bool HttpRequestPool::send()
</h3>
420 <p>Send all attached HttpRequest objects in parallel.
</p>
421 <h3 id=
"HttpRequestPool_socketPerform">protected bool HttpRequestPool::socketSend()
</h3>
422 <p>Usage:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
423 <span style=
"color: #0000BB"><?php
<br /> </span><span style=
"color: #007700">while
(
</span><span style=
"color: #0000BB">$pool
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">socketPerform
</span><span style=
"color: #007700">())
{
<br /> </span><span style=
"color: #0000BB">do_something_else
</span><span style=
"color: #007700">();
<br /> if
(!
</span><span style=
"color: #0000BB">$pool
</span><span style=
"color: #007700">-
></span><span style=
"color: #0000BB">socketSelect
</span><span style=
"color: #007700">())
{
<br /> die(
</span><span style=
"color: #DD0000">'Socket
error'
</span><span style=
"color: #007700">);
<br /> }
<br /> }
<br /></span><span style=
"color: #0000BB">?
></span><br />
425 </code></blockquote><br />
428 <h3 id=
"HttpRequestPool_socketSelect">protected bool HttpRequestPool::socketSelect()
</h3>
429 <p>See HttpRequestPool::socketPerform().
</p>
430 <h3 id=
"HttpRequestPool_valid">bool HttpRequestPool::valid()
</h3>
431 <p>Implements Iterator::valid().
</p>
432 <h3 id=
"HttpRequestPool_current">HttpRequest HttpRequestPool::current()
</h3>
433 <p>Implements Iterator::current().
</p>
434 <h3 id=
"HttpRequestPool_key">long HttpRequestPool::key()
</h3>
435 <p>Implements Iterator::key().
</p>
436 <h3 id=
"HttpRequestPool_next">void HttpRequestPool::next()
</h3>
437 <p>Implements Iterator::next().
</p>
438 <h3 id=
"HttpRequestPool_rewind">void HttpRequestPool::rewind()
</h3>
439 <p>Implements Iterator::rewind().
</p>
441 <h1>http_response_object.c
</h1>
442 <h3 id=
"HttpResponse_setHeader">static bool HttpResponse::setHeader(string name, mixed value[, bool replace = true)
</h3>
444 <h3 id=
"HttpResponse_getHeader">static mixed HttpResponse::getHeader([string name])
</h3>
446 <h3 id=
"HttpResponse_setCache">static bool HttpResponse::setCache(bool cache)
</h3>
447 <p>Whether it sould be attempted to cache the entitity.
<br />
448 This will result in necessary caching headers and checks of clients
<br />
449 "If-Modified-Since" and
"If-None-Match" headers. If one of those headers
<br />
450 matches a
"304 Not Modified" status code will be issued.
<br />
452 NOTE: If you're using sessions, be shure that you set session.cache_limiter
<br />
453 to something more appropriate than
"no-cache"!
</p>
454 <h3 id=
"HttpResponse_getCache">static bool HttpResponse::getCache()
</h3>
455 <p>Get current caching setting.
</p>
456 <h3 id=
"HttpResponse_setGzip">static bool HttpResponse::setGzip(bool gzip)
</h3>
457 <p>Enable on-thy-fly gzipping of the sent entity.
</p>
458 <h3 id=
"HttpResponse_getGzip">static bool HttpResponse::getGzip()
</h3>
459 <p>Get current gzipping setting.
</p>
460 <h3 id=
"HttpResponse_setCacheControl">static bool HttpResponse::setCacheControl(string control[, long max_age =
0])
</h3>
461 <p>Set a custom cache-control header, usually being
"private" or
"public";
<br />
462 The max_age parameter controls how long the cache entry is valid on the client side.
</p>
463 <h3 id=
"HttpResponse_getCacheControl">static string HttpResponse::getCacheControl()
</h3>
464 <p>Get current Cache-Control header setting.
</p>
465 <h3 id=
"HttpResponse_setContentType">static bool HttpResponse::setContentType(string content_type)
</h3>
466 <p>Set the content-type of the sent entity.
</p>
467 <h3 id=
"HttpResponse_getContentType">static string HttpResponse::getContentType()
</h3>
468 <p>Get current Content-Type header setting.
</p>
469 <h3 id=
"HttpResponse_setContentDisposition">static bool HttpResponse::setContentDisposition(string filename[, bool inline = false])
</h3>
470 <p>Set the Content-Disposition of the sent entity. This setting aims to suggest
<br />
471 the receiveing user agent how to handle the sent entity; usually the client
<br />
472 will show the user a
"Save As..." popup.
</p>
473 <h3 id=
"HttpResponse_getContentDisposition">static string HttpResponse::getContentDisposition()
</h3>
474 <p>Get current Content-Disposition setting.
</p>
475 <h3 id=
"HttpResponse_setETag">static bool HttpResponse::setETag(string etag)
</h3>
476 <p>Set a custom ETag. Use this only if you know what you're doing.
</p>
477 <h3 id=
"HttpResponse_getETag">static string HttpResponse::getETag()
</h3>
478 <p>Get calculated or previously set custom ETag.
</p>
479 <h3 id=
"HttpResponse_setLastModified">static bool HttpResponse::setLastModified(long timestamp)
</h3>
480 <p>Set a custom Last-Modified date.
</p>
481 <h3 id=
"HttpResponse_getLastModified">static HttpResponse::getLastModified()
</h3>
482 <p>Get calculated or previously set custom Last-Modified date.
</p>
483 <h3 id=
"HttpResponse_setThrottleDelay">static bool HttpResponse::setThrottleDelay(double seconds)
</h3>
485 <h3 id=
"HttpResponse_getThrottleDelay">static double HttpResponse::getThrottleDelay()
</h3>
487 <h3 id=
"HttpResponse_setBufferSize">static bool HttpResponse::setBufferSize(long bytes)
</h3>
489 <h3 id=
"HttpResponse_getBufferSize">static long HttpResponse::getBufferSize()
</h3>
491 <h3 id=
"HttpResponse_setData">static bool HttpResponse::setData(string data)
</h3>
492 <p>Set the data to be sent.
</p>
493 <h3 id=
"HttpResponse_getData">static string HttpResponse::getData()
</h3>
494 <p>Get the previously set data to be sent.
</p>
495 <h3 id=
"HttpResponse_setStream">static bool HttpResponse::setStream(resource stream)
</h3>
496 <p>Set the resource to be sent.
</p>
497 <h3 id=
"HttpResponse_getStream">static resource HttpResponse::getStream()
</h3>
498 <p>Get the previously set resource to be sent.
</p>
499 <h3 id=
"HttpResponse_setFile">static bool HttpResponse::setFile(string file)
</h3>
500 <p>Set the file to be sent.
</p>
501 <h3 id=
"HttpResponse_getFile">static string HttpResponse::getFile()
</h3>
502 <p>Get the previously set file to be sent.
</p>
503 <h3 id=
"HttpResponse_send">static bool HttpResponse::send([bool clean_ob = true])
</h3>
504 <p>Finally send the entity.
<br />
506 Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
507 <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 />
509 </code></blockquote><br />
512 <h3 id=
"HttpResponse_capture">static void HttpResponse::capture()
</h3>
513 <p>Capture script output.
<br />
515 Example:
</p><pre><blockquote><code><span style=
"color: #000000"><br />
516 <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 />//
note
that
you
need
to
call
<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: #FF8000">//
at
the
end
of
the
script
unless
<br />//
you
use
PHP-
5.1 or
greater
<br /></span><span style=
"color: #0000BB">?
></span><br />
518 </code></blockquote><br />
522 <p><b>Generated at: Fri,
26 Aug
2005 11:
08:
03 +
0000</b></p>