X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=docs%2Ffunctions.html;h=d00adae33987548fd6e00520bc1cbc6cc66439dd;hb=693d9b2fa7b012575d4cee54b109264b269a3bda;hp=a1f90247bd8e14596b98abde42fb5b7a1b11710b;hpb=a84e2e5f8fa39386883754b6ab8bcd7fbfb5ed94;p=m6w6%2Fext-http diff --git a/docs/functions.html b/docs/functions.html index a1f9024..d00adae 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -170,6 +170,8 @@ content body. The returned array may look simliar to the following example:
<Get a list of incoming HTTP headers.
+Get the raw request body (e.g. POST or PUT data).
Match an incoming HTTP header.
Generates a form-encoded query string from an associative array or object.
Instantiates a new HttpResponse object, which can be used to send
-any data/resource/file to an HTTP client with caching and multiple
-ranges/resuming support.
-
-NOTE: GZIPping is not implemented yet.
Whether it sould be attempted to cache the entitity.
-This will result in necessary caching headers and checks of clients
-"If-Modified-Since" and "If-None-Match" headers. If one of those headers
-matches a "304 Not Modified" status code will be issued.
-
-NOTE: If you're using sessions, be shure that you set session.cache_limiter
-to something more appropriate than "no-cache"!
Get current caching setting.
-Enable on-thy-fly gzipping of the sent entity. NOT IMPLEMENTED YET.
-Get current gzipping setting.
-Set a custom cache-control header, usually being "private" or "public"; if
-$raw is set to true the header will be sent as-is.
Get current Cache-Control header setting.
-Set the content-type of the sent entity.
-Get current Content-Type header setting.
-Set the Content-Disposition of the sent entity. This setting aims to suggest
-the receiveing user agent how to handle the sent entity; usually the client
-will show the user a "Save As..." popup.
Get current Content-Disposition setting.
-Will return an associative array like:
array(-
- 'filename' => 'foo.bar',
- 'inline' => false
-)
-
Set a custom ETag. Use this only if you know what you're doing.
-Get the previously set custom ETag.
-Set the data to be sent.
-Get the previously set data to be sent.
-Set the resource to be sent.
-Get the previously set resource to be sent.
-Set the file to be sent.
-Get the previously set file to be sent.
-Finally send the entity.
-
-Example:
+
-<?php
$r = new HttpResponse(true);
$r->setFile('../hidden/contract.pdf');
$r->setContentType('application/pdf');
$r->send();
?>
-
-
-
-
Instantiate a new HttpMessage object.
@@ -377,6 +305,8 @@ Returns false if version is invalid (1.0 and 1.1).Send the Message according to its type as Response or Request.
Get the string representation of the Message.
+Instantiate a new HttpRequest object which can be used to issue HEAD, GET
@@ -407,9 +337,9 @@ and POST (including posting files) HTTP requests.
Get previously set cookies.
Set the request URL.
-Get the previously set request URL.
Set the request methods; one of the HTTP_HEAD, HTTP_GET or
@@ -448,7 +378,7 @@ Affects only POST requests.
Add a file to the POST request.
Affects only POST requests.
Set files to post.
Overwrites previously set post files.
Affects only POST requests.
Generated at: Mon, 6 Jun 2005 13:44:11 +0200
+Instantiate a new HttpRequestPool object. An HttpRequestPool is
+able to send several HttpRequests in parallel.
+
+Example:
+
+<?php
$urls = array('www.php.net', 'pecl.php.net', 'pear.php.net')
$pool = new HttpRequestPool;
foreach ($urls as $url) {
$req[$url] = new HttpRequest("http://$url", HTTP_HEAD);
$pool->attach($req[$url]);
}
$pool->send();
foreach ($urls as $url) {
printf("%s (%s) is %s\n",
$url, $req[$url]->getResponseInfo('effective_url'),
$r->getResponseCode() == 200 ? 'alive' : 'not alive'
);
}
?>
+
+
+
+
Clean up HttpRequestPool object.
+Detach all attached HttpRequest objects.
+Attach an HttpRequest object to this HttpRequestPool.
+NOTE: set all options prior attaching!
Detach an HttpRequest object from this HttpRequestPool.
+Send all attached HttpRequest objects in parallel.
+Usage:
+
+<?php
while ($pool->socketSend()) {
do_something_else();
if (!$pool->socketSelect()) {
die('Socket error');
}
}
$pool->socketRead();
?>
+
+
+
+
See HttpRequestPool::socketSend().
+See HttpRequestPool::socketSend().
+Whether it sould be attempted to cache the entitity.
+This will result in necessary caching headers and checks of clients
+"If-Modified-Since" and "If-None-Match" headers. If one of those headers
+matches a "304 Not Modified" status code will be issued.
+
+NOTE: If you're using sessions, be shure that you set session.cache_limiter
+to something more appropriate than "no-cache"!
Get current caching setting.
+Enable on-thy-fly gzipping of the sent entity. NOT IMPLEMENTED YET.
+Get current gzipping setting.
+Set a custom cache-control header, usually being "private" or "public";
+The max_age parameter controls how long the cache entry is valid on the client side.
Get current Cache-Control header setting.
+Set the content-type of the sent entity.
+Get current Content-Type header setting.
+Set the Content-Disposition of the sent entity. This setting aims to suggest
+the receiveing user agent how to handle the sent entity; usually the client
+will show the user a "Save As..." popup.
Get current Content-Disposition setting.
+Set a custom ETag. Use this only if you know what you're doing.
+Get the previously set custom ETag.
+Set the data to be sent.
+Get the previously set data to be sent.
+Set the resource to be sent.
+Get the previously set resource to be sent.
+Set the file to be sent.
+Get the previously set file to be sent.
+Finally send the entity.
+
+Example:
+
+<?php
HttpResponse::setCache(true);
HttpResponse::setContentType('application/pdf');
HttpResponse::setContentDisposition("$user.pdf", false);
HttpResponse::setFile('sheet.pdf');
HttpResponse::send();
?>
+
+
+
+
Capture script output.
+
+Example:
+
+<?php
HttpResponse::setCache(true);
HttpResponse::capture();
// script follows
?>
+
+
+
+
Generated at: Fri, 22 Jul 2005 17:44:59 +0200