X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=docs%2Ffunctions.html;h=b815071d31a3cf5b33523658f2e578956c086127;hb=9cffeb53e0c4b03192092d2f58965bb35f599cab;hp=f785fd092f8916f6c99c7a4757743875670650a3;hpb=a0098fdbfef71be0fab417b5bc624dc884bd4549;p=m6w6%2Fext-http diff --git a/docs/functions.html b/docs/functions.html index f785fd0..b815071 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -113,6 +113,19 @@ if none match.
<?phpThis function negotiates the clients preferred content type based on its
+Accept HTTP header. The qualifier is recognized and content types
+without qualifier are rated highest.
Expects an array as parameter cotaining the supported content types as values.
+If the optional second parameter is supplied, it will be filled with an
+array containing the negotiation results.
Returns the negotiated content type or the default content type
+(i.e. first array entry) if none match.
Example:
+
+<?php
$ctypes = array('application/xhtml+xml', 'text/html');
http_send_content_type(http_negotiate_content_type($ctypes));
?>
+
Send HTTP status code.
Expects an HTTP status code as parameter.
@@ -179,7 +192,7 @@ a "304 Not Modified" status code is issued.For use with ob_start(). Output buffer handler generating an ETag with
the hash algorythm specified with the INI setting "http.etag_mode".
Sets the throttle delay and send buffer size for use with http_send() API.
Provides a basic throttling mechanism, which will yield the current process
resp. thread until the entity has been completely sent, though.
- redirect: - compress: bool, whether to allow gzip/deflate content encoding
(defaults to true)
- port: int, use another port as specified in the url
- - referer: string, the referer to sends
+ - referer: string, the referer to send
- useragent: string, the user agent to send
(defaults to PECL::HTTP/version (PHP/version)))
- headers: array, list of custom headers as associative array
@@ -374,7 +387,7 @@ compression ratio.Check for feature that require external libraries.
Accpepts an optional in parameter specifying which feature to probe for.
+all supported features that depend on external libraries.
If the parameter is 0 or omitted, the return value contains a bitmask of
-all supported featuers that depend on external libraries.Available features to probe for are:
Returns the full message as string.
+Implements Countable.
+Returns the number of parent messages + 1.
+Implements Serializable.
+Returns the serialized representation of the HttpMessage.
+Implements Serializable.
+Re-constructs the HttpMessage based upon the serialized string.
Note that the internal request message is immutable, that means that the
+request message received through HttpRequest::getRequestMessage() will
+always look the same for the same request, regardless of any changes you
+may have made to the returned object.
Throws HttpMalformedHeadersException, HttpEncodingException.
Get all sent requests and received responses as an HttpMessage object.
If you don't want to record history at all, set the instance variable
@@ -705,12 +730,18 @@ HttpRequest::$recoedHistory to FALSE.
The object references the last received response, use HttpMessage::getParentMessage()
to access the data of previously sent requests and received responses.
Throws HttpMalformedHeaderException.
+Note that the internal history is immutable, that means that any changes
+you make the the message list won't affect a history message list newly
+created by another call to HttpRequest::getHistory().
Throws HttpMalformedHeaderException, HttpEncodingException.
Clear the history.
Send the HTTP request.
Returns the received response as HttpMessage object.
+NOTE: While an exception may be thrown, the transfer could have succeeded
+at least partially, so you might want to check the return values of various
+HttpRequest::getResponse*() methods.
Throws HttpRuntimeException, HttpRequestException,
HttpMalformedHeaderException, HttpEncodingException.
GET example:
@@ -762,7 +793,7 @@ HttpRequestPoolException, HttpMalformedHeaderException.protected bool HttpRequestPool::socketPerform()
Returns TRUE until each request has finished its transaction.
Usage:
-<?php
while ($pool->socketPerform()) {
do_something_else();
if (!$pool->socketSelect()) {
die('Socket error');
}
}
?>
+<?php
class MyPool extends HttpRequestPool
{
public function send()
{
while ($this->socketPerform()) {
if (!$this->socketSelect()) {
throw new HttpSocketExcpetion;
}
}
}
protected final function socketPerform()
{
$result = parent::socketPerform();
foreach ($this->getFinishedRequests() as $r) {
$this->detach($r);
// handle response of finished request
}
return $result;
}
}
?>
protected bool HttpRequestPool::socketSelect()
@@ -778,6 +809,16 @@ HttpRequestPoolException, HttpMalformedHeaderException.Implements Iterator::next().
void HttpRequestPool::rewind()
Implements Iterator::rewind().
+int HttpRequestPool::count()
+Implements Countable.
+Returns the number of attached HttpRequest objects.
+array HttpRequestPool::getAttachedRequests()
+Get attached HttpRequest objects.
+Returns an array containing all currently attached HttpRequest objects.
+array HttpRequestPool::getFinishedRequests()
+Get attached HttpRequest objects that already have finished their work.
+Returns an array containing all attached HttpRequest objects that
+already have finished their work.
http_response_object.c
static bool HttpResponse::setHeader(string name, mixed value[, bool replace = true])
@@ -946,6 +987,8 @@ http.cache_log is set.http_negotiate_charset +http_negotiate_content_type + http_send_status http_send_last_modified @@ -1046,6 +1089,9 @@ http.cache_log is set. HttpMessage::getParentMessage() HttpMessage::send() HttpMessage::toString() +HttpMessage::count() +HttpMessage::serialize() +HttpMessage::unserialize() @@ -1113,6 +1159,9 @@ http.cache_log is set.HttpRequestPool::key() HttpRequestPool::next() HttpRequestPool::rewind() +HttpRequestPool::count() +HttpRequestPool::getAttachedRequests() +HttpRequestPool::getFinishedRequests() @@ -1152,7 +1201,7 @@ http.cache_log is set. -Generated at: Tue, 11 Oct 2005 11:33:16 +0000
+Generated at: Mon, 21 Nov 2005 16:56:18 +0100