let DEV_2 be trunk
authorMichael Wallner <mike@php.net>
Thu, 21 Nov 2013 10:25:13 +0000 (10:25 +0000)
committerMichael Wallner <mike@php.net>
Thu, 21 Nov 2013 10:25:13 +0000 (10:25 +0000)
376 files changed:
.travis.yml [new file with mode: 0644]
Exceptions.txt [new file with mode: 0644]
KnownIssues.txt
LICENSE
Makefile.frag [deleted file]
TODO [new file with mode: 0644]
ThanksTo.txt
bench_select_vs_event.php [new file with mode: 0644]
config.m4
config.w32
config9.m4
docs/examples/tutorial.txt [deleted file]
docs/functions.html [deleted file]
docs/http.ini [deleted file]
funcsummary.php [deleted file]
gen_curlinfo.php [new file with mode: 0644]
http.c [deleted file]
http.dsp [deleted file]
http_api.c [deleted file]
http_cache_api.c [deleted file]
http_cookie_api.c [deleted file]
http_date_api.c [deleted file]
http_deflatestream_object.c [deleted file]
http_encoding_api.c [deleted file]
http_exception_object.c [deleted file]
http_filter_api.c [deleted file]
http_functions.c [deleted file]
http_headers_api.c [deleted file]
http_inflatestream_object.c [deleted file]
http_info_api.c [deleted file]
http_message_api.c [deleted file]
http_message_object.c [deleted file]
http_persistent_handle_api.c [deleted file]
http_querystring_api.c [deleted file]
http_querystring_object.c [deleted file]
http_request_api.c [deleted file]
http_request_body_api.c [deleted file]
http_request_datashare_api.c [deleted file]
http_request_info.c [deleted file]
http_request_method_api.c [deleted file]
http_request_object.c [deleted file]
http_request_pool_api.c [deleted file]
http_requestdatashare_object.c [deleted file]
http_requestpool_object.c [deleted file]
http_response_object.c [deleted file]
http_send_api.c [deleted file]
http_url_api.c [deleted file]
http_util_object.c [deleted file]
lib/BigGet.php [deleted file]
lib/FeedAggregator.php [deleted file]
lib/PgLobStream.php [deleted file]
lib/XmlRpcClient.php [deleted file]
lib/XmlRpcServer.php [deleted file]
missing.c [deleted file]
missing.h [deleted file]
package.xml
php_http.c [new file with mode: 0644]
php_http.h
php_http_api.h
php_http_buffer.c [new file with mode: 0644]
php_http_buffer.h [new file with mode: 0644]
php_http_cache_api.h [deleted file]
php_http_client.c [new file with mode: 0644]
php_http_client.h [new file with mode: 0644]
php_http_client_curl.c [new file with mode: 0644]
php_http_client_curl.h [new file with mode: 0644]
php_http_client_request.c [new file with mode: 0644]
php_http_client_request.h [new file with mode: 0644]
php_http_client_response.c [new file with mode: 0644]
php_http_client_response.h [new file with mode: 0644]
php_http_cookie.c [new file with mode: 0644]
php_http_cookie.h [new file with mode: 0644]
php_http_cookie_api.h [deleted file]
php_http_curl.c [new file with mode: 0644]
php_http_curl.h [new file with mode: 0644]
php_http_date_api.h [deleted file]
php_http_deflatestream_object.h [deleted file]
php_http_encoding.c [new file with mode: 0644]
php_http_encoding.h [new file with mode: 0644]
php_http_encoding_api.h [deleted file]
php_http_env.c [new file with mode: 0644]
php_http_env.h [new file with mode: 0644]
php_http_env_request.c [new file with mode: 0644]
php_http_env_request.h [new file with mode: 0644]
php_http_env_response.c [new file with mode: 0644]
php_http_env_response.h [new file with mode: 0644]
php_http_etag.c [new file with mode: 0644]
php_http_etag.h [new file with mode: 0644]
php_http_exception.c [new file with mode: 0644]
php_http_exception.h [new file with mode: 0644]
php_http_exception_object.h [deleted file]
php_http_filter.c [new file with mode: 0644]
php_http_filter.h [new file with mode: 0644]
php_http_filter_api.h [deleted file]
php_http_header.c [new file with mode: 0644]
php_http_header.h [new file with mode: 0644]
php_http_header_parser.c [new file with mode: 0644]
php_http_header_parser.h [new file with mode: 0644]
php_http_headers_api.h [deleted file]
php_http_inflatestream_object.h [deleted file]
php_http_info.c [new file with mode: 0644]
php_http_info.h [new file with mode: 0644]
php_http_info_api.h [deleted file]
php_http_message.c [new file with mode: 0644]
php_http_message.h [new file with mode: 0644]
php_http_message_api.h [deleted file]
php_http_message_body.c [new file with mode: 0644]
php_http_message_body.h [new file with mode: 0644]
php_http_message_object.h [deleted file]
php_http_message_parser.c [new file with mode: 0644]
php_http_message_parser.h [new file with mode: 0644]
php_http_misc.c [new file with mode: 0644]
php_http_misc.h [new file with mode: 0644]
php_http_negotiate.c [new file with mode: 0644]
php_http_negotiate.h [new file with mode: 0644]
php_http_object.c [new file with mode: 0644]
php_http_object.h [new file with mode: 0644]
php_http_options.c [new file with mode: 0644]
php_http_options.h [new file with mode: 0644]
php_http_params.c [new file with mode: 0644]
php_http_params.h [new file with mode: 0644]
php_http_persistent_handle_api.h [deleted file]
php_http_querystring.c [new file with mode: 0644]
php_http_querystring.h [new file with mode: 0644]
php_http_querystring_api.h [deleted file]
php_http_querystring_object.h [deleted file]
php_http_request_api.h [deleted file]
php_http_request_body_api.h [deleted file]
php_http_request_datashare_api.h [deleted file]
php_http_request_int.h [deleted file]
php_http_request_method_api.h [deleted file]
php_http_request_object.h [deleted file]
php_http_request_pool_api.h [deleted file]
php_http_requestdatashare_object.h [deleted file]
php_http_requestpool_object.h [deleted file]
php_http_response_object.h [deleted file]
php_http_send_api.h [deleted file]
php_http_std_defs.h [deleted file]
php_http_strlist.c [new file with mode: 0644]
php_http_strlist.h [new file with mode: 0644]
php_http_url.c [new file with mode: 0644]
php_http_url.h [new file with mode: 0644]
php_http_url_api.h [deleted file]
php_http_util_object.h [deleted file]
php_http_version.c [new file with mode: 0644]
php_http_version.h [new file with mode: 0644]
phpstr/phpstr.c [deleted file]
phpstr/phpstr.h [deleted file]
phpunit.php [new file with mode: 0644]
phpunit/CookieTest.php [new file with mode: 0644]
phpunit/EncodingTest.php [new file with mode: 0644]
phpunit/MessageBodyTest.php [new file with mode: 0644]
phpunit/ParamsTest.php [new file with mode: 0644]
phpunit/QueryStringTest.php [new file with mode: 0644]
phpunit/UrlTest.php [new file with mode: 0644]
rebuild [deleted file]
reflection2php.php [new file with mode: 0755]
scripts/bench_select_vs_event.php [deleted file]
scripts/check_docs.php [deleted file]
scripts/gen_curlinfo.php [deleted file]
tests/HttpMessage_001.phpt [deleted file]
tests/HttpMessage_002.phpt [deleted file]
tests/HttpMessage_003.phpt [deleted file]
tests/HttpMessage_004.phpt [deleted file]
tests/HttpMessage_005.phpt [deleted file]
tests/HttpMessage_006.phpt [deleted file]
tests/HttpMessage_007.phpt [deleted file]
tests/HttpMessage_008.phpt [deleted file]
tests/HttpMessage_009_bug16700.phpt [deleted file]
tests/HttpQueryString_001.phpt [deleted file]
tests/HttpQueryString_002.phpt [deleted file]
tests/HttpQueryString_003.phpt [deleted file]
tests/HttpQueryString_004.phpt [deleted file]
tests/HttpRequestDataShare_001.phpt [deleted file]
tests/HttpRequestDataShare_002.phpt [deleted file]
tests/HttpRequestPool_001.phpt [deleted file]
tests/HttpRequestPool_002.phpt [deleted file]
tests/HttpRequestPool_003.phpt [deleted file]
tests/HttpRequestPool_004.phpt [deleted file]
tests/HttpRequestPool_005.phpt [deleted file]
tests/HttpRequestPool_006.phpt [deleted file]
tests/HttpRequestPool_007.phpt [deleted file]
tests/HttpRequest_001.phpt [deleted file]
tests/HttpRequest_002.phpt [deleted file]
tests/HttpRequest_003.phpt [deleted file]
tests/HttpRequest_004.phpt [deleted file]
tests/HttpRequest_005.phpt [deleted file]
tests/HttpRequest_006.phpt [deleted file]
tests/HttpRequest_007.phpt [deleted file]
tests/HttpRequest_008.phpt [deleted file]
tests/HttpRequest_009.phpt [deleted file]
tests/HttpRequest_010.phpt [deleted file]
tests/HttpResponse_001.phpt [deleted file]
tests/HttpResponse_002.phpt [deleted file]
tests/HttpResponse_003.phpt [deleted file]
tests/HttpResponse_004.phpt [deleted file]
tests/HttpResponse_005.phpt [deleted file]
tests/allowed_methods_002.phpt [deleted file]
tests/allowed_methods_002_logging.phpt [deleted file]
tests/bug61444.phpt [new file with mode: 0644]
tests/bug_15800.phpt [deleted file]
tests/build_str_001.phpt [deleted file]
tests/build_url_001.phpt [deleted file]
tests/build_url_002.phpt [deleted file]
tests/build_url_003.phpt [deleted file]
tests/build_url_004.phpt [deleted file]
tests/chunked_decode_001.phpt [deleted file]
tests/chunked_decode_002.phpt [deleted file]
tests/chunked_decode_003.phpt [deleted file]
tests/chunked_decode_004.phpt [deleted file]
tests/client001.phpt [new file with mode: 0644]
tests/client002.phpt [new file with mode: 0644]
tests/client003.phpt [new file with mode: 0644]
tests/client004.phpt [new file with mode: 0644]
tests/client005.phpt [new file with mode: 0644]
tests/client006.phpt [new file with mode: 0644]
tests/client007.phpt [new file with mode: 0644]
tests/client008.phpt [new file with mode: 0644]
tests/client009.phpt [new file with mode: 0644]
tests/client010.phpt [new file with mode: 0644]
tests/client011.phpt [new file with mode: 0644]
tests/client012.phpt [new file with mode: 0644]
tests/client013.phpt [new file with mode: 0644]
tests/clientrequest001.phpt [new file with mode: 0644]
tests/clientrequest002.phpt [new file with mode: 0644]
tests/clientrequest003.phpt [new file with mode: 0644]
tests/clientrequest004.phpt [new file with mode: 0644]
tests/clientresponse001.phpt [new file with mode: 0644]
tests/clientresponse002.phpt [new file with mode: 0644]
tests/clientresponse003.phpt [new file with mode: 0644]
tests/cloning_001.phpt [deleted file]
tests/data.txt [deleted file]
tests/data/message_r_multipart_put.txt [new file with mode: 0644]
tests/data/message_rr_empty.txt [new file with mode: 0644]
tests/data/message_rr_empty_chunked.txt [new file with mode: 0644]
tests/data/message_rr_empty_gzip.txt [new file with mode: 0644]
tests/data/message_rr_helloworld_chunked.txt [new file with mode: 0644]
tests/data/urls.txt [new file with mode: 0644]
tests/date_001.phpt [deleted file]
tests/date_002.phpt [deleted file]
tests/encoding_objects_001.phpt [deleted file]
tests/encodings.phpt [deleted file]
tests/envrequestbody001.phpt [new file with mode: 0644]
tests/envrequestbody002.phpt [new file with mode: 0644]
tests/envrequestbody003.phpt [new file with mode: 0644]
tests/envrequestfiles001.phpt [new file with mode: 0644]
tests/envrequestfiles002.phpt [new file with mode: 0644]
tests/envrequestform.phpt [new file with mode: 0644]
tests/envrequestheader001.phpt [new file with mode: 0644]
tests/envrequestjson001.phpt [new file with mode: 0644]
tests/envrequestjson002.phpt [new file with mode: 0644]
tests/envrequestquery.phpt [new file with mode: 0644]
tests/envresponse001.phpt [new file with mode: 0644]
tests/envresponse002.phpt [new file with mode: 0644]
tests/envresponse003.phpt [new file with mode: 0644]
tests/envresponse004.phpt [new file with mode: 0644]
tests/envresponse005.phpt [new file with mode: 0644]
tests/envresponse006.phpt [new file with mode: 0644]
tests/envresponse007.phpt [new file with mode: 0644]
tests/envresponse008.phpt [new file with mode: 0644]
tests/envresponse009.phpt [new file with mode: 0644]
tests/envresponse010.phpt [new file with mode: 0644]
tests/envresponse011.phpt [new file with mode: 0644]
tests/envresponse012.phpt [new file with mode: 0644]
tests/envresponse013.phpt [new file with mode: 0644]
tests/envresponse014.phpt [new file with mode: 0644]
tests/envresponsebody001.phpt [new file with mode: 0644]
tests/envresponsebody002.phpt [new file with mode: 0644]
tests/envresponsecodes.phpt [new file with mode: 0644]
tests/envresponseheader001.phpt [new file with mode: 0644]
tests/envresponseranges001.phpt [new file with mode: 0644]
tests/etag001.phpt [new file with mode: 0644]
tests/etag_mode_031.phpt [deleted file]
tests/etag_mode_032.phpt [deleted file]
tests/etag_mode_033.phpt [deleted file]
tests/etag_mode_034.phpt [deleted file]
tests/etag_mode_041.phpt [deleted file]
tests/etag_mode_042.phpt [deleted file]
tests/etag_mode_043.phpt [deleted file]
tests/etag_mode_044.phpt [deleted file]
tests/exceptions.phpt [deleted file]
tests/filterchunked.phpt [new file with mode: 0644]
tests/filterzlib.phpt [new file with mode: 0644]
tests/get_request_data_001.phpt [deleted file]
tests/header001.phpt [new file with mode: 0644]
tests/header002.phpt [new file with mode: 0644]
tests/header003.phpt [new file with mode: 0644]
tests/header004.phpt [new file with mode: 0644]
tests/header005.phpt [new file with mode: 0644]
tests/header006.phpt [new file with mode: 0644]
tests/header007.phpt [new file with mode: 0644]
tests/header008.phpt [new file with mode: 0644]
tests/header009.phpt [new file with mode: 0644]
tests/info.phpt [new file with mode: 0644]
tests/info_001.phpt [new file with mode: 0644]
tests/log.inc [deleted file]
tests/match_request_header_001.phpt [deleted file]
tests/message001.phpt [new file with mode: 0644]
tests/message002.phpt [new file with mode: 0644]
tests/message003.phpt [new file with mode: 0644]
tests/message004.phpt [new file with mode: 0644]
tests/message005.phpt [new file with mode: 0644]
tests/message006.phpt [new file with mode: 0644]
tests/message007.phpt [new file with mode: 0644]
tests/message008.phpt [new file with mode: 0644]
tests/message009.phpt [new file with mode: 0644]
tests/message010.phpt [new file with mode: 0644]
tests/message011.phpt [new file with mode: 0644]
tests/message012.phpt [new file with mode: 0644]
tests/message013.phpt [new file with mode: 0644]
tests/message014.phpt [new file with mode: 0644]
tests/message015.phpt [new file with mode: 0644]
tests/negotiate001.phpt [new file with mode: 0644]
tests/negotiation_001.phpt [deleted file]
tests/ob_deflatehandler_001.phpt [deleted file]
tests/ob_inflatehandler_001.phpt [deleted file]
tests/params001.phpt [new file with mode: 0644]
tests/params002.phpt [new file with mode: 0644]
tests/parse_cookie_001.phpt [deleted file]
tests/parse_cookie_002.phpt [deleted file]
tests/parse_headers_001.phpt [deleted file]
tests/parse_message_001.phpt [deleted file]
tests/parse_message_002.phpt [deleted file]
tests/parse_message_003.phpt [deleted file]
tests/parse_message_004.phpt [deleted file]
tests/parse_message_005.phpt [deleted file]
tests/parse_message_006.phpt [deleted file]
tests/parse_params_001.phpt [deleted file]
tests/persistent_handles_001.phpt [deleted file]
tests/persistent_handles_002.phpt [deleted file]
tests/persistent_handles_003.phpt [deleted file]
tests/phpunit.phpt [new file with mode: 0644]
tests/propertyproxy001.phpt [new file with mode: 0644]
tests/querystring_001.phpt [new file with mode: 0644]
tests/redirect_011.phpt [deleted file]
tests/redirect_011_logging.phpt [deleted file]
tests/redirect_012.phpt [deleted file]
tests/redirect_012_logging.phpt [deleted file]
tests/redirect_013.phpt [deleted file]
tests/redirect_013_logging.phpt [deleted file]
tests/request_cookies.phpt [deleted file]
tests/request_etag.phpt [deleted file]
tests/request_gzip.phpt [deleted file]
tests/request_methods.phpt [deleted file]
tests/request_put_data.phpt [deleted file]
tests/send_data_001.phpt [deleted file]
tests/send_data_002.phpt [deleted file]
tests/send_data_003.phpt [deleted file]
tests/send_data_004.phpt [deleted file]
tests/send_data_005.phpt [deleted file]
tests/send_data_006.phpt [deleted file]
tests/send_data_007.phpt [deleted file]
tests/send_data_008.phpt [deleted file]
tests/send_data_010.phpt [deleted file]
tests/send_data_011.phpt [deleted file]
tests/send_failed_precond_001.phpt [deleted file]
tests/send_file_005.phpt [deleted file]
tests/send_file_006.phpt [deleted file]
tests/send_file_007.phpt [deleted file]
tests/send_file_008.phpt [deleted file]
tests/send_file_009.phpt [deleted file]
tests/send_file_010.phpt [deleted file]
tests/send_file_011.phpt [deleted file]
tests/send_file_012.phpt [deleted file]
tests/send_file_013.phpt [deleted file]
tests/send_ifrange_001.phpt [deleted file]
tests/send_ifrange_003.phpt [deleted file]
tests/serialize001.phpt [new file with mode: 0644]
tests/skip.inc [deleted file]
tests/skipif.inc [new file with mode: 0644]
tests/stream_filters_001.phpt [deleted file]
tests/stream_filters_002.phpt [deleted file]
tests/stream_filters_003.phpt [deleted file]
tests/url001.phpt [new file with mode: 0644]
tests/urls.txt [deleted file]
tests/version001.phpt [new file with mode: 0644]

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..7dc1227
--- /dev/null
@@ -0,0 +1,10 @@
+language: php
+
+php:
+  - 5.3
+  - 5.4
+
+before_script: phpize
+
+script: ./configure && make && NO_INTERACTION=1 REPORT_EXIT_STATUS=1 TEST_PHP_DETAILED=1 make test
+
diff --git a/Exceptions.txt b/Exceptions.txt
new file mode 100644 (file)
index 0000000..f666ee9
--- /dev/null
@@ -0,0 +1,4 @@
+# Throw Exceptions:
+
+* on setters, that return self
+* on getters, that return objects
index 96b3c0e..4c2ad80 100644 (file)
@@ -1,18 +1,11 @@
 Known Issues
 ============
-$Id$
-
-PHP < 5.1.3:
-       HttpResponse::getHeader() does not work with Apache2 SAPIs.
-       Using an encoding stream filter on a stream you read from doesn't work.
 
 Windows:
        If you keep getting "SSL connect error" when trying to issue 
                requests, try another (newer) libeay32.dll/ssleay32.dll pair.
 
 Internals:
-       Our http_urlencode_hash() does not differentiate between prefixes
-               for numeric or string keys.
        Inflating raw deflated data causes a re-initialization of the inflate
                stream where the corresponding window bits are modified to tell libz
                to not check for zlib header bytes.  This is not preventable AFAICS.
@@ -22,12 +15,11 @@ Internals:
                as libcurl saves the cookies to the file on curl_easy_destroy(),
                cookies are not saved until the CURL handle will be recycled.
                        Thus one would either need to
-                               * run PHP with http.persistent.handles.limit = 0
-                               * call http_persistent_handles_clean() every request
-                               * call $HttpRequest->flushCookies(), which is available
+                               * run PHP with raphf.persistent_handles.limit = 0
+                               * call raphf\persistent_handles_clean() every request
+                               * call $client->flushCookies(), which is available
                                  since libcurl v7.17.1 and does not work with the
                                  procedural API
-                       Anyway, none of these options is really perfect.
        HTTP and Proxy authentication information (username/password) can not be
                unset with NULL prior libcurl v7.19.6 and separate options for setting
                username and password--which work--are only available since v7.19.6.
diff --git a/LICENSE b/LICENSE
index 2651305..0fa6885 100644 (file)
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2010, Michael Wallner <mike@iworks.at>.
+Copyright (c) 2004-2013, Michael Wallner <mike@iworks.at>.
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without 
@@ -21,27 +21,3 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-===============================================================================
-
-The date parser in file http_date_api.c is derived from the implementation
-found in the original libcurl source, licensed under the following conditions:
-
-Copyright (c) 1996 - 2006, Daniel Stenberg, <daniel@haxx.se>.
-All rights reserved.
-
-Permission to use, copy, modify, and distribute this software for any purpose
-with or without fee is hereby granted, provided that the above copyright
-notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
-NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
-OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder shall not
-be used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization of the copyright holder.
-
diff --git a/Makefile.frag b/Makefile.frag
deleted file mode 100644 (file)
index f019ecc..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-# vim: noet ts=1 sw=1
-
-phpincludedir=$(prefix)/include/php
-
-install-http: install install-http-headers
-
-install-http-headers:
-       @echo "Installing HTTP headers:          $(INSTALL_ROOT)$(phpincludedir)/ext/http/"
-       @$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/http
-       @for f in $(PHP_HTTP_HEADERS); do \
-               if test -f "$(top_srcdir)/$$f"; then \
-                       $(INSTALL_DATA) $(top_srcdir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
-               elif test -f "$(top_builddir)/$$f"; then \
-                       $(INSTALL_DATA) $(top_builddir)/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
-               elif test -f "$(top_srcdir)/ext/http/$$f"; then \
-                       $(INSTALL_DATA) $(top_srcdir)/ext/http/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
-               elif test -f "$(top_builddir)/ext/http/$$f"; then \
-                       $(INSTALL_DATA) $(top_builddir)/ext/http/$$f $(INSTALL_ROOT)$(phpincludedir)/ext/http; \
-               else \
-                       echo "WTF? $$f"; \
-               fi \
-       done;
-
diff --git a/TODO b/TODO
new file mode 100644 (file)
index 0000000..db7d39d
--- /dev/null
+++ b/TODO
@@ -0,0 +1,8 @@
+* let http_info.request.url be a php_url
+* let the message body be a simple query string unless files are added
+* php_http_message_serialize reverses the chain twice; remove that
+* revisit error handling
+ * ditch http\Object
+ * interfacize http\Exception
+ * subclass Exceptions
+ * zend_throw_exception
\ No newline at end of file
index e736e4c..48003f9 100644 (file)
@@ -1,13 +1,14 @@
 Thanks To
 =========
-$Id$
 
 People who repeatedly reported issues with this extension in a manner
 so they could be fixed in a reasonable way, or suggested useful features
 to implement, in alphabetical order:
 
        Ilia Alshanetsky (ilia at php dot net)
+       Anatol Belski (ab at php dot net)
        Petr Czaderna (petr at hroch dot info)
+       Benjamin Eberlei (kontakt at beberlei dot de)
        David James (james82 at gmail dot com)
        Thomas Landro Johnsen (thomas dot l dot johnsen at gmail dot com)
        Clay Loveless (clay at killersoft dot com)
diff --git a/bench_select_vs_event.php b/bench_select_vs_event.php
new file mode 100644 (file)
index 0000000..3bc9aed
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+
+function usage($e = null) {
+    global $argv;
+    if ($e) {
+        fprintf(STDERR, "ERROR: %s\n\n", $e);
+    }
+       fprintf(STDERR, "Usage: %s -u <URL> -n <requests> -c <concurrency> [-p (enable pipelining)] [-e (use libevent)]\n", $argv[0]);
+       fprintf(STDERR, "\nDefaults: -u http://localhost/ -n 1000 -c 10\n\n");
+       exit(-1);
+}
+
+function push($client, $url, &$n) {
+       if ($n-- > 0) {
+               $req = new http\Client\Request("GET", $url);
+               $client->enqueue($req, function($response) use ($client, $req, $url, &$n) {
+                       global $count; ++$count;
+                       push($client, $url, $n);
+                       return true; // dequeue
+               });
+       }
+}
+
+isset($argv) or $argv = $_SERVER['argv'];
+defined('STDERR') or define('STDERR', fopen('php://stderr', 'w'));
+
+$opts = getopt("u:c:n:e");
+isset($opts["u"]) or $opts["u"] = "http://localhost/";
+isset($opts["c"]) or $opts["c"] = 10;
+isset($opts["n"]) or $opts["n"] = 1000;
+
+$argc > 1 or usage();
+
+$time = microtime(true);
+$count = 0;
+$client = new http\Client;
+
+$client->enablePipelining($opts["p"]===false);
+$client->enableEvents($opts["e"]===false);
+
+for ($i = 0, $x = $opts["n"]; $i < $opts["c"]; ++$i) {
+       push($client, $opts["u"], $x);
+}
+
+try {
+       $client->send();
+} catch (Exception $e) {
+       echo $e;
+}
+
+printf("\n> %10.6fs (%3.2fM)\n", microtime(true)-$time, memory_get_peak_usage(true)/1024/1024);
+
+$count == $opts["n"] or printf("\nOnly %d finished\n", $count);
index 4b14343..aeb9a97 100644 (file)
--- a/config.m4
+++ b/config.m4
@@ -1,5 +1,5 @@
 dnl phpize stub of config9.m4 for pecl/http
-dnl $Id$
+dnl $Id: config.m4 214417 2006-06-07 21:05:34Z mike $
 dnl vim: noet ts=1 sw=1
 
 sinclude(config9.m4)
index 680d7fa..f74f152 100644 (file)
-// config.w32 for pecl/http
-// $Id$
-
-ARG_ENABLE("http", "whether to enable extended HTTP support", "no");
-
-function check_for_main_ext(ext, header)
-{
-       if (!header) {
-               header = "php_"+ ext +".h";
-       }
-
-       /* When in configure, we're always in the root of PHP source */
-       var ext_path = "ext\\" + ext;
-       
-       STDOUT.Write("Checking for ext/"+ ext +" ...  ");
-
-       if (FSO.FileExists(ext_path + "\\" + header)) {
-               STDOUT.WriteLine(ext_path);
-               return ext_path;
-       }
-
-       STDOUT.WriteLine("<not found>");
-       return false;
-}
-
-function check_for_pecl_ext(ext, header)
-{
-       if (!header) {
-               header = "php_"+ ext +".h";
-       }
-       
-       var g;
-       var s = ext +"\\"+ header;
-       
-       STDOUT.Write("Checking for pecl/"+ ext +" ...  ");
-       if (    (g = glob(configure_module_dirname +"\\..\\"+ s)) ||
-                       (g = glob(configure_module_dirname +"\\..\\..\\..\\pecl\\"+ s))) {
-               var f = g[0].substr(0, g[0].length - header.length - 1);
-               STDOUT.WriteLine(f);
-               return f;
-       }
-       STDOUT.WriteLine("<not found>");
-       return false;
-}
-
-if (PHP_HTTP != "no") {
-
-       EXTENSION("http",
-               "missing.c http.c http_functions.c http_exception_object.c "+
-               "http_util_object.c http_message_object.c http_requestpool_object.c "+
-               "http_request_object.c http_response_object.c "+
-               "http_api.c http_cache_api.c http_request_pool_api.c "+
-               "http_request_api.c http_date_api.c http_headers_api.c "+
-               "http_message_api.c http_send_api.c http_url_api.c "+
-               "http_info_api.c http_request_method_api.c http_encoding_api.c "+
-               "http_filter_api.c http_request_body_api.c http_querystring_object.c "+
-               "http_deflatestream_object.c http_inflatestream_object.c "+
-               "http_cookie_api.c http_querystring_api.c http_request_datashare_api.c "+
-               "http_requestdatashare_object.c http_request_info.c http_persistent_handle_api.c",
-               null,
-               "/I\"" + configure_module_dirname + "/phpstr\"");
-       ADD_SOURCES(configure_module_dirname + "/phpstr", "phpstr.c", "http");
-       AC_DEFINE("HAVE_HTTP", 1, "Have extended HTTP support");
-       AC_DEFINE("HTTP_SHARED_DEPS", 1, "Depend on shared extensions");
-       
-       AC_DEFINE("HAVE_GETHOSTNAME", 1);
-       AC_DEFINE("HAVE_GETSERVBYPORT", 1);
-       AC_DEFINE("HAVE_GETSERVBYNAME", 1);
-       
-       if (PHP_DEBUG != "no") {
-               ADD_FLAG("CFLAGS_HTTP", "/W3");
-       }
-       
-       if (CHECK_HEADER_ADD_INCLUDE('zlib.h', 'CFLAGS_HTTP', '..\\zlib;' + php_usual_include_suspects)) {
-               AC_DEFINE('HTTP_HAVE_ZLIB', 1, "Have zlib library");
-               ADD_FLAG("LDFLAGS_HTTP", "/FORCE:MULTIPLE");
-       } else {
-               WARNING("zlib encoding functions not enabled; libraries and headers not found");
-       }
-       
-       if (typeof(PHP_HASH) != "undefined" && PHP_HASH != "no") {
-               var f;
-               
-               if ((f = check_for_pecl_ext("hash")) || (f = check_for_main_ext("hash"))) {
-                       ADD_FLAG("CFLAGS_HTTP", '/I "' + f + '" /DHTTP_HAVE_PHP_HASH_H=1');
-                       ADD_EXTENSION_DEP("http", "hash", true);
-               }
-       }
-       
-       if (PHP_SESSION != "no") {
-               ADD_EXTENSION_DEP("http", "session", true);
-       }
-       
-       if (PHP_ICONV != "no") {
-               ADD_EXTENSION_DEP("http", "iconv", true);
-       }
-       
-       CURL_LIB="libcurl_a.lib;libcurl.lib;" + (PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib");
-       if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") &&
-                       CHECK_HEADER_ADD_INCLUDE("openssl/crypto.h", "CFLAGS_HTTP") &&
-                       CHECK_LIB(CURL_LIB, "http", PHP_HTTP) &&
-                       CHECK_LIB("ssleay32.lib", "http", PHP_HTTP) &&
-                       CHECK_LIB("libeay32.lib", "http", PHP_HTTP) &&
-                       CHECK_LIB("zlib.lib;zlib_a.lib", "http", PHP_HTTP) &&
-                       CHECK_LIB("winmm.lib", "http", PHP_HTTP)) {
-               AC_DEFINE("HTTP_HAVE_CURL", 1, "Have CURL library");
-               AC_DEFINE("HTTP_HAVE_SSL", 1, "Have SSL");
-               AC_DEFINE("HAVE_CURL_MULTI_STRERROR", 1, "");
-               AC_DEFINE("HAVE_CURL_SHARE_STRERROR", 1, "");
-               AC_DEFINE("HAVE_CURL_EASY_STRERROR", 1, "");
-               AC_DEFINE("HAVE_CURL_EASY_RESET", 1, "");
-               AC_DEFINE("HAVE_CURL_GETFORMDATA", 1, "");
-               AC_DEFINE("HAVE_CURL_FORMGET", 1, "");
-               AC_DEFINE("HAVE_CURL_MULTI_SETOPT", 1, "");
-               AC_DEFINE("HAVE_CURL_MULTI_TIMEOUT", 1, "");
-       } else {
-               WARNING("curl convenience functions not enabled; libraries and headers not found");
-       }
-/*
-//     MAGIC_LIB = PHP_DEBUG != "no" ? "libmagic-staticd.lib":"libmagic-static.lib";
-//     if (CHECK_HEADER_ADD_INCLUDE("magic.h", "CFLAGS_HTTP") &&
-//                     CHECK_LIB(MAGIC_LIB, "http", PHP_HTTP)) {
-//             AC_DEFINE("HTTP_HAVE_MAGIC", 1, "Have magic library");
-//             AC_DEFINE("USE_MAGIC_STATIC", "", "");
-//     } else {
-//             WARNING("content type guessing not enabled; libraries and headers not found");
-//     }
-*/
-}
+// config.w32 for pecl/http\r
+// $Id$\r
+\r
+ARG_ENABLE("http", "whether to enable extended HTTP support", "no");\r
+\r
+function check_for_main_ext(ext, header)\r
+{\r
+       if (!header) {\r
+               header = "php_"+ ext +".h";\r
+       }\r
+\r
+       /* When in configure, we're always in the root of PHP source */\r
+       var ext_path = "ext\\" + ext;\r
+       \r
+       STDOUT.Write("Checking for ext/"+ ext +" ...  ");\r
+\r
+       if (FSO.FileExists(ext_path + "\\" + header)) {\r
+               STDOUT.WriteLine(ext_path);\r
+               return ext_path;\r
+       }\r
+\r
+       STDOUT.WriteLine("<not found>");\r
+       return false;\r
+}\r
+\r
+function check_for_pecl_ext(ext, header)\r
+{\r
+       if (!header) {\r
+               header = "php_"+ ext +".h";\r
+       }\r
+       \r
+       var g;\r
+       var s = ext +"\\"+ header;\r
+       \r
+       STDOUT.Write("Checking for pecl/"+ ext +" ...  ");\r
+       if (    (g = glob(configure_module_dirname +"\\..\\"+ s)) ||\r
+                       (g = glob(configure_module_dirname +"\\..\\..\\..\\pecl\\"+ s))) {\r
+               var f = g[0].substr(0, g[0].length - header.length - 1);\r
+               STDOUT.WriteLine(f);\r
+               return f;\r
+       }\r
+       STDOUT.WriteLine("<not found>");\r
+       return false;\r
+}\r
+\r
+if (PHP_HTTP != "no") {\r
+\r
+       EXTENSION("http",\r
+               "php_http.c php_http_buffer.c php_http_client.c " +\r
+               "php_http_client_request.c php_http_client_response.c " +\r
+               "php_http_cookie.c php_http_curl.c php_http_client_curl.c " +\r
+               "php_http_encoding.c php_http_env.c php_http_env_request.c " +\r
+               "php_http_env_response.c php_http_etag.c php_http_exception.c php_http_filter.c php_http_header_parser.c " +\r
+               "php_http_headers.c php_http_info.c php_http_message.c php_http_message_body.c php_http_message_parser.c " +\r
+               "php_http_misc.c php_http_negotiate.c php_http_object.c php_http_options.c php_http_params.c " +\r
+               "php_http_querystring.c " +\r
+               "php_http_strlist.c php_http_url.c php_http_version.c",\r
+               null,\r
+               null);\r
+       AC_DEFINE("HAVE_HTTP", 1, "Have extended HTTP support");\r
+       AC_DEFINE("HTTP_SHARED_DEPS", 1, "Depend on shared extensions");\r
+       \r
+       AC_DEFINE("HAVE_GETHOSTNAME", 1);\r
+       AC_DEFINE("HAVE_GETSERVBYPORT", 1);\r
+       AC_DEFINE("HAVE_GETSERVBYNAME", 1);\r
+       \r
+       if (PHP_DEBUG != "no") {\r
+               ADD_FLAG("CFLAGS_HTTP", "/W3");\r
+       }\r
+       \r
+       if (CHECK_HEADER_ADD_INCLUDE('zlib.h', 'CFLAGS_HTTP', '..\\zlib;' + php_usual_include_suspects)) {\r
+               AC_DEFINE('HTTP_HAVE_ZLIB', 1, "Have zlib library");\r
+               ADD_FLAG("LDFLAGS_HTTP", "/FORCE:MULTIPLE");\r
+       } else {\r
+               WARNING("zlib encoding functions not enabled; libraries and headers not found");\r
+       }\r
+       \r
+       if (typeof(PHP_HASH) != "undefined" && PHP_HASH != "no") {\r
+               var f;\r
+               \r
+               if ((f = check_for_pecl_ext("hash")) || (f = check_for_main_ext("hash"))) {\r
+                       ADD_FLAG("CFLAGS_HTTP", '/I "' + f + '" /DHTTP_HAVE_PHP_HASH_H=1');\r
+                       ADD_EXTENSION_DEP("http", "hash", true);\r
+               }\r
+       }\r
+       \r
+       if (PHP_SESSION != "no") {\r
+               ADD_EXTENSION_DEP("http", "session", true);\r
+       }\r
+       \r
+       if (PHP_ICONV != "no") {\r
+               ADD_EXTENSION_DEP("http", "iconv", true);\r
+       }\r
+       \r
+       if (PHP_CURL != "no") {\r
+               ADD_EXTENSION_DEP("http", "curl", true);\r
+       }\r
+\r
+       \r
+       CURL_LIB="libcurl_a.lib;libcurl.lib;" + (PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib");\r
+       if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") &&\r
+                       CHECK_HEADER_ADD_INCLUDE("openssl/crypto.h", "CFLAGS_HTTP") &&\r
+                       CHECK_LIB(CURL_LIB, "http", PHP_HTTP) &&\r
+                       CHECK_LIB("ssleay32.lib", "http", PHP_HTTP) &&\r
+                       CHECK_LIB("libeay32.lib", "http", PHP_HTTP) &&\r
+                       CHECK_LIB("zlib.lib;zlib_a.lib", "http", PHP_HTTP) &&\r
+                       CHECK_LIB("libcurl_a.lib", "http", PHP_HTTP) &&\r
+                       ADD_EXTENSION_DEP("http", "propro", true) &&\r
+                       ADD_EXTENSION_DEP("http", "raphf", true) &&\r
+                       CHECK_LIB("winmm.lib", "http", PHP_HTTP)) {\r
+               AC_DEFINE("PHP_HTTP_HAVE_CURL", 1, "Have CURL library");\r
+               AC_DEFINE("PHP_HTTP_HAVE_SSL", 1, "Have SSL");\r
+               AC_DEFINE("PHP_HAVE_CURL_MULTI_STRERROR", 1, "");\r
+               AC_DEFINE("PHP_HAVE_CURL_SHARE_STRERROR", 1, "");\r
+               AC_DEFINE("PHP_HAVE_CURL_EASY_STRERROR", 1, "");\r
+               AC_DEFINE("PHP_HAVE_CURL_EASY_RESET", 1, "");\r
+               AC_DEFINE("PHP_HAVE_CURL_GETFORMDATA", 1, "");\r
+               AC_DEFINE("PHP_HAVE_CURL_FORMGET", 1, "");\r
+               AC_DEFINE("PHP_HAVE_CURL_MULTI_SETOPT", 1, "");\r
+               AC_DEFINE("PHP_HAVE_CURL_MULTI_TIMEOUT", 1, "");\r
+\r
+               if (CHECK_HEADER_ADD_INCLUDE("event2/event.h", "CFLAGS_HTTP") &&\r
+                       CHECK_LIB("libevent.lib", "http", PHP_HTTP) &&\r
+                       CHECK_LIB("libevent_core.lib", "http", PHP_HTTP) &&\r
+                       CHECK_LIB("libevent_extras.lib", "http", PHP_HTTP)) {\r
+\r
+                       AC_DEFINE("PHP_HTTP_HAVE_EVENT", 1);\r
+                       AC_DEFINE("PHP_HTTP_HAVE_EVENT2", 1);\r
+                       AC_DEFINE("PHP_HTTP_EVENT_VERSION", "2.0.21 or greater");\r
+               }\r
+       } else {\r
+               WARNING("curl convenience functions not enabled; libraries and headers not found");\r
+       }\r
+}\r
index e5dd566..aff67ca 100644 (file)
@@ -1,28 +1,20 @@
 dnl config.m4 for pecl/http
-dnl $Id$
-dnl vim: noet ts=1 sw=1
+dnl $Id: config9.m4 242664 2007-09-18 19:13:37Z mike $
+dnl vim: noet ts=4 sw=4
 
-PHP_ARG_ENABLE([http], [whether to enable extended HTTP support],
-[  --enable-http           Enable extended HTTP support])
-PHP_ARG_WITH([http-shared-deps], [whether to depend on extensions which have been built shared],
-[  --with-http-shared-deps
-                           HTTP: disable to not depend on extensions like hash,
-                                 iconv and session (when built shared)], $PHP_HTTP, $PHP_HTTP)
-PHP_ARG_WITH([http-curl-requests], [whether to enable cURL HTTP request support],
-[  --with-http-curl-requests[=LIBCURLDIR]
-                           HTTP: with cURL request support], $PHP_HTTP, $PHP_HTTP)
-PHP_ARG_WITH([http-curl-libevent], [whether to enable libevent support fur cURL],
-[  --with-http-curl-libevent[=LIBEVENTDIR]
-                           HTTP: libevent install directory], $PHP_HTTP_CURL_REQUESTS, "")
-PHP_ARG_WITH([http-zlib-compression], [whether to enable zlib encodings support],
-[  --with-http-zlib-compression[=LIBZDIR]
-                           HTTP: with zlib encodings support], $PHP_HTTP, $PHP_HTTP)
-PHP_ARG_WITH([http-magic-mime], [whether to enable response content type guessing],
-[  --with-http-magic-mime[=LIBMAGICDIR]
-                           HTTP: with magic mime response content type guessing], "no", "no")
+PHP_ARG_WITH([http], [whether to enable extended HTTP support],
+[  --with-http             Enable extended HTTP support])
+PHP_ARG_WITH([http-zlib-dir], [],
+[  --with-http-zlib-dir[=DIR]     HTTP: where to find zlib], $PHP_HTTP, $PHP_HTTP)
+PHP_ARG_WITH([http-libcurl-dir], [],
+[  --with-http-libcurl-dir[=DIR]  HTTP: where to find libcurl], $PHP_HTTP, $PHP_HTTP)
+PHP_ARG_WITH([http-libevent-dir], [],
+[  --with-http-libevent-dir[=DIR] HTTP: where to find libevent], $PHP_HTTP_LIBCURL_DIR, "")
 
 if test "$PHP_HTTP" != "no"; then
 
+       HTTP_HAVE_A_REQUEST_LIB=false
+
        ifdef([AC_PROG_EGREP], [
                AC_PROG_EGREP
        ], [
@@ -41,9 +33,9 @@ if test "$PHP_HTTP" != "no"; then
        AC_PROG_CPP
        
        if test "$PHP_HTTP_SHARED_DEPS" != "no"; then
-               AC_DEFINE([HTTP_SHARED_DEPS], [1], [ ])
+               AC_DEFINE([PHP_HTTP_SHARED_DEPS], [1], [ ])
        else
-               AC_DEFINE([HTTP_SHARED_DEPS], [0], [ ])
+               AC_DEFINE([PHP_HTTP_SHARED_DEPS], [0], [ ])
        fi
        
        dnl
@@ -51,7 +43,7 @@ if test "$PHP_HTTP" != "no"; then
        dnl
        AC_DEFUN([HTTP_SHARED_DEP], [
                extname=$1
-               haveext=$[HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)
+               haveext=$[PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)
                
                AC_MSG_CHECKING([whether to add a dependency on ext/$extname])
                if test "$PHP_HTTP_SHARED_DEPS" = "no"; then
@@ -59,6 +51,7 @@ if test "$PHP_HTTP" != "no"; then
                        $3
                elif test "$haveext"; then
                        AC_MSG_RESULT([yes])
+                       AC_DEFINE([PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__), [1], [ ])
                        ifdef([PHP_ADD_EXTENSION_DEP], [
                                PHP_ADD_EXTENSION_DEP([http], $1, true)
                        ])
@@ -80,31 +73,25 @@ if test "$PHP_HTTP" != "no"; then
                if test -x "$PHP_EXECUTABLE"; then
                        grepext=`$PHP_EXECUTABLE -m | $EGREP ^$extname\$`
                        if test "$grepext" = "$extname"; then
-                               [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
+                               [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
                                AC_MSG_RESULT([yes])
                                $2
                        else
-                               [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=
+                               [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=
                                AC_MSG_RESULT([no])
                                $3
                        fi
                elif test "$haveext" != "no" && test "x$haveext" != "x"; then
-                       [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
+                       [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
                        AC_MSG_RESULT([yes])
                        $2
                else
-                       [HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=
+                       [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=
                        AC_MSG_RESULT([no])
                        $3
                fi
        ])
        
-       dnl
-       dnl odd PHP4 fix
-       dnl
-       if test "x$PHP_LIBDIR" = "x"; then
-               PHP_LIBDIR=lib
-       fi
 
 dnl ----
 dnl STDC
@@ -113,45 +100,47 @@ dnl ----
        PHP_CHECK_FUNC(gethostname, nsl)
        PHP_CHECK_FUNC(getdomainname, nsl)
        PHP_CHECK_FUNC(getservbyport, nsl)
+       PHP_CHECK_FUNC(getservbyport_r, nsl)
        PHP_CHECK_FUNC(getservbyname, nsl)
+       PHP_CHECK_FUNC(getservbyname_r, nsl)
 
 dnl ----
 dnl ZLIB
 dnl ----
-       if test "$PHP_HTTP_ZLIB_COMPRESSION" != "no"; then
-               AC_MSG_CHECKING([for zlib.h])
-               ZLIB_DIR=
-               for i in "$PHP_HTTP_ZLIB_COMPRESSION" "$PHP_ZLIB_DIR" "$PHP_ZLIB" /usr/local /usr /opt; do
-                       if test -f "$i/include/zlib.h"; then
-                               ZLIB_DIR=$i
-                               break;
-                       fi
-               done
-               if test "x$ZLIB_DIR" = "x"; then
-                       AC_MSG_RESULT([not found])
-                       AC_MSG_ERROR([could not find zlib.h])
+       AC_MSG_CHECKING([for zlib.h])
+       ZLIB_DIR=
+       for i in "$PHP_HTTP_ZLIB_DIR" "$PHP_ZLIB_DIR" "$PHP_ZLIB" /usr/local /usr /opt; do
+               if test -f "$i/include/zlib.h"; then
+                       ZLIB_DIR=$i
+                       break;
+               fi
+       done
+       if test "x$ZLIB_DIR" = "x"; then
+               AC_MSG_RESULT([not found])
+               AC_MSG_ERROR([could not find zlib.h])
+       else
+               AC_MSG_RESULT([found in $ZLIB_DIR])
+               AC_MSG_CHECKING([for zlib version >= 1.2.0.4])
+               ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_DIR/include/zlib.h | $SED -e 's/[[^0-9\.]]//g'`
+               AC_MSG_RESULT([$ZLIB_VERSION])
+               if test `echo $ZLIB_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*1000000 + $2*10000 + $3*100 + $4}'` -lt 1020004; then
+                       AC_MSG_ERROR([zlib version greater or equal to 1.2.0.4 required])
                else
-                       AC_MSG_RESULT([found in $ZLIB_DIR])
-                       AC_MSG_CHECKING([for zlib version >= 1.2.0.4])
-                       ZLIB_VERSION=`$EGREP "define ZLIB_VERSION" $ZLIB_DIR/include/zlib.h | $SED -e 's/[[^0-9\.]]//g'`
-                       AC_MSG_RESULT([$ZLIB_VERSION])
-                       if test `echo $ZLIB_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*1000000 + $2*10000 + $3*100 + $4}'` -lt 1020004; then
-                               AC_MSG_ERROR([libz version greater or equal to 1.2.0.4 required])
-                       else
-                               PHP_ADD_INCLUDE($ZLIB_DIR/include)
-                               PHP_ADD_LIBRARY_WITH_PATH(z, $ZLIB_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD)
-                               AC_DEFINE([HTTP_HAVE_ZLIB], [1], [Have zlib support])
-                       fi
+                       PHP_ADD_INCLUDE($ZLIB_DIR/include)
+                       PHP_ADD_LIBRARY_WITH_PATH(z, $ZLIB_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD)
                fi
        fi
        
 dnl ----
 dnl CURL
 dnl ----
-       if test "$PHP_HTTP_CURL_REQUESTS" != "no"; then
+
+       if test "$PHP_HTTP_LIBCURL_DIR" = "no"; then
+               AC_DEFINE([PHP_HTTP_HAVE_CURL], [0], [ ])
+       else
                AC_MSG_CHECKING([for curl/curl.h])
                CURL_DIR=
-               for i in "$PHP_HTTP_CURL_REQUESTS" /usr/local /usr /opt; do
+               for i in "$PHP_HTTP_LIBCURL_DIR" /usr/local /usr /opt; do
                        if test -f "$i/include/curl/curl.h"; then
                                CURL_DIR=$i
                                break
@@ -159,235 +148,248 @@ dnl ----
                done
                if test "x$CURL_DIR" = "x"; then
                        AC_MSG_RESULT([not found])
-                       AC_MSG_ERROR([could not find curl/curl.h])
                else
                        AC_MSG_RESULT([found in $CURL_DIR])
-               fi
                
-               AC_MSG_CHECKING([for curl-config])
-               CURL_CONFIG=
-               for i in "$CURL_DIR/bin/curl-config" "$CURL_DIR/curl-config" `which curl-config`; do
-                       if test -x "$i"; then
-                               CURL_CONFIG=$i
-                               break
+                       AC_MSG_CHECKING([for curl-config])
+                       CURL_CONFIG=
+                       for i in "$CURL_DIR/bin/curl-config" "$CURL_DIR/curl-config" `which curl-config`; do
+                               if test -x "$i"; then
+                                       CURL_CONFIG=$i
+                                       break
+                               fi
+                       done
+                       if test "x$CURL_CONFIG" = "x"; then
+                               AC_MSG_RESULT([not found])
+                               AC_MSG_ERROR([could not find curl-config])
+                       else
+                               AC_MSG_RESULT([found: $CURL_CONFIG])
                        fi
-               done
-               if test "x$CURL_CONFIG" = "x"; then
-                       AC_MSG_RESULT([not found])
-                       AC_MSG_ERROR([could not find curl-config])
-               else
-                       AC_MSG_RESULT([found: $CURL_CONFIG])
-               fi
                
-               dnl Debian stable has currently 7.13.2 (this is not a typo)
-               AC_MSG_CHECKING([for curl version >= 7.12.3])
-               CURL_VERSION=`$CURL_CONFIG --version | $SED -e 's/[[^0-9\.]]//g'`
-               AC_MSG_RESULT([$CURL_VERSION])
-               if test `echo $CURL_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71203; then
-                       AC_MSG_ERROR([libcurl version greater or equal to 7.12.3 required])
-               fi
+                       dnl RHEL6:         7.19.7
+                       dnl SUSE11:        7.19.7
+                       dnl Debian wheezy: 7.26.0
+                       dnl Debian sqeeze: 7.21.0
+                       dnl Debian ancient 7.18.2
+                       AC_MSG_CHECKING([for curl version >= 7.18.2])
+                       CURL_VERSION=`$CURL_CONFIG --version | $SED -e 's/[[^0-9\.]]//g'`
+                       AC_MSG_RESULT([$CURL_VERSION])
+                       if test `echo $CURL_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71802; then
+                               AC_MSG_ERROR([libcurl version greater or equal to 7.18.2 required])
+                       fi
                
-               dnl
-               dnl compile tests
-               dnl
+                       dnl
+                       dnl compile tests
+                       dnl
                
-               save_INCLUDES="$INCLUDES"
-               INCLUDES=
-               save_LIBS="$LIBS"
-               LIBS=
-               save_CFLAGS="$CFLAGS"
-               CFLAGS=`$CURL_CONFIG --cflags`
-               save_LDFLAGS="$LDFLAGS"
-               LDFLAGS=`$CURL_CONFIG --libs`
-               LDFLAGS="$LDFLAGS $ld_runpath_switch$CURL_DIR/$PHP_LIBDIR"
+                       save_INCLUDES="$INCLUDES"
+                       INCLUDES=
+                       save_LIBS="$LIBS"
+                       LIBS=
+                       save_CFLAGS="$CFLAGS"
+                       CFLAGS=`$CURL_CONFIG --cflags`
+                       save_LDFLAGS="$LDFLAGS"
+                       LDFLAGS=`$CURL_CONFIG --libs`
+                       LDFLAGS="$LDFLAGS $ld_runpath_switch$CURL_DIR/$PHP_LIBDIR"
                
-               AC_MSG_CHECKING([for SSL support in libcurl])
-               CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL`
-               if test "$CURL_SSL" = "SSL"; then
-                       AC_MSG_RESULT([yes])
-                       AC_DEFINE([HTTP_HAVE_SSL], [1], [ ])
+                       AC_MSG_CHECKING([for SSL support in libcurl])
+                       CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL`
+                       if test "$CURL_SSL" = "SSL"; then
+                               AC_MSG_RESULT([yes])
+                               AC_DEFINE([PHP_HTTP_HAVE_SSL], [1], [ ])
                        
-                       AC_MSG_CHECKING([for openssl support in libcurl])
-                       AC_TRY_RUN([
-                               #include <curl/curl.h>
-                               int main(int argc, char *argv[]) {
-                                       curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
-                                       if (data && data->ssl_version && *data->ssl_version) {
-                                               const char *ptr = data->ssl_version;
-                                               while(*ptr == ' ') ++ptr;
-                                               return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1);
+                               AC_MSG_CHECKING([for openssl support in libcurl])
+                               AC_TRY_RUN([
+                                       #include <curl/curl.h>
+                                       int main(int argc, char *argv[]) {
+                                               curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
+                                               if (data && data->ssl_version && *data->ssl_version) {
+                                                       const char *ptr = data->ssl_version;
+                                                       while(*ptr == ' ') ++ptr;
+                                                       return strncasecmp(ptr, "OpenSSL", sizeof("OpenSSL")-1);
+                                               }
+                                               return 1;
                                        }
-                                       return 1;
-                               }
-                       ], [
-                               AC_MSG_RESULT([yes])
-                               AC_CHECK_HEADER([openssl/crypto.h], [
-                                       AC_DEFINE([HTTP_HAVE_OPENSSL], [1], [ ])
+                               ], [
+                                       AC_MSG_RESULT([yes])
+                                       AC_CHECK_HEADER([openssl/crypto.h], [
+                                               AC_DEFINE([PHP_HTTP_HAVE_OPENSSL], [1], [ ])
+                                               CURL_SSL="crypto"
+                                       ])
+                               ], [
+                                       AC_MSG_RESULT([no])
+                               ], [
+                                       AC_MSG_RESULT([no])
                                ])
-                       ], [
-                               AC_MSG_RESULT([no])
-                       ], [
-                               AC_MSG_RESULT([no])
-                       ])
                        
-                       AC_MSG_CHECKING([for gnutls support in libcurl])
-                       AC_TRY_RUN([
-                               #include <curl/curl.h>
-                               int main(int argc, char *argv[]) {
-                                       curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
-                                       if (data && data->ssl_version && *data->ssl_version) {
-                                               const char *ptr = data->ssl_version;
-                                               while(*ptr == ' ') ++ptr;
-                                               return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1);
+                               AC_MSG_CHECKING([for gnutls support in libcurl])
+                               AC_TRY_RUN([
+                                       #include <curl/curl.h>
+                                       int main(int argc, char *argv[]) {
+                                               curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
+                                               if (data && data->ssl_version && *data->ssl_version) {
+                                                       const char *ptr = data->ssl_version;
+                                                       while(*ptr == ' ') ++ptr;
+                                                       return strncasecmp(ptr, "GnuTLS", sizeof("GnuTLS")-1);
+                                               }
+                                               return 1;
                                        }
-                                       return 1;
-                               }
-                       ], [
-                               AC_MSG_RESULT([yes])
-                               AC_CHECK_HEADER([gcrypt.h], [
-                                       AC_DEFINE([HTTP_HAVE_GNUTLS], [1], [ ])
+                               ], [
+                                       AC_MSG_RESULT([yes])
+                                       AC_CHECK_HEADER([gcrypt.h], [
+                                               AC_DEFINE([PHP_HTTP_HAVE_GNUTLS], [1], [ ])
+                                               CURL_SSL="gcrypt"
+                                       ])
+                               ], [
+                                       AC_MSG_RESULT([no])
+                               ], [
+                                       AC_MSG_RESULT([no])
                                ])
-                       ], [
-                               AC_MSG_RESULT([no])
-                       ], [
+                       else
                                AC_MSG_RESULT([no])
-                       ])
-               else
-                       AC_MSG_RESULT([no])
-               fi
-               
-               INCLUDES="$save_INCLUDES"
-               LIBS="$save_LIBS"
-               CFLAGS="$save_CFLAGS"
-               LDFLAGS="$save_LDFLAGS"
-               
-               dnl end compile tests
-               
-               AC_MSG_CHECKING([for bundled SSL CA info])
-               CURL_CAINFO=
-               for i in `$CURL_CONFIG --ca` "/etc/ssl/certs/ca-certificates.crt"; do
-                       if test -f "$i"; then
-                               CURL_CAINFO="$i"
-                               break
                        fi
-               done
-               if test "x$CURL_CAINFO" = "x"; then
-                       AC_MSG_RESULT([not found])
-               else
-                       AC_MSG_RESULT([$CURL_CAINFO])
-                       AC_DEFINE_UNQUOTED([HTTP_CURL_CAINFO], ["$CURL_CAINFO"], [path to bundled SSL CA info])
-               fi
                
-               PHP_ADD_INCLUDE($CURL_DIR/include)
-               PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD)
-               PHP_EVAL_LIBLINE(`$CURL_CONFIG --libs`, HTTP_SHARED_LIBADD)
-               AC_DEFINE([HTTP_HAVE_CURL], [1], [Have cURL support])
+                       INCLUDES="$save_INCLUDES"
+                       LIBS="$save_LIBS"
+                       CFLAGS="$save_CFLAGS"
+                       LDFLAGS="$save_LDFLAGS"
                
-               PHP_CHECK_LIBRARY(curl, curl_share_strerror, 
-                       [AC_DEFINE([HAVE_CURL_SHARE_STRERROR], [1], [ ])], [ ],
-                       [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
-               )
-               PHP_CHECK_LIBRARY(curl, curl_multi_strerror, 
-                       [AC_DEFINE([HAVE_CURL_MULTI_STRERROR], [1], [ ])], [ ], 
-                       [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
-               )
-               PHP_CHECK_LIBRARY(curl, curl_easy_strerror,
-                       [AC_DEFINE([HAVE_CURL_EASY_STRERROR], [1], [ ])], [ ],
-                       [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
-               )
-               PHP_CHECK_LIBRARY(curl, curl_easy_reset,
-                       [AC_DEFINE([HAVE_CURL_EASY_RESET], [1], [ ])], [ ],
-                       [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
-               )
-               PHP_CHECK_LIBRARY(curl, curl_formget,
-                       [AC_DEFINE([HAVE_CURL_FORMGET], [1], [ ])], [ ],
-                       [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
-               )
-               PHP_CHECK_LIBRARY(curl, curl_multi_setopt, 
-                       [AC_DEFINE([HAVE_CURL_MULTI_SETOPT], [1], [ ])], [ ], 
-                       [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
-               )
-               PHP_CHECK_LIBRARY(curl, curl_multi_timeout, 
-                       [AC_DEFINE([HAVE_CURL_MULTI_TIMEOUT], [1], [ ])], [ ],
-                       [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
-               )
+                       dnl end compile tests
                
-               dnl ----
-               dnl EVENT
-               dnl ----
+                       AC_MSG_CHECKING([for bundled SSL CA info])
+                       CURL_CAINFO=
+                       for i in `$CURL_CONFIG --ca` "/etc/ssl/certs/ca-certificates.crt"; do
+                               if test -f "$i"; then
+                                       CURL_CAINFO="$i"
+                                       break
+                               fi
+                       done
+                       if test "x$CURL_CAINFO" = "x"; then
+                               AC_MSG_RESULT([not found])
+                       else
+                               AC_MSG_RESULT([$CURL_CAINFO])
+                               AC_DEFINE_UNQUOTED([PHP_HTTP_CURL_CAINFO], ["$CURL_CAINFO"], [path to bundled SSL CA info])
+                       fi
                
-               if test "$PHP_HTTP_CURL_LIBEVENT" != "no"; then
-                       HTTP_HAVE_PHP_EXT([event], [
-                               AC_MSG_WARN([event support is incompatible with pecl/event; continuing without libevent support])
-                       ], [
-                               AC_MSG_CHECKING([for event.h])
-                               EVENT_DIR=
-                               for i in "$PHP_HTTP_CURL_LIBEVENT" /usr/local /usr /opt; do
-                                       if test -f "$i/include/event.h"; then
-                                               EVENT_DIR=$i
-                                               break
-                                       fi
-                               done
-                               if test "x$EVENT_DIR" = "x"; then
-                                       AC_MSG_RESULT([not found])
-                                       AC_MSG_WARN([continuing without libevent support])
+                       PHP_ADD_INCLUDE($CURL_DIR/include)
+                       PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD)
+                       PHP_EVAL_LIBLINE(`$CURL_CONFIG --libs`, HTTP_SHARED_LIBADD)
+                       if test "x$CURL_SSL" != "x"; then
+                               PHP_ADD_LIBRARY_WITH_PATH([$CURL_SSL], $CURL_DIR/$PHP_LIBDIR, PHP_HTTP_SHARED_LIBADD)
+                       fi
+                       AC_DEFINE([PHP_HTTP_HAVE_CURL], [1], [Have libcurl support])
+                       HTTP_HAVE_A_REQUEST_LIB=true
+               fi
+       fi
+
+dnl ----
+dnl EVENT
+dnl ----
+
+       if test "$PHP_HTTP_LIBEVENT_DIR" = "no"; then
+               AC_DEFINE([PHP_HTTP_HAVE_EVENT], [0], [ ])
+       else
+               HTTP_HAVE_PHP_EXT([event], [
+                       AC_MSG_WARN([event support is incompatible with pecl/event; continuing without libevent support])
+                       AC_DEFINE([PHP_HTTP_HAVE_EVENT], [0], [ ])
+               ], [
+                       AC_MSG_CHECKING([for event2/event.h])
+                       EVENT_DIR=
+                       for i in "$PHP_HTTP_LIBEVENT_DIR" /usr/local /usr /opt; do
+                               if test -f "$i/include/event.h"; then
+                                       EVENT_DIR=$i
+                                       break
+                               fi
+                       done
+                       if test "x$EVENT_DIR" = "x"; then
+                               AC_MSG_RESULT([not found])
+                               AC_MSG_WARN([continuing without libevent support])
+                               AC_DEFINE([PHP_HTTP_HAVE_EVENT], [0], [ ])
+                       else
+                               AC_MSG_RESULT([found in $EVENT_DIR])
+                               
+                               AC_MSG_CHECKING([for libevent version, roughly])
+                               
+                               if test -f "$EVENT_DIR/include/event2/event.h"; then
+                                       EVENT_VER="`$EGREP _EVENT_VERSION $EVENT_DIR/include/event2/event-config.h | $AWK '{print $3}'`"
+                                       AC_DEFINE([PHP_HTTP_HAVE_EVENT2], [1], [ ])
                                else
-                                       AC_MSG_RESULT([found in $EVENT_DIR])
-                                       
-                                       AC_MSG_CHECKING([for libevent version, roughly])
-                                       EVENT_VER="1.1b or lower"
+                                       AC_DEFINE([PHP_HTTP_HAVE_EVENT2], [0], [ ])
                                        if test -f "$EVENT_DIR/include/evhttp.h" && test -f "$EVENT_DIR/include/evdns.h"; then
                                                if test -f "$EVENT_DIR/include/evrpc.h"; then
                                                        EVENT_VER="1.4 or greater"
                                                else
                                                        EVENT_VER="1.2 or greater"
                                                fi
-                                       fi
-                                       AC_DEFINE_UNQUOTED([HTTP_EVENT_VERSION], ["$EVENT_VER"], [ ])
-                                       AC_MSG_RESULT([$EVENT_VER])
-                                       
-                                       AC_MSG_CHECKING([for libcurl version >= 7.16.0])
-                                       AC_MSG_RESULT([$CURL_VERSION])
-                                       if test `echo $CURL_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71600; then
-                                               AC_MSG_WARN([libcurl version greater or equal to 7.16.0 required; continuing without libevent support])
                                        else
-                                               PHP_ADD_INCLUDE($EVENT_DIR/include)
-                                               PHP_ADD_LIBRARY_WITH_PATH(event, $EVENT_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD)
-                                               AC_DEFINE([HTTP_HAVE_EVENT], [1], [Have libevent support for cURL])
-                                               PHP_CHECK_LIBRARY(curl, curl_multi_socket_action, 
-                                                       [AC_DEFINE([HAVE_CURL_MULTI_SOCKET_ACTION], [1], [ ])], [ ],
-                                                       [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
-                                               )
+                                               EVENT_VER="1.1b or lower"
                                        fi
                                fi
-                       ])
-               fi
+                               AC_DEFINE_UNQUOTED([PHP_HTTP_EVENT_VERSION], ["$EVENT_VER"], [ ])
+                               AC_MSG_RESULT([$EVENT_VER])
+                               
+                               PHP_ADD_INCLUDE($EVENT_DIR/include)
+                               PHP_ADD_LIBRARY_WITH_PATH(event, $EVENT_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD)
+                               AC_DEFINE([PHP_HTTP_HAVE_EVENT], [1], [Have libevent support for cURL])
+                       fi
+               ])
        fi
 
 dnl ----
-dnl MAGIC
+dnl RAPHF
 dnl ----
-       if test "$PHP_HTTP_MAGIC_MIME" != "no"; then
-               AC_MSG_CHECKING([for magic.h])
-               MAGIC_DIR=
-               for i in "$PHP_HTTP_MAGIC_MIME" /usr/local /usr /opt; do
-                       if test -f "$i/include/magic.h"; then
-                               MAGIC_DIR=$i
-                               break
+       HTTP_HAVE_PHP_EXT([raphf], [
+               AC_MSG_CHECKING([for php_raphf.h])
+               HTTP_EXT_RAPHF_INCDIR=
+               for i in `echo $INCLUDES | $SED -e's/-I//g'` $abs_srcdir ../raphf; do
+                       if test -d $i; then
+                               if test -f $i/php_raphf.h; then
+                                       HTTP_EXT_RAPHF_INCDIR=$i
+                                       break
+                               elif test -f $i/ext/raphf/php_raphf.h; then
+                                       HTTP_EXT_RAPHF_INCDIR=$i/ext/raphf
+                                       break
+                               fi
                        fi
                done
-               if test "x$MAGIC_DIR" = "x"; then
-                       AC_MSG_RESULT([not found])
-                       AC_MSG_ERROR([could not find magic.h])
+               if test "x$HTTP_EXT_RAPHF_INCDIR" = "x"; then
+                       AC_MSG_ERROR([not found])
                else
-                       AC_MSG_RESULT([found in $MAGIC_DIR])
+                       AC_MSG_RESULT([$HTTP_EXT_RAPHF_INCDIR])
+                       AC_DEFINE([PHP_HTTP_HAVE_PHP_RAPHF_H], [1], [Have ext/raphf support])
+                       PHP_ADD_INCLUDE([$HTTP_EXT_RAPHF_INCDIR])
                fi
-               
-               PHP_ADD_INCLUDE($MAGIC_DIR/include)
-               PHP_ADD_LIBRARY_WITH_PATH(magic, $MAGIC_DIR/$PHP_LIBDIR, HTTP_SHARED_LIBADD)
-               AC_DEFINE([HTTP_HAVE_MAGIC], [1], [Have magic mime support])
-       fi
+       ])
+
+dnl ----
+dnl PROPRO
+dnl ----
+       HTTP_HAVE_PHP_EXT([propro], [
+               AC_MSG_CHECKING([for php_propro.h])
+               HTTP_EXT_PROPRO_INCDIR=
+               for i in `echo $INCLUDES | $SED -e's/-I//g'` $abs_srcdir ../propro; do
+                       if test -d $i; then
+                               if test -f $i/php_propro.h; then
+                                       HTTP_EXT_PROPRO_INCDIR=$i
+                                       break
+                               elif test -f $i/ext/propro/php_propro.h; then
+                                       HTTP_EXT_PROPRO_INCDIR=$i/ext/propro
+                                       break
+                               fi
+                       fi
+               done
+               if test "x$HTTP_EXT_PROPRO_INCDIR" = "x"; then
+                       AC_MSG_ERROR([not found])
+               else
+                       AC_MSG_RESULT([$HTTP_EXT_PROPRO_INCDIR])
+                       AC_DEFINE([PHP_HTTP_HAVE_PHP_PROPRO_H], [1], [Have ext/propro support])
+                       PHP_ADD_INCLUDE([$HTTP_EXT_PROPRO_INCDIR])
+               fi
+       ])
 
+PHP_ARG_WITH([http-shared-deps], [whether to depend on extensions which have been built shared],
+[  --without-http-shared-deps   HTTP: do not depend on extensions like hash
+                                     and iconv (when they are built shared)], $PHP_HTTP, $PHP_HTTP)
 dnl ----
 dnl HASH
 dnl ----
@@ -409,60 +411,110 @@ dnl ----
                        AC_MSG_RESULT([not found])
                else
                        AC_MSG_RESULT([$HTTP_EXT_HASH_INCDIR])
-                       AC_DEFINE([HTTP_HAVE_PHP_HASH_H], [1], [Have ext/hash support])
+                       AC_DEFINE([PHP_HTTP_HAVE_PHP_HASH_H], [1], [Have ext/hash support])
                        PHP_ADD_INCLUDE([$HTTP_EXT_HASH_INCDIR])
                fi
        ])
 
 dnl ----
-dnl ICONV
+dnl JSON
 dnl ----
-       HTTP_HAVE_PHP_EXT([iconv])
+       HTTP_HAVE_PHP_EXT([json])
+
 
 dnl ----
-dnl SESSION
+dnl ICONV
 dnl ----
-       HTTP_HAVE_PHP_EXT([session])
+       HTTP_HAVE_PHP_EXT([iconv])
 
 dnl ----
 dnl DONE
 dnl ----
-       PHP_HTTP_SOURCES="missing.c http.c http_functions.c phpstr/phpstr.c \
-               http_util_object.c http_message_object.c http_request_object.c http_request_pool_api.c \
-               http_response_object.c http_exception_object.c http_requestpool_object.c \
-               http_api.c http_cache_api.c http_request_api.c http_request_info.c http_date_api.c \
-               http_headers_api.c http_message_api.c http_send_api.c http_url_api.c \
-               http_info_api.c http_request_method_api.c http_encoding_api.c \
-               http_filter_api.c http_request_body_api.c http_querystring_object.c \
-               http_deflatestream_object.c http_inflatestream_object.c http_cookie_api.c \
-               http_querystring_api.c http_request_datashare_api.c http_requestdatashare_object.c \
-               http_persistent_handle_api.c"
-       
+       PHP_HTTP_SOURCES="\
+               php_http_buffer.c \
+               php_http.c \
+               php_http_client.c \
+               php_http_client_curl.c \
+               php_http_client_request.c \
+               php_http_client_response.c \
+               php_http_cookie.c \
+               php_http_curl.c \
+               php_http_encoding.c \
+               php_http_env.c \
+               php_http_env_request.c \
+               php_http_env_response.c \
+               php_http_etag.c \
+               php_http_exception.c \
+               php_http_filter.c \
+               php_http_header_parser.c \
+               php_http_header.c \
+               php_http_info.c \
+               php_http_message_body.c \
+               php_http_message.c \
+               php_http_message_parser.c \
+               php_http_misc.c \
+               php_http_negotiate.c \
+               php_http_object.c \
+               php_http_options.c \
+               php_http_params.c \
+               php_http_querystring.c \
+               php_http_strlist.c \
+               php_http_url.c \
+               php_http_version.c \
+       "
        PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, $ext_shared)
        
        dnl shared extension deps
        HTTP_SHARED_DEP([hash])
        HTTP_SHARED_DEP([iconv])
-       HTTP_SHARED_DEP([session])
+       HTTP_SHARED_DEP([json])
+       
+       dnl extension deps
+       PHP_ADD_EXTENSION_DEP([http], [raphf], true)
+       PHP_ADD_EXTENSION_DEP([http], [propo], true)
        
-       PHP_ADD_BUILD_DIR($ext_builddir/phpstr, 1)
        PHP_SUBST([HTTP_SHARED_LIBADD])
 
-       PHP_HTTP_HEADERS="php_http_std_defs.h php_http.h php_http_api.h php_http_cache_api.h \
-               php_http_date_api.h php_http_headers_api.h php_http_info_api.h php_http_message_api.h \
-               php_http_request_api.h php_http_request_method_api.h php_http_send_api.h php_http_url_api.h \
-               php_http_encoding_api.h phpstr/phpstr.h missing.h php_http_request_body_api.h \
-               php_http_exception_object.h php_http_message_object.h php_http_request_object.h \
-               php_http_requestpool_object.h php_http_response_object.h php_http_util_object.h \
-               php_http_querystring_object.h php_http_deflatestream_object.h php_http_inflatestream_object.h \
-               php_http_cookie_api.h php_http_querystring_api.h php_http_request_datashare_api.h php_http_requestdatashare_object.h \
-               php_http_persistent_handle_api.h"
-       ifdef([PHP_INSTALL_HEADERS], [
-               PHP_INSTALL_HEADERS(ext/http, $PHP_HTTP_HEADERS)
-       ], [
-               PHP_SUBST([PHP_HTTP_HEADERS])
-               PHP_ADD_MAKEFILE_FRAGMENT
-       ])
+       PHP_HTTP_HEADERS="
+               php_http_api.h \
+               php_http_buffer.h \
+               php_http_curl_client.h \
+               php_http_curl_client_datashare.h \
+               php_http_client_datashare.h \
+               php_http_client_factory.h \
+               php_http_client.h \
+               php_http_client_interface.h \
+               php_http_curl_client_pool.h \
+               php_http_client_pool.h \
+               php_http_client_request.h \
+               php_http_client_response.h \
+               php_http_cookie.h \
+               php_http_curl.h \
+               php_http_encoding.h \
+               php_http_env.h \
+               php_http_env_request.h \
+               php_http_env_response.h \
+               php_http_etag.h \
+               php_http_exception.h \
+               php_http_filter.h \
+               php_http.h \
+               php_http_header_parser.h \
+               php_http_header.h \
+               php_http_info.h \
+               php_http_message_body.h \
+               php_http_message.h \
+               php_http_message_parser.h \
+               php_http_misc.h \
+               php_http_negotiate.h \
+               php_http_object.h \
+               php_http_options.h \
+               php_http_params.h \
+               php_http_querystring.h \
+               php_http_strlist.h \
+               php_http_url.h \
+               php_http_version.h \
+       "
+       PHP_INSTALL_HEADERS(ext/http, $PHP_HTTP_HEADERS)
 
        AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support])
 fi
diff --git a/docs/examples/tutorial.txt b/docs/examples/tutorial.txt
deleted file mode 100644 (file)
index 8d8998d..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-
-A Beginners Tutorial
---------------------
-$Revision$
-
-
-- GET Queries
-
-       The HttpRequest class can be used to execute any HTTP request method.
-       The following example shows a simple GET request where a few query
-       parameters are supplied.  Additionally potential cookies will be
-       read from and written to a file.
-
-<?php
-$r = new HttpRequest('http://www.google.com/search');
-
-// store Googles cookies in a dedicated file
-touch('google.txt');
-$r->setOptions(
-       array(  'cookiestore'   => 'google.txt',
-       )
-);
-
-$r->setQueryData(
-       array(  'q'             => '+"pecl_http" -msg -cvs -list',
-                       'hl'    => 'de'
-       )
-);
-
-// HttpRequest::send() returns an HttpMessage object
-// of type HttpMessage::TYPE_RESPONSE or throws an exception
-try {
-       print $r->send()->getBody();
-} catch (HttpException $e) {
-       print $e;
-}
-?>
-
-- Multipart Posts
-
-       The following example shows an multipart POST request, with two form
-       fields and an image that's supposed to be uploaded to the server.
-       It's a bad habit as well as common practice to issue a redirect after
-       an received POST request, so we'll allow a redirect by enabling the
-       redirect option.
-
-<?php
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_POST);
-
-// if redirects is set to true, a single redirect is allowed;
-// one can set any reasonable count of allowed redirects
-$r->setOptions(
-       array(  'cookies'       => array('MyCookie' => 'has a value'),
-                       'redirect'      => true,
-       )
-);
-
-// common form data
-$r->setPostFields(
-       array(  'name'  => 'Mike',
-                       'mail'  => 'mike@php.net',
-       )
-);
-// add the file to post (form name, file name, file type)
-touch('profile.jpg');
-$r->addPostFile('image', 'profile.jpg', 'image/jpeg');
-
-try {
-       print $r->send()->getBody();
-} catch (HttpException $e) {
-       print $e;
-}
-?>
-
-- Parallel Requests
-
-       It's possible to execute several HttpRequests in parallel with the
-       HttpRequestPool class.  HttpRequests to send, do not need to perform
-       the same request method, but can only be attached to one HttpRequestPool
-       at the same time.
-
-<?php
-try {
-       $p = new HttpRequestPool;
-       // if you want to set _any_ options of the HttpRequest object,
-       // you need to do so *prior attaching* to the request pool!
-       $p->attach(new HttpRequest('http://pear.php.net', HTTP_METH_HEAD));
-       $p->attach(new HttpRequest('http://pecl.php.net', HTTP_METH_HEAD));
-} catch (HttpException $e) {
-       print $e;
-       exit;
-}
-
-try {
-       $p->send();
-       // HttpRequestPool implements an iterator over attached HttpRequest objects
-       foreach ($p as $r) {
-               echo "Checking ", $r->getUrl(), " reported ", $r->getResponseCode(), "\n";
-       }
-} catch (HttpException $e) {
-       print $e;
-}
-?>
-
-- Parallel Requests?
-
-       You can use a more advanced approach by using the protected interface of
-       the HttpRequestPool class.  This allows you to perform some other tasks
-       while the requests are executed.
-
-<?php
-class Pool extends HttpRequestPool
-{
-       public function __construct()
-       {
-               parent::__construct(
-                       new HttpRequest('http://pear.php.net', HTTP_METH_HEAD),
-                       new HttpRequest('http://pecl.php.net', HTTP_METH_HEAD)
-               );
-
-               // HttpRequestPool methods socketPerform() and socketSelect() are
-               // protected;  one could use this approach to do something else
-               // while the requests are being executed
-               print "Executing requests";
-               for ($i = 0; $this->socketPerform(); $i++) {
-                       $i % 10 or print ".";
-                       if (!$this->socketSelect()) {
-                               throw new HttpException("Socket error!");
-                       }
-               }
-               print "\nDone!\n";
-       }
-}
-
-try {
-       foreach (new Pool as $r) {
-               echo "Checking ", $r->getUrl(), " reported ", $r->getResponseCode(), "\n";
-       }
-} catch (HttpException $ex) {
-       print $e;
-}
-?>
-
-- Cached Responses
-
-       One of the main key features of HttpResponse is HTTP caching.  HttpResponse
-       will calculate an ETag based on the http.etag_mode INI setting as well as
-       it will determine the last modification time of the sent entity.  It uses
-       those two indicators to decide if the cache entry on the client side is
-       still valid and will emit an "304 Not Modified" response if applicable.
-
-<?php
-HttpResponse::setCacheControl('public');
-HttpResponse::setCache(true);
-HttpResponse::capture();
-
-print "This will be cached until content changes!\n";
-print "Note that this approach will only save the clients download time.\n";
-?>
-
-- Bandwidth Throttling
-
-       HttpResponse supports a basic throttling mechanism, which is enabled by
-       setting a throttle delay and a buffer size.  PHP will sleep the specified
-       amount of seconds after each sent chunk of specified bytes.
-
-<?php
-// send 5000 bytes every 0.2 seconds, i.e. max ~25kByte/s
-HttpResponse::setThrottleDelay(0.2);
-HttpResponse::setBufferSize(5000);
-HttpResponse::setCache(true);
-HttpResponse::setContentType('application/x-zip');
-HttpResponse::setFile('../archive.zip');
-HttpResponse::send();
-?>
diff --git a/docs/functions.html b/docs/functions.html
deleted file mode 100644 (file)
index 743a151..0000000
+++ /dev/null
@@ -1,1471 +0,0 @@
-<html>
-<head>
-    <title>Function Summary of ext/http</title>
-    <style>
-        body { 
-            font-size: 80%; 
-            font-family: sans-serif; 
-        } 
-        h2, h3 { 
-            color: #339; 
-            clear: both;
-            font-size: 1.2em;
-            background: #ffc;
-            padding: .2em;
-        } 
-        h2.o {
-            color: #66b; 
-            clear: both;
-            font-size: 1.3em;
-            background: #f0f0f0;
-            padding: .2em;
-        }
-        p { 
-            margin-left: 1em;
-        } 
-        pre { 
-            font-size: 1.2em; 
-        } 
-        br { 
-            display: none; 
-        } 
-        blockquote {
-            margin-bottom: 3em;
-            border: 1px solid #ccc;
-            background: #f0f0f0;
-            padding: 0em 1em;
-            width: auto;
-            float: left;
-        }
-        p, pre {
-            clear: both;
-        }
-        p br, pre code br { 
-            display: block; 
-        } 
-        .toc {
-            position: absolute;
-            top: 10px;
-            right: 10px;
-            width: 300px;
-            height: 95%;
-            overflow: scroll;
-            font-size: .9em;
-        }
-        body>div.toc {
-            position: fixed;
-        }
-        .toc ul {
-            padding-left: 15px;
-            margin-left: 0;
-        }
-        .toc li {
-            padding: 0;
-            margin: 0;
-        }
-        .tocfile {
-            font-weight: bold;
-        }
-    </style>
-</head>
-<body><h1 id="http_functions.c">http_functions.c</h1>
-<h2 id="http_date">string http_date([int timestamp])</h2>
-<p>Compose a valid HTTP date regarding RFC 1123<br />
-looking like: "Wed, 22 Dec 2004 11:34:47 GMT"</p>
-<p>Accepts an optional unix timestamp as parameter.</p>
-<p>Returns the HTTP date as string.</p>
-<h2 id="http_build_url">string http_build_url([mixed url[, mixed parts[, int flags = HTTP_URL_REPLACE[, array &new_url]]]])</h2>
-<p>Build an URL.</p>
-<p>Expexts (part(s) of) an URL as first parameter in form of a string or assoziative array<br />
-like parse_url() returns.  Accepts an optional second parameter in the same way as the<br />
-first argument.  Accepts an optional third integer parameter, which is a bitmask of<br />
-binary or'ed HTTP_URL_* constants.  The optional fourth parameter will be filled<br />
-with the results as associative array like parse_url() would return.</p>
-<p>The parts of the second URL will be merged into the first according to the flags argument.<br />
-The following flags are recognized:</p><pre>   - HTTP_URL_REPLACE:        (default) set parts of the second url will replace the parts in the first<br />
-       - HTTP_URL_JOIN_PATH:      the path of the second url will be merged into the one of the first<br />
-       - HTTP_URL_JOIN_QUERY:     the two querystrings will be merged recursively<br />
-       - HTTP_URL_STRIP_USER:     the user part will not appear in the result<br />
-       - HTTP_URL_STRIP_PASS:     the password part will not appear in the result<br />
-       - HTTP_URL_STRIP_AUTH:     neither the user nor the password part will appear in the result<br />
-       - HTTP_URL_STRIP_PORT:     no explicit port will be set in the result<br />
-       - HTTP_URL_STRIP_PATH:     the path part will not appear in the result<br />
-       - HTTP_URL_STRIP_QUERY:    no query string will be present in the result<br />
-       - HTTP_URL_STRIP_FRAGMENT: no fragment will be present in the result<br />
-</pre></p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;ftp://ftp.example.com/pub/files/current/?a=b&amp;a=c<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">http_build_url</span><span style="color: #007700">(</span><span style="color: #DD0000">"http://user@www.example.com/pub/index.php?a=b#files"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"scheme"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"ftp"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"host"&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"ftp.example.com"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"path"&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"files/current/"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"query"&nbsp;&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">"a=c"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">HTTP_URL_STRIP_AUTH&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">HTTP_URL_JOIN_PATH&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">HTTP_URL_JOIN_QUERY&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">HTTP_URL_STRIP_FRAGMENT<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre><br />
-Returns the new URL as string on success or FALSE on failure.</p>
-<h2 id="http_build_str">string http_build_str(array query [, string prefix[, string arg_separator]])</h2>
-<p>Opponent to parse_str().</p>
-<p>Expects an array as first argument which represents the parts of the query string to build.<br />
-Accepts a string as optional second parameter containing a top-level prefix to use.<br />
-The optional third parameter should specify an argument separator to use (by default the<br />
-INI setting arg_separator.output will be used, or "&" if neither is set).</p>
-<p>Returns the built query as string on success or FALSE on failure.</p>
-<h2 id="http_negotiate_language">string http_negotiate_language(array supported[, array &result])</h2>
-<p>This function negotiates the clients preferred language based on its<br />
-Accept-Language HTTP header.  The qualifier is recognized and languages <br />
-without qualifier are rated highest.  The qualifier will be decreased by<br />
-10% for partial matches (i.e. matching primary language).</p>
-<p>Expects an array as parameter containing the supported languages as values.<br />
-If the optional second parameter is supplied, it will be filled with an<br />
-array containing the negotiation results.</p>
-<p>Returns the negotiated language or the default language (i.e. first array entry) <br />
-if none match.</p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br />$langs&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'en-US'</span><span style="color: #007700">,</span><span style="color: #FF8000">//&nbsp;default<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'fr'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'fr-FR'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'de'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'de-DE'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'de-AT'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'de-CH'</span><span style="color: #007700">,<br />);<br /><br />include&nbsp;</span><span style="color: #DD0000">'./langs/'</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">http_negotiate_language</span><span style="color: #007700">(</span><span style="color: #0000BB">$langs</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">)&nbsp;.</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">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h2 id="http_negotiate_charset">string http_negotiate_charset(array supported[, array &result])</h2>
-<p>This function negotiates the clients preferred charset based on its<br />
-Accept-Charset HTTP header.  The qualifier is recognized and charsets <br />
-without qualifier are rated highest.</p>
-<p>Expects an array as parameter containing the supported charsets as values.<br />
-If the optional second parameter is supplied, it will be filled with an<br />
-array containing the negotiation results.</p>
-<p>Returns the negotiated charset or the default charset (i.e. first array entry) <br />
-if none match.</p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br />$charsets&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'iso-8859-1'</span><span style="color: #007700">,&nbsp;</span><span style="color: #FF8000">//&nbsp;default<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'iso-8859-2'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'iso-8859-15'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'utf-8'<br /></span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$pref&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">http_negotiate_charset</span><span style="color: #007700">(</span><span style="color: #0000BB">$charsets</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">);<br /><br />if&nbsp;(</span><span style="color: #0000BB">strcmp</span><span style="color: #007700">(</span><span style="color: #0000BB">$pref</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'iso-8859-1'</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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">,&nbsp;</span><span style="color: #DD0000">'iso-8859-1'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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">,&nbsp;</span><span style="color: #0000BB">$pref</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h2 id="http_negotiate_content_type">string http_negotiate_ctype(array supported[, array &result])</h2>
-<p>This function negotiates the clients preferred content type based on its<br />
-Accept HTTP header.  The qualifier is recognized and content types <br />
-without qualifier are rated highest.</p>
-<p>Expects an array as parameter containing the supported content types as values.<br />
-If the optional second parameter is supplied, it will be filled with an<br />
-array containing the negotiation results.</p>
-<p>Returns the negotiated content type or the default content type <br />
-(i.e. first array entry) if none match.</p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br />$ctypes&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'application/xhtml+xml'</span><span style="color: #007700">,&nbsp;</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">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h2 id="http_send_status">bool http_send_status(int status)</h2>
-<p>Send HTTP status code.</p>
-<p>Expects an HTTP status code as parameter.</p>
-<p>Returns TRUE on success or FALSE on failure.</p>
-<h2 id="http_send_last_modified">bool http_send_last_modified([int timestamp])</h2>
-<p>Send a "Last-Modified" header with a valid HTTP date.</p>
-<p>Accepts a unix timestamp, converts it to a valid HTTP date and<br />
-sends it as "Last-Modified" HTTP header.  If timestamp is<br />
-omitted, the current time will be sent.</p>
-<p>Returns TRUE on success or FALSE on failure.</p>
-<h2 id="http_send_content_type">bool http_send_content_type([string content_type = 'application/x-octetstream'])</h2>
-<p>Send the Content-Type of the sent entity.  This is particularly important<br />
-if you use the http_send() API.</p>
-<p>Accepts an optional string parameter containing the desired content type <br />
-(primary/secondary).</p>
-<p>Returns TRUE on success or FALSE on failure.</p>
-<h2 id="http_send_content_disposition">bool http_send_content_disposition(string filename[, bool inline = false])</h2>
-<p>Send the Content-Disposition.  The Content-Disposition header is very useful<br />
-if the data actually sent came from a file or something similar, that should<br />
-be "saved" by the client/user (i.e. by browsers "Save as..." popup window).</p>
-<p>Expects a string parameter specifying the file name the "Save as..." dialog<br />
-should display.  Optionally accepts a bool parameter, which, if set to true<br />
-and the user agent knows how to handle the content type, will probably not<br />
-cause the popup window to be shown.</p>
-<p>Returns TRUE on success or FALSE on failure.</p>
-<h2 id="http_match_modified">bool http_match_modified([int timestamp[, bool for_range = false]])</h2>
-<p>Matches the given unix timestamp against the clients "If-Modified-Since" <br />
-resp. "If-Unmodified-Since" HTTP headers.</p>
-<p>Accepts a unix timestamp which should be matched.  Optionally accepts an<br />
-additional bool parameter, which if set to true will check the header <br />
-usually used to validate HTTP ranges.  If timestamp is omitted, the<br />
-current time will be used.</p>
-<p>Returns TRUE if timestamp represents an earlier date than the header,<br />
-else FALSE.</p>
-<h2 id="http_match_etag">bool http_match_etag(string etag[, bool for_range = false])</h2>
-<p>Matches the given ETag against the clients "If-Match" resp. <br />
-"If-None-Match" HTTP headers.</p>
-<p>Expects a string parameter containing the ETag to compare.  Optionally<br />
-accepts a bool parameter, which, if set to true, will check the header<br />
-usually used to validate HTTP ranges.</p>
-<p>Returns TRUE if ETag matches or the header contained the asterisk ("*"),<br />
-else FALSE.</p>
-<h2 id="http_cache_last_modified">bool http_cache_last_modified([int timestamp_or_expires]])</h2>
-<p>Attempts to cache the sent entity by its last modification date.</p>
-<p>Accepts a unix timestamp as parameter which is handled as follows:</p>
-<p>If timestamp_or_expires is greater than 0, it is handled as timestamp<br />
-and will be sent as date of last modification.  If it is 0 or omitted,<br />
-the current time will be sent as Last-Modified date.  If it's negative,<br />
-it is handled as expiration time in seconds, which means that if the<br />
-requested last modification date is not between the calculated timespan,<br />
-the Last-Modified header is updated and the actual body will be sent.</p>
-<p>Returns FALSE on failure, or *exits* with "304 Not Modified" if the entity is cached.</p>
-<p>A log entry will be written to the cache log if the INI entry<br />
-http.log.cache is set and the cache attempt was successful.</p>
-<h2 id="http_cache_etag">bool http_cache_etag([string etag])</h2>
-<p>Attempts to cache the sent entity by its ETag, either supplied or generated <br />
-by the hash algorithm specified by the INI setting "http.etag.mode".</p>
-<p>If the clients "If-None-Match" header matches the supplied/calculated<br />
-ETag, the body is considered cached on the clients side and<br />
-a "304 Not Modified" status code is issued.</p>
-<p>Returns FALSE on failure, or *exits* with "304 Not Modified" if the entity is cached.</p>
-<p>A log entry is written to the cache log if the INI entry<br />
-"http.log.cache" is set and the cache attempt was successful.</p>
-<h2 id="ob_etaghandler">string ob_etaghandler(string data, int mode)</h2>
-<p>For use with ob_start().  Output buffer handler generating an ETag with<br />
-the hash algorithm specified with the INI setting "http.etag.mode".</p>
-<h2 id="http_throttle">void http_throttle(double sec[, int bytes = 40960])</h2>
-<p>Sets the throttle delay and send buffer size for use with http_send() API.<br />
-Provides a basic throttling mechanism, which will yield the current process<br />
-resp. thread until the entity has been completely sent, though.</p>
-<p>Expects a double parameter specifying the seconds too sleep() after<br />
-each chunk sent.  Additionally accepts an optional int parameter<br />
-representing the chunk size in bytes.</p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;~&nbsp;20&nbsp;kbyte/s<br />#&nbsp;http_throttle(1,&nbsp;20000);<br />#&nbsp;http_throttle(0.5,&nbsp;10000);<br />#&nbsp;http_throttle(0.1,&nbsp;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">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h2 id="http_redirect">void http_redirect([string url[, array params[, bool session = false[, int status = 302]]]])</h2>
-<p>Redirect to the given url.<br />
- <br />
-The supplied url will be expanded with http_build_url(), the params array will<br />
-be treated with http_build_query() and the session identification will be appended<br />
-if session is true.</p>
-<p>The HTTP response code will be set according to status.<br />
-You can use one of the following constants for convenience:<br />
- - HTTP_REDIRECT                       302 Found for GET/HEAD, else 303 See Other<br />
- - HTTP_REDIRECT_PERM  301 Moved Permanently<br />
- - HTTP_REDIRECT_FOUND 302 Found<br />
- - HTTP_REDIRECT_POST  303 See Other<br />
- - HTTP_REDIRECT_PROXY 305 Use Proxy<br />
- - HTTP_REDIRECT_TEMP  307 Temporary Redirect</p>
-<p>Please see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3<br />
-for which redirect response code to use in which situation.</p>
-<p>To be RFC compliant, "Redirecting to <a>URL</a>." will be displayed,<br />
-if the client doesn't redirect immediately, and the request method was<br />
-another one than HEAD.</p>
-<p>Returns FALSE on failure, or *exits* on success.</p>
-<p>A log entry will be written to the redirect log, if the INI entry<br />
-"http.log.redirect" is set and the redirect attempt was successful.</p>
-<h2 id="http_send_data">bool http_send_data(string data)</h2>
-<p>Sends raw data with support for (multiple) range requests.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h2 id="http_send_file">bool http_send_file(string file)</h2>
-<p>Sends a file with support for (multiple) range requests.</p>
-<p>Expects a string parameter referencing the file to send.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h2 id="http_send_stream">bool http_send_stream(resource stream)</h2>
-<p>Sends an already opened stream with support for (multiple) range requests.</p>
-<p>Expects a resource parameter referencing the stream to read from.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h2 id="http_chunked_decode">string http_chunked_decode(string encoded)</h2>
-<p>Decodes a string that was HTTP-chunked encoded.</p>
-<p>Expects a chunked encoded string as parameter.</p>
-<p>Returns the decoded string on success or FALSE on failure.</p>
-<h2 id="http_parse_message">object http_parse_message(string message)</h2>
-<p>Parses (a) http_message(s) into a simple recursive object structure.</p>
-<p>Expects a string parameter containing a single HTTP message or<br />
-several consecutive HTTP messages.</p>
-<p>Returns an hierarchical object structure of the parsed messages.</p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?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">,&nbsp;array(</span><span style="color: #DD0000">'redirect'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">)));<br /><br /></span><span style="color: #0000BB">stdClass&nbsp;object<br /></span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">type</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">2<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">httpVersion</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">1.1<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">responseCode</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">200<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">headers</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;Array&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">Content</span><span style="color: #007700">-</span><span style="color: #0000BB">Length</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">3<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">Server</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">Apache<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">body</span><span style="color: #007700">]&nbsp;&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">Hi</span><span style="color: #007700">!<br />&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">parentMessage</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">stdClass&nbsp;object<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">type</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">2<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">httpVersion</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">1.1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">responseCode</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">302<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">headers</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;Array&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">Content</span><span style="color: #007700">-</span><span style="color: #0000BB">Length</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">0<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">Location</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;...<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">body</span><span style="color: #007700">]&nbsp;&nbsp;=&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">parentMessage</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;...<br />&nbsp;&nbsp;&nbsp;&nbsp;)<br />)<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h2 id="http_parse_headers">array http_parse_headers(string header)</h2>
-<p>Parses HTTP headers into an associative array.</p>
-<p>Expects a string parameter containing HTTP headers.</p>
-<p>Returns an array on success, or FALSE on failure.</p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br />$headers&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"content-type:&nbsp;text/html;&nbsp;charset=UTF-8\r\n"</span><span style="color: #007700">.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"Server:&nbsp;Funky/1.0\r\n"</span><span style="color: #007700">.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"Set-Cookie:&nbsp;foo=bar\r\n"</span><span style="color: #007700">.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"Set-Cookie:&nbsp;baz=quux\r\n"</span><span style="color: #007700">.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"Folded:&nbsp;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 />&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">Content</span><span style="color: #007700">-</span><span style="color: #0000BB">Type</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">text</span><span style="color: #007700">/</span><span style="color: #0000BB">html</span><span style="color: #007700">;&nbsp;</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 />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">Server</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">Funky</span><span style="color: #007700">/</span><span style="color: #0000BB">1.0<br />&nbsp;&nbsp;&nbsp;&nbsp;</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">]&nbsp;=&gt;&nbsp;Array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">0</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">foo</span><span style="color: #007700">=</span><span style="color: #0000BB">bar<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">baz</span><span style="color: #007700">=</span><span style="color: #0000BB">quux<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">Folded</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">works<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;too&nbsp;<br /></span><span style="color: #007700">)&nbsp;<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h2 id="http_parse_cookie">object http_parse_cookie(string cookie[, int flags[, array allowed_extras]])</h2>
-<p>Parses HTTP cookies like sent in a response into a struct.</p>
-<p>Expects a string as parameter containing the value of a Set-Cookie response header.</p>
-<p>Returns an stdClass olike shown in the example on success or FALSE on failure.</p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?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;&nbsp;bar=baz;&nbsp;path=/;&nbsp;domain=example.com;&nbsp;comment=;&nbsp;secure"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">"comment"</span><span style="color: #007700">)));<br /><br /></span><span style="color: #0000BB">stdClass&nbsp;Object<br /></span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">cookies</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;Array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">foo</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">bar<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">bar</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">baz<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">extras</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;Array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">comment</span><span style="color: #007700">]&nbsp;=&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">flags</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">16<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">expires</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">0<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">[</span><span style="color: #0000BB">path</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;/<br />&nbsp;&nbsp;&nbsp;&nbsp;[</span><span style="color: #0000BB">domain</span><span style="color: #007700">]&nbsp;=&gt;&nbsp;</span><span style="color: #0000BB">example</span><span style="color: #007700">.</span><span style="color: #0000BB">com<br /></span><span style="color: #007700">)<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h2 id="http_parse_params">object http_parse_params(string param[, int flags = HTTP_PARAMS_DEFAULT])</h2>
-<p>Parse parameter list.</p>
-<h2 id="http_get_request_headers">array http_get_request_headers(void)</h2>
-<p>Get a list of incoming HTTP headers.</p>
-<p>Returns an associative array of incoming request headers.</p>
-<h2 id="http_get_request_body">string http_get_request_body(void)</h2>
-<p>Get the raw request body (e.g. POST or PUT data).</p>
-<p>This function can not be used after http_get_request_body_stream() <br />
-if the request method was another than POST.</p>
-<p>Returns the raw request body as string on success or NULL on failure.</p>
-<h2 id="http_get_request_body_stream">resource http_get_request_body_stream(void)</h2>
-<p>Create a stream to read the raw request body (e.g. POST or PUT data).</p>
-<p>This function can only be used once if the request method was another than POST.</p>
-<p>Returns the raw request body as stream on success or NULL on failure.</p>
-<h2 id="http_match_request_header">bool http_match_request_header(string header, string value[, bool match_case = false])</h2>
-<p>Match an incoming HTTP header.</p>
-<p>Expects two string parameters representing the header name (case-insensitive)<br />
-and the header value that should be compared.  The case sensitivity of the<br />
-header value depends on the additional optional bool parameter accepted.</p>
-<p>Returns TRUE if header value matches, else FALSE.</p>
-<h2 id="http_get">string http_get(string url[, array options[, array &info]])</h2>
-<p>Performs an HTTP GET request on the supplied url.</p>
-<p>The second parameter, if set, is expected to be an associative<br />
-array where the following keys will be recognized:</p><pre> - redirect:         int, whether and how many redirects to follow<br />
- - unrestrictedauth: bool, whether to continue sending credentials on<br />
-                     redirects to a different host<br />
- - proxyhost:        string, proxy host in "host[:port]" format<br />
- - proxyport:        int, use another proxy port as specified in proxyhost<br />
- - proxytype:        int, HTTP_PROXY_HTTP, SOCKS4 or SOCKS5<br />
- - proxyauth:        string, proxy credentials in "user:pass" format<br />
- - proxyauthtype:    int, HTTP_AUTH_BASIC and/or HTTP_AUTH_NTLM<br />
- - httpauth:         string, http credentials in "user:pass" format<br />
- - httpauthtype:     int, HTTP_AUTH_BASIC, DIGEST and/or NTLM<br />
- - compress:         bool, whether to allow gzip/deflate content encoding<br />
- - port:             int, use another port as specified in the url<br />
- - referer:          string, the referer to send<br />
- - useragent:        string, the user agent to send<br />
-                     (defaults to PECL::HTTP/version (PHP/version)))<br />
- - headers:          array, list of custom headers as associative array<br />
-                     like array("header" => "value")<br />
- - cookies:          array, list of cookies as associative array<br />
-                     like array("cookie" => "value")<br />
- - encodecookies:    bool, whether to urlencode the cookies (default: true)<br />
- - cookiestore:      string, path to a file where cookies are/will be stored<br />
- - cookiesession:    bool, don't load session cookies from cookiestore if TRUE<br />
- - resume:           int, byte offset to start the download from;<br />
-                     if the server supports ranges<br />
- - range:            array, array of arrays, each containing two integers,<br />
-                     specifying the ranges to download if server support is<br />
-                     given; only recognized if the resume option is empty<br />
- - maxfilesize:      int, maximum file size that should be downloaded;<br />
-                     has no effect, if the size of the requested entity is not known<br />
- - lastmodified:     int, timestamp for If-(Un)Modified-Since header<br />
- - etag:             string, quoted etag for If-(None-)Match header<br />
- - timeout:          int, seconds the request may take<br />
- - connecttimeout:   int, seconds the connect may take<br />
- - onprogress:       mixed, progress callback<br />
- - interface:        string, outgoing network interface (ifname, ip or hostname)<br />
- - portrange:        array, 2 integers specifying outgoing portrange to try<br />
- - ssl:              array, with the following options:<br />
-                     cert:        string, path to certificate<br />
-                     certtype:    string, type of certificate<br />
-                     certpasswd:  string, password for certificate<br />
-                     key:         string, path to key<br />
-                     keytype:     string, type of key<br />
-                     keypasswd:   string, pasword for key<br />
-                     engine:      string, ssl engine to use<br />
-                     version:     int, ssl version to use<br />
-                     verifypeer:  bool, whether to verify the peer<br />
-                     verifyhost:  bool whether to verify the host<br />
-                     cipher_list: string, list of allowed ciphers<br />
-                     cainfo:      string<br />
-                     capath:      string<br />
-                     random_file: string<br />
-                     egdsocket:   string<br />
-</pre></p>
-<p>The optional third parameter will be filled with some additional information<br />
-in form of an associative array, if supplied, like the following example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">array&nbsp;(<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'effective_url'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'http://www.example.com/'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'response_code'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">302</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'connect_code'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'filetime'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'total_time'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0.212348</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'namelookup_time'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0.038296</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'connect_time'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0.104144</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'pretransfer_time'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0.104307</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'starttransfer_time'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0.212077</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'redirect_time'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'redirect_count'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'size_upload'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'size_download'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">218</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'speed_download'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">1026</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'speed_upload'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'header_size'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">307</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'request_size'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">103</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'ssl_verifyresult'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'ssl_engines'&nbsp;</span><span style="color: #007700">=&gt;<br />&nbsp;&nbsp;&nbsp;array&nbsp;(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'dynamic'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">1&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'cswift'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">2&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'chil'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">3&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'atalla'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">4&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'nuron'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">5&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'ubsec'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">6&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'aep'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">7&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'sureware'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">8&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'4758cca'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;),<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'content_length_download'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">218</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'content_length_upload'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'content_type'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'text/html'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'httpauth_avail'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'proxyauth_avail'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'num_connects'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'os_errno'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'error'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />&nbsp;)<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<p>Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
-<h2 id="http_head">string http_head(string url[, array options[, array &info]])</h2>
-<p>Performs an HTTP HEAD request on the supplied url.</p>
-<p>See http_get() for a full list of available parameters and options.</p>
-<p>Returns the HTTP response as string on success, or FALSE on failure.</p>
-<h2 id="http_post_data">string http_post_data(string url, string data[, array options[, array &info]])</h2>
-<p>Performs an HTTP POST request on the supplied url.</p>
-<p>Expects a string as second parameter containing the pre-encoded post data.<br />
-See http_get() for a full list of available parameters and options.<br />
- <br />
-Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
-<h2 id="http_post_fields">string http_post_fields(string url, array data[, array files[, array options[, array &info]]])</h2>
-<p>Performs an HTTP POST request on the supplied url.</p>
-<p>Expects an associative array as second parameter, which will be<br />
-www-form-urlencoded. See http_get() for a full list of available options.</p>
-<p>Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
-<h2 id="http_put_file">string http_put_file(string url, string file[, array options[, array &info]])</h2>
-<p>Performs an HTTP PUT request on the supplied url.</p>
-<p>Expects the second parameter to be a string referencing the file to upload.<br />
-See http_get() for a full list of available options.</p>
-<p>Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
-<h2 id="http_put_stream">string http_put_stream(string url, resource stream[, array options[, array &info]])</h2>
-<p>Performs an HTTP PUT request on the supplied url.</p>
-<p>Expects the second parameter to be a resource referencing an already <br />
-opened stream, from which the data to upload should be read.<br />
-See http_get() for a full list of available options.</p>
-<p>Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
-<h2 id="http_put_data">string http_put_data(string url, string data[, array options[, array &info]])</h2>
-<p>Performs an HTTP PUT request on the supplied url.</p>
-<p>Expects the second parameter to be a string containing the data to upload.<br />
-See http_get() for a full list of available options.</p>
-<p>Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
-<h2 id="http_request">string http_request(int method, string url[, string body[, array options[, array &info]]])</h2>
-<p>Performs a custom HTTP request on the supplied url.</p>
-<p>Expects the first parameter to be an integer specifying the request method to use.<br />
-Accepts an optional third string parameter containing the raw request body.<br />
-See http_get() for a full list of available options.</p>
-<p>Returns the HTTP response(s) as string on success, or FALSE on failure.</p>
-<h2 id="http_request_body_encode">string http_request_body_encode(array fields, array files)</h2>
-<p>Generate x-www-form-urlencoded resp. form-data encoded request body.</p>
-<p>Returns encoded string on success, or FALSE on failure.</p>
-<h2 id="http_request_method_register">int http_request_method_register(string method)</h2>
-<p>Register a custom request method.</p>
-<p>Expects a string parameter containing the request method name to register.</p>
-<p>Returns the ID of the request method on success, or FALSE on failure.</p>
-<h2 id="http_request_method_unregister">bool http_request_method_unregister(mixed method)</h2>
-<p>Unregister a previously registered custom request method.</p>
-<p>Expects either the request method name or ID.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h2 id="http_request_method_exists">int http_request_method_exists(mixed method)</h2>
-<p>Check if a request method is registered (or available by default).</p>
-<p>Expects either the request method name or ID as parameter.</p>
-<p>Returns TRUE if the request method is known, else FALSE.</p>
-<h2 id="http_request_method_name">string http_request_method_name(int method)</h2>
-<p>Get the literal string representation of a standard or registered request method.</p>
-<p>Expects the request method ID as parameter.</p>
-<p>Returns the request method name as string on success, or FALSE on failure.</p>
-<h2 id="http_deflate">string http_deflate(string data[, int flags = 0])</h2>
-<p>Compress data with gzip, zlib AKA deflate or raw deflate encoding.</p>
-<p>Expects the first parameter to be a string containing the data that should<br />
-be encoded.</p>
-<p>Returns the encoded string on success, or NULL on failure.</p>
-<h2 id="http_inflate">string http_inflate(string data)</h2>
-<p>Decompress data compressed with either gzip, deflate AKA zlib or raw<br />
-deflate encoding.</p>
-<p>Expects a string as parameter containing the compressed data.</p>
-<p>Returns the decoded string on success, or NULL on failure.</p>
-<h2 id="ob_deflatehandler">string ob_deflatehandler(string data, int mode)</h2>
-<p>For use with ob_start(). The deflate output buffer handler can only be used once.<br />
-It conflicts with ob_gzhandler and zlib.output_compression as well and should<br />
-not be used after ext/mbstrings mb_output_handler and ext/sessions URL-Rewriter (AKA<br />
-session.use_trans_sid).</p>
-<h2 id="ob_inflatehandler">string ob_inflatehandler(string data, int mode)</h2>
-<p>For use with ob_start().  Same restrictions as with ob_deflatehandler apply.</p>
-<h2 id="http_support">int http_support([int feature = 0])</h2>
-<p>Check for feature that require external libraries.</p>
-<p>Accepts an optional in parameter specifying which feature to probe for.<br />
-If the parameter is 0 or omitted, the return value contains a bitmask of <br />
-all supported features that depend on external libraries.</p>
-<p>Available features to probe for are:<br />
-<ul> <br />
- <li> HTTP_SUPPORT: always set<br />
- <li> HTTP_SUPPORT_REQUESTS: whether ext/http was linked against libcurl,<br />
-      and HTTP requests can be issued<br />
- <li> HTTP_SUPPORT_SSLREQUESTS: whether libcurl was linked against openssl,<br />
-      and SSL requests can be issued <br />
- <li> HTTP_SUPPORT_ENCODINGS: whether ext/http was linked against zlib,<br />
-      and compressed HTTP responses can be decoded<br />
- <li> HTTP_SUPPORT_MAGICMIME: whether ext/http was linked against libmagic,<br />
-      and the HttpResponse::guessContentType() method is usable<br />
-</ul></p>
-<p>Returns int, whether requested feature is supported, or a bitmask with<br />
-all supported features.</p>
-<hr noshade>
-<h1 id="http_deflatestream_object.c">http_deflatestream_object.c</h1>
-<h2 id="HttpDeflateStream" class="o">HttpDeflateStream</h2>
-<h3 id="HttpDeflateStream___construct">void HttpDeflateStream::__construct([int flags = 0])</h3>
-<p>Creates a new HttpDeflateStream object instance.</p>
-<p>Accepts an optional int parameter specifying how to initialize the deflate stream.</p>
-<h3 id="HttpDeflateStream_update">string HttpDeflateStream::update(string data)</h3>
-<p>Passes more data through the deflate stream.</p>
-<p>Expects a string parameter containing (a part of) the data to deflate.</p>
-<p>Returns deflated data on success or FALSE on failure.</p>
-<h3 id="HttpDeflateStream_flush">string HttpDeflateStream::flush([string data])</h3>
-<p>Flushes the deflate stream.</p>
-<p>Returns some deflated data as string on success or FALSE on failure.</p>
-<h3 id="HttpDeflateStream_finish">string HttpDeflateStream::finish([string data])</h3>
-<p>Finalizes the deflate stream.  The deflate stream can be reused after finalizing.</p>
-<p>Returns the final part of deflated data.</p>
-<hr noshade>
-<h1 id="http_inflatestream_object.c">http_inflatestream_object.c</h1>
-<h2 id="HttpInflateStream" class="o">HttpInflateStream</h2>
-<h3 id="HttpInflateStream___construct">void HttpInflateStream::__construct([int flags = 0])</h3>
-<p>Creates a new HttpInflateStream object instance.</p>
-<p>Accepts an optional int parameter specifying how to initialize the inflate stream.</p>
-<h3 id="HttpInflateStream_update">string HttpInflateStream::update(string data)</h3>
-<p>Passes more data through the inflate stream.</p>
-<p>Expects a string parameter containing (a part of) the data to inflate.</p>
-<p>Returns inflated data on success or FALSE on failure.</p>
-<h3 id="HttpInflateStream_flush">string HttpInflateStream::flush([string data])</h3>
-<p>Flush the inflate stream.</p>
-<p>Returns some inflated data as string on success or FALSE on failure.</p>
-<h3 id="HttpInflateStream_finish">string HttpInflateStream::finish([string data])</h3>
-<p>Finalizes the inflate stream.  The inflate stream can be reused after finalizing.</p>
-<p>Returns the final part of inflated data.</p>
-<hr noshade>
-<h1 id="http_message_object.c">http_message_object.c</h1>
-<h2 id="HttpMessage" class="o">HttpMessage</h2>
-<h3 id="HttpMessage___construct">void HttpMessage::__construct([string message])</h3>
-<p>Instantiate a new HttpMessage object.</p>
-<p>Accepts an optional string parameter containing a single or several <br />
-consecutive HTTP messages.  The constructed object will actually <br />
-represent the *last* message of the passed string.  If there were<br />
-prior messages, those can be accessed by HttpMessage::getParentMessage().</p>
-<p>Throws HttpMalformedHeaderException.</p>
-<h3 id="HttpMessage_fromString">static HttpMessage HttpMessage::fromString(string raw_message[, string class_name = "HttpMessage"])</h3>
-<p>Create an HttpMessage object from a string. Kind of a static constructor.</p>
-<p>Expects a string parameter containing a single or several consecutive<br />
-HTTP messages.  Accepts an optional string parameter specifying the class to use.</p>
-<p>Returns an HttpMessage object on success or NULL on failure.</p>
-<p>Throws HttpMalformedHeadersException.</p>
-<h3 id="HttpMessage_getBody">string HttpMessage::getBody()</h3>
-<p>Get the body of the parsed HttpMessage.</p>
-<p>Returns the message body as string.</p>
-<h3 id="HttpMessage_setBody">void HttpMessage::setBody(string body)</h3>
-<p>Set the body of the HttpMessage.<br />
-NOTE: Don't forget to update any headers accordingly.</p>
-<p>Expects a string parameter containing the new body of the message.</p>
-<h3 id="HttpMessage_getHeader">string HttpMessage::getHeader(string header)</h3>
-<p>Get message header.</p>
-<p>Returns the header value on success or NULL if the header does not exist.</p>
-<h3 id="HttpMessage_getHeaders">array HttpMessage::getHeaders()</h3>
-<p>Get Message Headers.</p>
-<p>Returns an associative array containing the messages HTTP headers.</p>
-<h3 id="HttpMessage_setHeaders">void HttpMessage::setHeaders(array headers)</h3>
-<p>Sets new headers.</p>
-<p>Expects an associative array as parameter containing the new HTTP headers,<br />
-which will replace *all* previous HTTP headers of the message.</p>
-<h3 id="HttpMessage_addHeaders">void HttpMessage::addHeaders(array headers[, bool append = false])</h3>
-<p>Add headers. If append is true, headers with the same name will be separated, else overwritten.</p>
-<p>Expects an associative array as parameter containing the additional HTTP headers<br />
-to add to the messages existing headers.  If the optional bool parameter is true,<br />
-and a header with the same name of one to add exists already, this respective<br />
-header will be converted to an array containing both header values, otherwise<br />
-it will be overwritten with the new header value.</p>
-<h3 id="HttpMessage_getType">int HttpMessage::getType()</h3>
-<p>Get Message Type. (HTTP_MSG_NONE|HTTP_MSG_REQUEST|HTTP_MSG_RESPONSE)</p>
-<p>Returns the HttpMessage::TYPE.</p>
-<h3 id="HttpMessage_setType">void HttpMessage::setType(int type)</h3>
-<p>Set Message Type. (HTTP_MSG_NONE|HTTP_MSG_REQUEST|HTTP_MSG_RESPONSE)</p>
-<p>Expects an int parameter, the HttpMessage::TYPE.</p>
-<h3 id="HttpMessage_getResponseCode">int HttpMessage::getResponseCode()</h3>
-<p>Get the Response Code of the Message.</p>
-<p>Returns the HTTP response code if the message is of type <br />
-HttpMessage::TYPE_RESPONSE, else FALSE.</p>
-<h3 id="HttpMessage_setResponseCode">bool HttpMessage::setResponseCode(int code)</h3>
-<p>Set the response code of an HTTP Response Message.</p>
-<p>Expects an int parameter with the HTTP response code.</p>
-<p>Returns TRUE on success, or FALSE if the message is not of type<br />
-HttpMessage::TYPE_RESPONSE or the response code is out of range (100-510).</p>
-<h3 id="HttpMessage_getResponseStatus">string HttpMessage::getResponseStatus()</h3>
-<p>Get the Response Status of the message (i.e. the string following the response code).</p>
-<p>Returns the HTTP response status string if the message is of type <br />
-HttpMessage::TYPE_RESPONSE, else FALSE.</p>
-<h3 id="HttpMessage_setResponseStatus">bool HttpMessage::setResponseStatus(string status)</h3>
-<p>Set the Response Status of the HTTP message (i.e. the string following the response code).</p>
-<p>Expects a string parameter containing the response status text.</p>
-<p>Returns TRUE on success or FALSE if the message is not of type<br />
-HttpMessage::TYPE_RESPONSE.</p>
-<h3 id="HttpMessage_getRequestMethod">string HttpMessage::getRequestMethod()</h3>
-<p>Get the Request Method of the Message.</p>
-<p>Returns the request method name on success, or FALSE if the message is<br />
-not of type HttpMessage::TYPE_REQUEST.</p>
-<h3 id="HttpMessage_setRequestMethod">bool HttpMessage::setRequestMethod(string method)</h3>
-<p>Set the Request Method of the HTTP Message.</p>
-<p>Expects a string parameter containing the request method name.</p>
-<p>Returns TRUE on success, or FALSE if the message is not of type<br />
-HttpMessage::TYPE_REQUEST or an invalid request method was supplied.</p>
-<h3 id="HttpMessage_getRequestUrl">string HttpMessage::getRequestUrl()</h3>
-<p>Get the Request URL of the Message.</p>
-<p>Returns the request url as string on success, or FALSE if the message<br />
-is not of type HttpMessage::TYPE_REQUEST.</p>
-<h3 id="HttpMessage_setRequestUrl">bool HttpMessage::setRequestUrl(string url)</h3>
-<p>Set the Request URL of the HTTP Message.</p>
-<p>Expects a string parameters containing the request url.</p>
-<p>Returns TRUE on success, or FALSE if the message is not of type<br />
-HttpMessage::TYPE_REQUEST or supplied URL was empty.</p>
-<h3 id="HttpMessage_getHttpVersion">string HttpMessage::getHttpVersion()</h3>
-<p>Get the HTTP Protocol Version of the Message.</p>
-<p>Returns the HTTP protocol version as string.</p>
-<h3 id="HttpMessage_setHttpVersion">bool HttpMessage::setHttpVersion(string version)</h3>
-<p>Set the HTTP Protocol version of the Message.</p>
-<p>Expects a string parameter containing the HTTP protocol version.</p>
-<p>Returns TRUE on success, or FALSE if supplied version is out of range (1.0/1.1).</p>
-<h3 id="HttpMessage_guessContentType">string HttpMessage::guessContentType(string magic_file[, int magic_mode = MAGIC_MIME])</h3>
-<p>Attempts to guess the content type of supplied payload through libmagic.</p>
-<p>Expects a string parameter specifying the magic.mime database to use.<br />
-Additionally accepts an optional int parameter, being flags for libmagic.</p>
-<p>Returns the guessed content type on success, or FALSE on failure.</p>
-<p>Throws HttpRuntimeException, HttpInvalidParamException <br />
-if http.only_exceptions is TRUE.</p>
-<h3 id="HttpMessage_getParentMessage">HttpMessage HttpMessage::getParentMessage()</h3>
-<p>Get parent Message.</p>
-<p>Returns the parent HttpMessage on success, or NULL if there's none.</p>
-<p>Throws HttpRuntimeException.</p>
-<h3 id="HttpMessage_send">bool HttpMessage::send()</h3>
-<p>Send the Message according to its type as Response or Request.<br />
-This provides limited functionality compared to HttpRequest and HttpResponse.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpMessage_toString">string HttpMessage::toString([bool include_parent = false])</h3>
-<p>Get the string representation of the Message.</p>
-<p>Accepts a bool parameter which specifies whether the returned string<br />
-should also contain any parent messages.</p>
-<p>Returns the full message as string.</p>
-<h3 id="HttpMessage_toMessageTypeObject">HttpRequest|HttpResponse HttpMessage::toMessageTypeObject(void)</h3>
-<p>Creates an object regarding to the type of the message.</p>
-<p>Returns either an HttpRequest or HttpResponse object on success, or NULL on failure.</p>
-<p>Throws HttpRuntimeException, HttpMessageTypeException, HttpHeaderException.</p>
-<h3 id="HttpMessage_count">int HttpMessage::count()</h3>
-<p>Implements Countable.</p>
-<p>Returns the number of parent messages + 1.</p>
-<h3 id="HttpMessage_serialize">string HttpMessage::serialize()</h3>
-<p>Implements Serializable.</p>
-<p>Returns the serialized representation of the HttpMessage.</p>
-<h3 id="HttpMessage_unserialize">void HttpMessage::unserialize(string serialized)</h3>
-<p>Implements Serializable.</p>
-<p>Re-constructs the HttpMessage based upon the serialized string.</p>
-<h3 id="HttpMessage_detach">HttpMessage HttpMessage::detach(void)</h3>
-<p>Returns a clone of an HttpMessage object detached from any parent messages.</p>
-<h3 id="HttpMessage_prepend">void HttpMessage::prepend(HttpMessage message[, bool top = true])</h3>
-<p>Prepends message(s) to the HTTP message.</p>
-<p>Expects an HttpMessage object as parameter.</p>
-<p>Throws HttpInvalidParamException if the message is located within the same message chain.</p>
-<h3 id="HttpMessage_reverse">HttpMessage HttpMessage::reverse()</h3>
-<p>Reorders the message chain in reverse order.</p>
-<p>Returns the most parent HttpMessage object.</p>
-<h3 id="HttpMessage_rewind">void HttpMessage::rewind(void)</h3>
-<p>Implements Iterator.</p>
-<h3 id="HttpMessage_valid">bool HttpMessage::valid(void)</h3>
-<p>Implements Iterator.</p>
-<h3 id="HttpMessage_next">void HttpMessage::next(void)</h3>
-<p>Implements Iterator.</p>
-<h3 id="HttpMessage_key">int HttpMessage::key(void)</h3>
-<p>Implements Iterator.</p>
-<h3 id="HttpMessage_current">HttpMessage HttpMessage::current(void)</h3>
-<p>Implements Iterator.</p>
-<hr noshade>
-<h1 id="http_querystring_object.c">http_querystring_object.c</h1>
-<h2 id="HttpQueryString" class="o">HttpQueryString</h2>
-<h3 id="HttpQueryString___construct">final void HttpQueryString::__construct([bool global = true[, mixed add])</h3>
-<p>Creates a new HttpQueryString object instance.<br />
-Operates on and modifies $_GET and $_SERVER['QUERY_STRING'] if global is TRUE.</p>
-<h3 id="HttpQueryString_toString">string HttpQueryString::toString()</h3>
-<p>Returns the string representation.</p>
-<h3 id="HttpQueryString_toArray">array HttpQueryString::toArray()</h3>
-<p>Returns the array representation.</p>
-<h3 id="HttpQueryString_get">mixed HttpQueryString::get([string key[, mixed type = 0[, mixed defval = NULL[, bool delete = false]]]])</h3>
-<p>Get (part of) the query string.</p>
-<p>The type parameter is either one of the HttpQueryString::TYPE_* constants or a type abbreviation like<br />
-"b" for bool, "i" for int, "f" for float, "s" for string, "a" for array and "o" for a stdClass object.</p>
-<h3 id="HttpQueryString_set">string HttpQueryString::set(mixed params)</h3>
-<p>Set query string entry/entries. NULL values will unset the variable.</p>
-<h3 id="HttpQueryString_mod">HttpQueryString HttpQueryString::mod(mixed params)</h3>
-<p>Copies the query string object and sets provided params at the clone.<br />
-This is basically shorthand for:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br />$newQS&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">HttpQueryString</span><span style="color: #007700">(</span><span style="color: #0000BB">false</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$oldQS</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$newQS</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #0000BB">$other_params</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h3 id="HttpQueryString_singleton">static HttpQueryString HttpQueryString::singleton([bool global = true])</h3>
-<p>Get a single instance (differentiates between the global setting).</p>
-<h3 id="HttpQueryString_xlate">bool HttpQueryString::xlate(string ie, string oe)</h3>
-<p>Converts the query string from the source encoding ie to the target encoding oe.<br />
-WARNING: Don't use any character set that can contain NUL bytes like UTF-16.</p>
-<p>Returns TRUE on success or FALSE on failure.</p>
-<h3 id="HttpQueryString_serialize">string HttpQueryString::serialize()</h3>
-<p>Implements Serializable.</p>
-<h3 id="HttpQueryString_unserialize">void HttpQueryString::unserialize(string serialized)</h3>
-<p>Implements Serializable.</p>
-<h3 id="HttpQueryString_offsetGet">mixed HttpQueryString::offsetGet(string offset)</h3>
-<p>Implements ArrayAccess.</p>
-<h3 id="HttpQueryString_offsetSet">void HttpQueryString::offsetSet(string offset, mixed value)</h3>
-<p>Implements ArrayAccess.</p>
-<h3 id="HttpQueryString_offsetExists">bool HttpQueryString::offsetExists(string offset)</h3>
-<p>Implements ArrayAccess.</p>
-<h3 id="HttpQueryString_offsetUnset">void HttpQueryString::offsetUnset(string offset)</h3>
-<p>Implements ArrayAccess.</p>
-<hr noshade>
-<h1 id="http_request_object.c">http_request_object.c</h1>
-<h2 id="HttpRequest" class="o">HttpRequest</h2>
-<h3 id="HttpRequest___construct">void HttpRequest::__construct([string url[, int request_method = HTTP_METH_GET[, array options]]])</h3>
-<p>Instantiate a new HttpRequest object.</p>
-<p>Accepts a string as optional parameter containing the target request url.<br />
-Additionally accepts an optional int parameter specifying the request method<br />
-to use and an associative array as optional third parameter which will be<br />
-passed to HttpRequest::setOptions(). </p>
-<p>Throws HttpException.</p>
-<h3 id="HttpRequest_setOptions">bool HttpRequest::setOptions([array options])</h3>
-<p>Set the request options to use.  See http_get() for a full list of available options.</p>
-<p>Accepts an array as optional parameters, which values will overwrite the <br />
-currently set request options.  If the parameter is empty or omitted,<br />
-the options of the HttpRequest object will be reset.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getOptions">array HttpRequest::getOptions()</h3>
-<p>Get currently set options.</p>
-<p>Returns an associative array containing currently set options.</p>
-<h3 id="HttpRequest_setSslOptions">bool HttpRequest::setSslOptions([array options])</h3>
-<p>Set SSL options.</p>
-<p>Accepts an associative array as parameter containing any SSL specific options.<br />
-If the parameter is empty or omitted, the SSL options will be reset.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_addSslOptions">bool HttpRequest::addSslOptions(array options)</h3>
-<p>Set additional SSL options.</p>
-<p>Expects an associative array as parameter containing additional SSL specific options.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getSslOptions">array HttpRequest::getSslOtpions()</h3>
-<p>Get previously set SSL options.</p>
-<p>Returns an associative array containing any previously set SSL options.</p>
-<h3 id="HttpRequest_addHeaders">bool HttpRequest::addHeaders(array headers)</h3>
-<p>Add request header name/value pairs.</p>
-<p>Expects an associative array as parameter containing additional header<br />
-name/value pairs.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_setHeaders">bool HttpRequest::setHeaders([array headers])</h3>
-<p>Set request header name/value pairs.</p>
-<p>Accepts an associative array as parameter containing header name/value pairs.<br />
-If the parameter is empty or omitted, all previously set headers will be unset.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getHeaders">array HttpRequest::getHeaders()</h3>
-<p>Get previously set request headers.</p>
-<p>Returns an associative array containing all currently set headers.</p>
-<h3 id="HttpRequest_setCookies">bool HttpRequest::setCookies([array cookies])</h3>
-<p>Set cookies.</p>
-<p>Accepts an associative array as parameter containing cookie name/value pairs.<br />
-If the parameter is empty or omitted, all previously set cookies will be unset.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_addCookies">bool HttpRequest::addCookies(array cookies)</h3>
-<p>Add cookies.</p>
-<p>Expects an associative array as parameter containing any cookie name/value<br />
-pairs to add.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getCookies">array HttpRequest::getCookies()</h3>
-<p>Get previously set cookies.</p>
-<p>Returns an associative array containing any previously set cookies.</p>
-<h3 id="HttpRequest_enableCookies">bool HttpRequest::enableCookies()</h3>
-<p>Enable automatic sending of received cookies.<br />
-Note that cuutomly set cookies will be sent anyway.</p>
-<h3 id="HttpRequest_resetCookies">bool HttpRequest::resetCookies([bool session_only = FALSE])</h3>
-<p>Reset all automatically received/sent cookies.<br />
-Note that customly set cookies are not affected.</p>
-<p>Accepts an optional bool parameter specifying<br />
-whether only session cookies should be reset<br />
-(needs libcurl >= v7.15.4, else libcurl >= v7.14.1).</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_setUrl">bool HttpRequest::setUrl(string url)</h3>
-<p>Set the request URL.</p>
-<p>Expects a string as parameter specifying the request url.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getUrl">string HttpRequest::getUrl()</h3>
-<p>Get the previously set request URL.</p>
-<p>Returns the currently set request url as string.</p>
-<h3 id="HttpRequest_setMethod">bool HttpRequest::setMethod(int request_method)</h3>
-<p>Set the request method.</p>
-<p>Expects an int as parameter specifying the request method to use.<br />
-In PHP 5.1+ HttpRequest::METH_*, otherwise the HTTP_METH_* constants can be used.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getMethod">int HttpRequest::getMethod()</h3>
-<p>Get the previously set request method.</p>
-<p>Returns the currently set request method.</p>
-<h3 id="HttpRequest_setContentType">bool HttpRequest::setContentType(string content_type)</h3>
-<p>Set the content type the post request should have.</p>
-<p>Expects a string as parameters containing the content type of the request<br />
-(primary/secondary).</p>
-<p>Returns TRUE on success, or FALSE if the content type does not seem to<br />
-contain a primary and a secondary part.</p>
-<h3 id="HttpRequest_getContentType">string HttpRequest::getContentType()</h3>
-<p>Get the previously content type.</p>
-<p>Returns the previously set content type as string.</p>
-<h3 id="HttpRequest_setQueryData">bool HttpRequest::setQueryData([mixed query_data])</h3>
-<p>Set the URL query parameters to use, overwriting previously set query parameters.<br />
-Affects any request types.</p>
-<p>Accepts a string or associative array parameter containing the pre-encoded <br />
-query string or to be encoded query fields.  If the parameter is empty or<br />
-omitted, the query data will be unset. </p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getQueryData">string HttpRequest::getQueryData()</h3>
-<p>Get the current query data in form of an urlencoded query string.</p>
-<p>Returns a string containing the urlencoded query.</p>
-<h3 id="HttpRequest_addQueryData">bool HttpRequest::addQueryData(array query_params)</h3>
-<p>Add parameters to the query parameter list, leaving previously set unchanged.<br />
-Affects any request type.</p>
-<p>Expects an associative array as parameter containing the query fields to add.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_addPostFields">bool HttpRequest::addPostFields(array post_data)</h3>
-<p>Adds POST data entries, leaving previously set unchanged, unless a<br />
-post entry with the same name already exists. <br />
-Affects only POST and custom requests.</p>
-<p>Expects an associative array as parameter containing the post fields.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_setPostFields">bool HttpRequest::setPostFields([array post_data])</h3>
-<p>Set the POST data entries, overwriting previously set POST data.<br />
-Affects only POST and custom requests.</p>
-<p>Accepts an associative array as parameter containing the post fields.<br />
-If the parameter is empty or omitted, the post data will be unset.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getPostFields">array HttpRequest::getPostFields()</h3>
-<p>Get previously set POST data.</p>
-<p>Returns the currently set post fields as associative array.</p>
-<h3 id="HttpRequest_setRawPostData">bool HttpRequest::setRawPostData([string raw_post_data])</h3>
-<p>Set raw post data to send, overwriting previously set raw post data.  Don't <br />
-forget to specify a content type. Affects only POST and custom requests.<br />
-Only either post fields or raw post data can be used for each request.<br />
-Raw post data has higher precedence and will be used even if post fields<br />
-are set.  </p>
-<p>Accepts a string as parameter containing the *raw* post data.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_addRawPostData">bool HttpRequest::addRawPostData(string raw_post_data)</h3>
-<p>Add raw post data, leaving previously set raw post data unchanged.<br />
-Affects only POST and custom requests.</p>
-<p>Expects a string as parameter containing the raw post data to concatenate.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getRawPostData">string HttpRequest::getRawPostData()</h3>
-<p>Get previously set raw post data.</p>
-<p>Returns a string containing the currently set raw post data.</p>
-<h3 id="HttpRequest_addPostFile">bool HttpRequest::addPostFile(string name, string file[, string content_type = "application/x-octetstream"])</h3>
-<p>Add a file to the POST request, leaving previously set files unchanged.<br />
-Affects only POST and custom requests. Cannot be used with raw post data.</p>
-<p>Expects a string parameter containing the form element name, and a string<br />
-paremeter containing the path to the file which should be uploaded.<br />
-Additionally accepts an optional string parameter which should contain<br />
-the content type of the file.</p>
-<p>Returns TRUE on success, or FALSE if the content type seems not to contain a <br />
-primary and a secondary content type part.</p>
-<h3 id="HttpRequest_setPostFiles">bool HttpRequest::setPostFiles([array post_files])</h3>
-<p>Set files to post, overwriting previously set post files.<br />
-Affects only POST and requests. Cannot be used with raw post data.</p>
-<p>Accepts an array containing the files to post.  Each entry should be an<br />
-associative array with "name", "file" and "type" keys.  If the parameter<br />
-is empty or omitted the post files will be unset.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getPostFiles">array HttpRequest::getPostFiles()</h3>
-<p>Get all previously added POST files.</p>
-<p>Returns an array containing currently set post files.</p>
-<h3 id="HttpRequest_setPutFile">bool HttpRequest::setPutFile([string file])</h3>
-<p>Set file to put. Affects only PUT requests.</p>
-<p>Accepts a string as parameter referencing the path to file.<br />
-If the parameter is empty or omitted the put file will be unset.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getPutFile">string HttpRequest::getPutFile()</h3>
-<p>Get previously set put file.</p>
-<p>Returns a string containing the path to the currently set put file.</p>
-<h3 id="HttpRequest_setPutData">bool HttpRequest::setPutData([string put_data])</h3>
-<p>Set PUT data to send, overwriting previously set PUT data.<br />
-Affects only PUT requests.<br />
-Only either PUT data or PUT file can be used for each request.<br />
-PUT data has higher precedence and will be used even if a PUT<br />
-file is set.  </p>
-<p>Accepts a string as parameter containing the data to upload.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_addPutData">bool HttpRequest::addPutData(string put_data)</h3>
-<p>Add PUT data, leaving previously set PUT data unchanged.<br />
-Affects only PUT requests.</p>
-<p>Expects a string as parameter containing the data to concatenate.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequest_getPutData">string HttpRequest::getPutData()</h3>
-<p>Get previously set PUT data.</p>
-<p>Returns a string containing the currently set raw post data.</p>
-<h3 id="HttpRequest_getResponseData">array HttpRequest::getResponseData()</h3>
-<p>Get all response data after the request has been sent.</p>
-<p>Returns an associative array with the key "headers" containing an associative<br />
-array holding all response headers, as well as the key "body" containing a<br />
-string with the response body.  </p>
-<p>If redirects were allowed and several responses were received, the data <br />
-references the last received response.</p>
-<h3 id="HttpRequest_getResponseHeader">mixed HttpRequest::getResponseHeader([string name])</h3>
-<p>Get response header(s) after the request has been sent.</p>
-<p>Accepts an string as optional parameter specifying a certain header to read.<br />
-If the parameter is empty or omitted all response headers will be returned.</p>
-<p>Returns either a string with the value of the header matching name if requested, <br />
-FALSE on failure, or an associative array containing all response headers.</p>
-<p>If redirects were allowed and several responses were received, the data <br />
-references the last received response.</p>
-<h3 id="HttpRequest_getResponseCookies">array HttpRequest::getResponseCookies([int flags[, array allowed_extras]])</h3>
-<p>Get response cookie(s) after the request has been sent.</p>
-<p>Returns an array of stdClass objects like http_parse_cookie would return.</p>
-<p>If redirects were allowed and several responses were received, the data <br />
-references the last received response.</p>
-<h3 id="HttpRequest_getResponseBody">string HttpRequest::getResponseBody()</h3>
-<p>Get the response body after the request has been sent.</p>
-<p>Returns a string containing the response body.</p>
-<p>If redirects were allowed and several responses were received, the data <br />
-references the last received response.</p>
-<h3 id="HttpRequest_getResponseCode">int HttpRequest::getResponseCode()</h3>
-<p>Get the response code after the request has been sent.</p>
-<p>Returns an int representing the response code.</p>
-<p>If redirects were allowed and several responses were received, the data <br />
-references the last received response.</p>
-<h3 id="HttpRequest_getResponseStatus">string HttpRequest::getResponseStatus()</h3>
-<p>Get the response status (i.e. the string after the response code) after the message has been sent.</p>
-<p>Returns a string containing the response status text.</p>
-<h3 id="HttpRequest_getResponseInfo">mixed HttpRequest::getResponseInfo([string name])</h3>
-<p>Get response info after the request has been sent.<br />
-See http_get() for a full list of returned info.</p>
-<p>Accepts a string as optional parameter specifying the info to read.<br />
-If the parameter is empty or omitted, an associative array containing<br />
-all available info will be returned.</p>
-<p>Returns either a scalar containing the value of the info matching name if<br />
-requested, FALSE on failure, or an associative array containing all<br />
-available info.</p>
-<p>If redirects were allowed and several responses were received, the data <br />
-references the last received response.</p>
-<h3 id="HttpRequest_getResponseMessage">HttpMessage HttpRequest::getResponseMessage()</h3>
-<p>Get the full response as HttpMessage object after the request has been sent.</p>
-<p>Returns an HttpMessage object of the response.</p>
-<p>If redirects were allowed and several responses were received, the data <br />
-references the last received response.  Use HttpMessage::getParentMessage()<br />
-to access the data of previously received responses within this request<br />
-cycle.</p>
-<p>Throws HttpException, HttpRuntimeException.</p>
-<h3 id="HttpRequest_getRequestMessage">HttpMessage HttpRequest::getRequestMessage()</h3>
-<p>Get sent HTTP message.</p>
-<p>Returns an HttpMessage object representing the sent request.</p>
-<p>If redirects were allowed and several responses were received, the data <br />
-references the last received response.  Use HttpMessage::getParentMessage()<br />
-to access the data of previously sent requests within this request<br />
-cycle.</p>
-<p>Note that the internal request message is immutable, that means that the<br />
-request message received through HttpRequest::getRequestMessage() will<br />
-always look the same for the same request, regardless of any changes you<br />
-may have made to the returned object.</p>
-<p>Throws HttpMalformedHeadersException, HttpEncodingException.</p>
-<h3 id="HttpRequest_getRawRequestMessage">string HttpRequest::getRawRequestMessage()</h3>
-<p>Get sent HTTP message.</p>
-<p>Returns an HttpMessage in a form of a string</p>
-<h3 id="HttpRequest_getRawResponseMessage">string HttpRequest::getRawResponseMessage()</h3>
-<p>Get the entire HTTP response.</p>
-<p>Returns the complete web server response, including the headers in a form of a string.</p>
-<h3 id="HttpRequest_getHistory">HttpMessage HttpRequest::getHistory()</h3>
-<p>Get all sent requests and received responses as an HttpMessage object.</p>
-<p>If you want to record history, set the instance variable<br />
-HttpRequest::$recordHistory to TRUE.</p>
-<p>Returns an HttpMessage object representing the complete request/response<br />
-history.</p>
-<p>The object references the last received response, use HttpMessage::getParentMessage() <br />
-to access the data of previously sent requests and received responses.</p>
-<p>Throws HttpRuntimeException.</p>
-<h3 id="HttpRequest_clearHistory">void HttpRequest::clearHistory()</h3>
-<p>Clear the history.</p>
-<h3 id="HttpRequest_send">HttpMessage HttpRequest::send()</h3>
-<p>Send the HTTP request.</p>
-<p>Returns the received response as HttpMessage object.</p>
-<p>NOTE: While an exception may be thrown, the transfer could have succeeded <br />
-at least partially, so you might want to check the return values of various<br />
-HttpRequest::getResponse*() methods.</p>
-<p>Throws HttpRuntimeException, HttpRequestException, <br />
-HttpMalformedHeaderException, HttpEncodingException.</p>
-<p>GET example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br />$r&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</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">,&nbsp;</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">-&gt;</span><span style="color: #0000BB">setOptions</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'lastmodified'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</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">-&gt;</span><span style="color: #0000BB">addQueryData</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'category'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">));<br />try&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$r</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">send</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$r</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getResponseCode</span><span style="color: #007700">()&nbsp;==&nbsp;</span><span style="color: #0000BB">200</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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">,&nbsp;</span><span style="color: #0000BB">$r</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getResponseBody</span><span style="color: #007700">());<br />&nbsp;&nbsp;&nbsp;}<br />}&nbsp;catch&nbsp;(</span><span style="color: #0000BB">HttpException&nbsp;$ex</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$ex</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<p>POST example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br />$r&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</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">,&nbsp;</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">-&gt;</span><span style="color: #0000BB">setOptions</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'cookies'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;array(</span><span style="color: #DD0000">'lang'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'de'</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPostFields</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'user'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'mike'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'pass'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'s3c|r3t'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$r</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addPostFile</span><span style="color: #007700">(</span><span style="color: #DD0000">'image'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'profile.jpg'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'image/jpeg'</span><span style="color: #007700">);<br />try&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$r</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">send</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getBody</span><span style="color: #007700">();<br />}&nbsp;catch&nbsp;(</span><span style="color: #0000BB">HttpException&nbsp;$ex</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$ex</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<hr noshade>
-<h1 id="http_requestpool_object.c">http_requestpool_object.c</h1>
-<h2 id="HttpRequestPool" class="o">HttpRequestPool</h2>
-<h3 id="HttpRequestPool___construct">void HttpRequestPool::__construct([HttpRequest request[, ...]])</h3>
-<p>Instantiate a new HttpRequestPool object.  An HttpRequestPool is<br />
-able to send several HttpRequests in parallel.</p>
-<p>WARNING: Don't attach/detach HttpRequest objects to the HttpRequestPool<br />
-object while you're using the implemented Iterator interface. </p>
-<p>Accepts virtual infinite optional parameters each referencing an<br />
-HttpRequest object.</p>
-<p>Throws HttpRequestPoolException (HttpRequestException, HttpInvalidParamException).</p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">try&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pool&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">HttpRequestPool</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;</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">,&nbsp;</span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">::</span><span style="color: #0000BB">METH_HEAD</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;</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">,&nbsp;</span><span style="color: #0000BB">HttpRequest</span><span style="color: #007700">::</span><span style="color: #0000BB">METH_HEAD</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pool</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">send</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$pool&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$request</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"%s&nbsp;is&nbsp;%s&nbsp;(%d)\n"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getUrl</span><span style="color: #007700">(),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getResponseCode</span><span style="color: #007700">()&nbsp;?&nbsp;</span><span style="color: #DD0000">'alive'&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #DD0000">'not&nbsp;alive'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$request</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getResponseCode</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}&nbsp;catch&nbsp;(</span><span style="color: #0000BB">HttpException&nbsp;$e</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$e</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h3 id="HttpRequestPool___destruct">void HttpRequestPool::__destruct()</h3>
-<p>Clean up HttpRequestPool object.</p>
-<h3 id="HttpRequestPool_reset">void HttpRequestPool::reset()</h3>
-<p>Detach all attached HttpRequest objects.</p>
-<h3 id="HttpRequestPool_attach">bool HttpRequestPool::attach(HttpRequest request)</h3>
-<p>Attach an HttpRequest object to this HttpRequestPool.<br />
-WARNING: set all options prior attaching!</p>
-<p>Expects the parameter to be an HttpRequest object not already attached to<br />
-antother HttpRequestPool object.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<p>Throws HttpInvalidParamException, HttpRequestException, <br />
-HttpRequestPoolException, HttpEncodingException.</p>
-<h3 id="HttpRequestPool_detach">bool HttpRequestPool::detach(HttpRequest request)</h3>
-<p>Detach an HttpRequest object from this HttpRequestPool.</p>
-<p>Expects the parameter to be an HttpRequest object attached to this<br />
-HttpRequestPool object.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<p>Throws HttpInvalidParamException, HttpRequestPoolException.</p>
-<h3 id="HttpRequestPool_send">bool HttpRequestPool::send()</h3>
-<p>Send all attached HttpRequest objects in parallel.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<p>Throws HttpRequestPoolException (HttpSocketException, HttpRequestException, HttpMalformedHeaderException).</p>
-<h3 id="HttpRequestPool_socketPerform">protected bool HttpRequestPool::socketPerform()</h3>
-<p>Returns TRUE until each request has finished its transaction.</p>
-<p>Usage:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class&nbsp;</span><span style="color: #0000BB">MyPool&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">HttpRequestPool<br /></span><span style="color: #007700">{<br />&nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">send</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socketPerform</span><span style="color: #007700">())&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">socketSelect</span><span style="color: #007700">())&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span style="color: #0000BB">HttpSocketExcpetion</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;protected&nbsp;final&nbsp;function&nbsp;</span><span style="color: #0000BB">socketPerform</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">parent</span><span style="color: #007700">::</span><span style="color: #0000BB">socketPerform</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach&nbsp;(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getFinishedRequests</span><span style="color: #007700">()&nbsp;as&nbsp;</span><span style="color: #0000BB">$r</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">detach</span><span style="color: #007700">(</span><span style="color: #0000BB">$r</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;handle&nbsp;response&nbsp;of&nbsp;finished&nbsp;request<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$result</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}&nbsp;<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h3 id="HttpRequestPool_socketSelect">protected bool HttpRequestPool::socketSelect()</h3>
-<p>See HttpRequestPool::socketPerform().</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpRequestPool_valid">bool HttpRequestPool::valid()</h3>
-<p>Implements Iterator::valid().</p>
-<h3 id="HttpRequestPool_current">HttpRequest HttpRequestPool::current()</h3>
-<p>Implements Iterator::current().</p>
-<h3 id="HttpRequestPool_key">int HttpRequestPool::key()</h3>
-<p>Implements Iterator::key().</p>
-<h3 id="HttpRequestPool_next">void HttpRequestPool::next()</h3>
-<p>Implements Iterator::next().</p>
-<h3 id="HttpRequestPool_rewind">void HttpRequestPool::rewind()</h3>
-<p>Implements Iterator::rewind().</p>
-<h3 id="HttpRequestPool_count">int HttpRequestPool::count()</h3>
-<p>Implements Countable.</p>
-<p>Returns the number of attached HttpRequest objects.</p>
-<h3 id="HttpRequestPool_getAttachedRequests">array HttpRequestPool::getAttachedRequests()</h3>
-<p>Get attached HttpRequest objects.</p>
-<p>Returns an array containing all currently attached HttpRequest objects.</p>
-<h3 id="HttpRequestPool_getFinishedRequests">array HttpRequestPool::getFinishedRequests()</h3>
-<p>Get attached HttpRequest objects that already have finished their work.</p>
-<p>Returns an array containing all attached HttpRequest objects that<br />
-already have finished their work.</p>
-<hr noshade>
-<h1 id="http_response_object.c">http_response_object.c</h1>
-<h2 id="HttpResponse" class="o">HttpResponse</h2>
-<h3 id="HttpResponse_setHeader">static bool HttpResponse::setHeader(string name, mixed value[, bool replace = true])</h3>
-<p>Send an HTTP header.</p>
-<p>Expects a string parameter containing the name of the header and a mixed<br />
-parameter containing the value of the header, which will be converted to<br />
-a string.  Additionally accepts an optional boolean parameter, which<br />
-specifies whether an existing header should be replaced.  If the second<br />
-parameter is unset no header with this name will be sent. </p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<p>Throws HttpHeaderException if http.only_exceptions is TRUE.</p>
-<h3 id="HttpResponse_getHeader">static mixed HttpResponse::getHeader([string name])</h3>
-<p>Get header(s) about to be sent.</p>
-<p>Accepts a string as optional parameter which specifies the name of the<br />
-header to read.  If the parameter is empty or omitted, an associative array<br />
-with all headers will be returned.</p>
-<p>NOTE: In Apache2 this only works for PHP-5.1.3 and greater.</p>
-<p>Returns either a string containing the value of the header matching name,<br />
-FALSE on failure, or an associative array with all headers.</p>
-<h3 id="HttpResponse_setCache">static bool HttpResponse::setCache(bool cache)</h3>
-<p>Whether it should be attempted to cache the entity.<br />
-This will result in necessary caching headers and checks of clients<br />
-"If-Modified-Since" and "If-None-Match" headers.  If one of those headers<br />
-matches a "304 Not Modified" status code will be issued.</p>
-<p>NOTE: If you're using sessions, be sure that you set session.cache_limiter<br />
-to something more appropriate than "no-cache"!</p>
-<p>Expects a boolean as parameter specifying whether caching should be attempted.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpResponse_getCache">static bool HttpResponse::getCache()</h3>
-<p>Get current caching setting.</p>
-<p>Returns TRUE if caching should be attempted, else FALSE.</p>
-<h3 id="HttpResponse_setGzip">static bool HttpResponse::setGzip(bool gzip)</h3>
-<p>Enable on-thy-fly gzipping of the sent entity.</p>
-<p>Expects a boolean as parameter indicating if GZip compression should be enabled.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpResponse_getGzip">static bool HttpResponse::getGzip()</h3>
-<p>Get current gzipping setting.</p>
-<p>Returns TRUE if GZip compression is enabled, else FALSE.</p>
-<h3 id="HttpResponse_setCacheControl">static bool HttpResponse::setCacheControl(string control[, int max_age = 0[, bool must_revalidate = true]])</h3>
-<p>Set a custom cache-control header, usually being "private" or "public";<br />
-The max_age parameter controls how long the cache entry is valid on the client side.</p>
-<p>Expects a string parameter containing the primary cache control setting.<br />
-Additionally accepts an int parameter specifying the max-age setting.<br />
-Accepts an optional third bool parameter indicating whether the cache<br />
-must be revalidated every request.</p>
-<p>Returns TRUE on success, or FALSE if control does not match one of<br />
-"public" , "private" or "no-cache".</p>
-<p>Throws HttpInvalidParamException if http.only_exceptions is TRUE.</p>
-<h3 id="HttpResponse_getCacheControl">static string HttpResponse::getCacheControl()</h3>
-<p>Get current Cache-Control header setting.</p>
-<p>Returns the current cache control setting as a string like sent in a header.</p>
-<h3 id="HttpResponse_setContentType">static bool HttpResponse::setContentType(string content_type)</h3>
-<p>Set the content-type of the sent entity.</p>
-<p>Expects a string as parameter specifying the content type of the sent entity.</p>
-<p>Returns TRUE on success, or FALSE if the content type does not seem to<br />
-contain a primary and secondary content type part.</p>
-<p>Throws HttpInvalidParamException if http.only_exceptions is TRUE.</p>
-<h3 id="HttpResponse_getContentType">static string HttpResponse::getContentType()</h3>
-<p>Get current Content-Type header setting.</p>
-<p>Returns the currently set content type as string.</p>
-<h3 id="HttpResponse_guessContentType">static string HttpResponse::guessContentType(string magic_file[, int magic_mode = MAGIC_MIME])</h3>
-<p>Attempts to guess the content type of supplied payload through libmagic.<br />
-If the attempt is successful, the guessed content type will automatically<br />
-be set as response content type.  </p>
-<p>Expects a string parameter specifying the magic.mime database to use.<br />
-Additionally accepts an optional int parameter, being flags for libmagic.</p>
-<p>Returns the guessed content type on success, or FALSE on failure.</p>
-<p>Throws HttpRuntimeException, HttpInvalidParamException <br />
-if http.only_exceptions is TRUE.</p>
-<h3 id="HttpResponse_setContentDisposition">static bool HttpResponse::setContentDisposition(string filename[, bool inline = false])</h3>
-<p>Set the Content-Disposition.  The Content-Disposition header is very useful<br />
-if the data actually sent came from a file or something similar, that should<br />
-be "saved" by the client/user (i.e. by browsers "Save as..." popup window).</p>
-<p>Expects a string parameter specifying the file name the "Save as..." dialog<br />
-should display.  Optionally accepts a bool parameter, which, if set to true<br />
-and the user agent knows how to handle the content type, will probably not<br />
-cause the popup window to be shown.</p>
-<p>Returns TRUE on success or FALSE on failure.</p>
-<h3 id="HttpResponse_getContentDisposition">static string HttpResponse::getContentDisposition()</h3>
-<p>Get current Content-Disposition setting.</p>
-<p>Returns the current content disposition as string like sent in a header.</p>
-<h3 id="HttpResponse_setETag">static bool HttpResponse::setETag(string etag)</h3>
-<p>Set a custom ETag.  Use this only if you know what you're doing.</p>
-<p>Expects an unquoted string as parameter containing the ETag.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpResponse_getETag">static string HttpResponse::getETag()</h3>
-<p>Get calculated or previously set custom ETag.</p>
-<p>Returns the calculated or previously set ETag as unquoted string.</p>
-<h3 id="HttpResponse_setLastModified">static bool HttpResponse::setLastModified(int timestamp)</h3>
-<p>Set a custom Last-Modified date.</p>
-<p>Expects an unix timestamp as parameter representing the last modification<br />
-time of the sent entity.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpResponse_getLastModified">static int HttpResponse::getLastModified()</h3>
-<p>Get calculated or previously set custom Last-Modified date.</p>
-<p>Returns the calculated or previously set unix timestamp.</p>
-<h3 id="HttpResponse_setThrottleDelay">static bool HttpResponse::setThrottleDelay(double seconds)</h3>
-<p>Sets the throttle delay for use with HttpResponse::setBufferSize().</p>
-<p>Provides a basic throttling mechanism, which will yield the current process<br />
-resp. thread until the entity has been completely sent, though.</p>
-<p>Note: This doesn't really work with the FastCGI SAPI.</p>
-<p>Expects a double parameter specifying the seconds too sleep() after<br />
-each chunk sent.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpResponse_getThrottleDelay">static double HttpResponse::getThrottleDelay()</h3>
-<p>Get the current throttle delay.</p>
-<p>Returns a double representing the throttle delay in seconds.</p>
-<h3 id="HttpResponse_setBufferSize">static bool HttpResponse::setBufferSize(int bytes)</h3>
-<p>Sets the send buffer size for use with HttpResponse::setThrottleDelay().</p>
-<p>Provides a basic throttling mechanism, which will yield the current process<br />
-resp. thread until the entity has been completely sent, though.</p>
-<p>Note: This doesn't really work with the FastCGI SAPI.</p>
-<p>Expects an int parameter representing the chunk size in bytes.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpResponse_getBufferSize">static int HttpResponse::getBufferSize()</h3>
-<p>Get current buffer size.</p>
-<p>Returns an int representing the current buffer size in bytes.</p>
-<h3 id="HttpResponse_setData">static bool HttpResponse::setData(mixed data)</h3>
-<p>Set the data to be sent.</p>
-<p>Expects one parameter, which will be converted to a string and contains <br />
-the data to send.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpResponse_getData">static string HttpResponse::getData()</h3>
-<p>Get the previously set data to be sent.</p>
-<p>Returns a string containing the previously set data to send.</p>
-<h3 id="HttpResponse_setStream">static bool HttpResponse::setStream(resource stream)</h3>
-<p>Set the resource to be sent.</p>
-<p>Expects a resource parameter referencing an already opened stream from<br />
-which the data to send will be read.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpResponse_getStream">static resource HttpResponse::getStream()</h3>
-<p>Get the previously set resource to be sent.</p>
-<p>Returns the previously set resource.</p>
-<h3 id="HttpResponse_setFile">static bool HttpResponse::setFile(string file)</h3>
-<p>Set the file to be sent.</p>
-<p>Expects a string as parameter, specifying the path to the file to send.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<h3 id="HttpResponse_getFile">static string HttpResponse::getFile()</h3>
-<p>Get the previously set file to be sent.</p>
-<p>Returns the previously set path to the file to send as string.</p>
-<h3 id="HttpResponse_send">static bool HttpResponse::send([bool clean_ob = true])</h3>
-<p>Finally send the entity.</p>
-<p>Accepts an optional boolean parameter, specifying whether the output<br />
-buffers should be discarded prior sending.  A successful caching attempt<br />
-will cause a script termination, and write a log entry if the INI setting<br />
-http.cache_log is set.</p>
-<p>Returns TRUE on success, or FALSE on failure.</p>
-<p>Throws HttpHeaderException, HttpResponseException if http.only_exceptions is TRUE.</p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?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">,&nbsp;</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">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<h3 id="HttpResponse_capture">static void HttpResponse::capture()</h3>
-<p>Capture script output.</p>
-<p>Example:</p><pre><blockquote><code><span style="color: #000000"><br />
-<span style="color: #0000BB">&lt;?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">//&nbsp;script&nbsp;follows<br /></span><span style="color: #0000BB">?&gt;</span><br />
-</span></code></blockquote></p>
-<p></pre></p>
-<hr noshade>
-<div class="toc"><strong>Table of Contents</strong>
-<ul>
-<li><a class="tocfile" href="#http_functions.c">http_functions.c</a>
-<ul>
-<li><a href="#http_date">http_date</a>
-</li>
-<li><a href="#http_build_url">http_build_url</a>
-</li>
-<li><a href="#http_build_str">http_build_str</a>
-</li>
-<li><a href="#http_negotiate_language">http_negotiate_language</a>
-</li>
-<li><a href="#http_negotiate_charset">http_negotiate_charset</a>
-</li>
-<li><a href="#http_negotiate_content_type">http_negotiate_content_type</a>
-</li>
-<li><a href="#http_send_status">http_send_status</a>
-</li>
-<li><a href="#http_send_last_modified">http_send_last_modified</a>
-</li>
-<li><a href="#http_send_content_type">http_send_content_type</a>
-</li>
-<li><a href="#http_send_content_disposition">http_send_content_disposition</a>
-</li>
-<li><a href="#http_match_modified">http_match_modified</a>
-</li>
-<li><a href="#http_match_etag">http_match_etag</a>
-</li>
-<li><a href="#http_cache_last_modified">http_cache_last_modified</a>
-</li>
-<li><a href="#http_cache_etag">http_cache_etag</a>
-</li>
-<li><a href="#ob_etaghandler">ob_etaghandler</a>
-</li>
-<li><a href="#http_throttle">http_throttle</a>
-</li>
-<li><a href="#http_redirect">http_redirect</a>
-</li>
-<li><a href="#http_send_data">http_send_data</a>
-</li>
-<li><a href="#http_send_file">http_send_file</a>
-</li>
-<li><a href="#http_send_stream">http_send_stream</a>
-</li>
-<li><a href="#http_chunked_decode">http_chunked_decode</a>
-</li>
-<li><a href="#http_parse_message">http_parse_message</a>
-</li>
-<li><a href="#http_parse_headers">http_parse_headers</a>
-</li>
-<li><a href="#http_parse_cookie">http_parse_cookie</a>
-</li>
-<li><a href="#http_parse_params">http_parse_params</a>
-</li>
-<li><a href="#http_get_request_headers">http_get_request_headers</a>
-</li>
-<li><a href="#http_get_request_body">http_get_request_body</a>
-</li>
-<li><a href="#http_get_request_body_stream">http_get_request_body_stream</a>
-</li>
-<li><a href="#http_match_request_header">http_match_request_header</a>
-</li>
-<li><a href="#http_get">http_get</a>
-</li>
-<li><a href="#http_head">http_head</a>
-</li>
-<li><a href="#http_post_data">http_post_data</a>
-</li>
-<li><a href="#http_post_fields">http_post_fields</a>
-</li>
-<li><a href="#http_put_file">http_put_file</a>
-</li>
-<li><a href="#http_put_stream">http_put_stream</a>
-</li>
-<li><a href="#http_put_data">http_put_data</a>
-</li>
-<li><a href="#http_request">http_request</a>
-</li>
-<li><a href="#http_request_body_encode">http_request_body_encode</a>
-</li>
-<li><a href="#http_request_method_register">http_request_method_register</a>
-</li>
-<li><a href="#http_request_method_unregister">http_request_method_unregister</a>
-</li>
-<li><a href="#http_request_method_exists">http_request_method_exists</a>
-</li>
-<li><a href="#http_request_method_name">http_request_method_name</a>
-</li>
-<li><a href="#http_deflate">http_deflate</a>
-</li>
-<li><a href="#http_inflate">http_inflate</a>
-</li>
-<li><a href="#ob_deflatehandler">ob_deflatehandler</a>
-</li>
-<li><a href="#ob_inflatehandler">ob_inflatehandler</a>
-</li>
-<li><a href="#http_support">http_support</a>
-</li>
-</ul>
-</li>
-<li><a class="tocfile" href="#http_deflatestream_object.c">http_deflatestream_object.c</a>
-<ul>
-<li><a href="#HttpDeflateStream___construct">HttpDeflateStream::__construct()</a></li>
-<li><a href="#HttpDeflateStream_update">HttpDeflateStream::update()</a></li>
-<li><a href="#HttpDeflateStream_flush">HttpDeflateStream::flush()</a></li>
-<li><a href="#HttpDeflateStream_finish">HttpDeflateStream::finish()</a></li>
-</li>
-</ul>
-</li>
-<li><a class="tocfile" href="#http_inflatestream_object.c">http_inflatestream_object.c</a>
-<ul>
-<li><a href="#HttpInflateStream___construct">HttpInflateStream::__construct()</a></li>
-<li><a href="#HttpInflateStream_update">HttpInflateStream::update()</a></li>
-<li><a href="#HttpInflateStream_flush">HttpInflateStream::flush()</a></li>
-<li><a href="#HttpInflateStream_finish">HttpInflateStream::finish()</a></li>
-</li>
-</ul>
-</li>
-<li><a class="tocfile" href="#http_message_object.c">http_message_object.c</a>
-<ul>
-<li><a href="#HttpMessage___construct">HttpMessage::__construct()</a></li>
-<li><a href="#HttpMessage_fromString">HttpMessage::fromString()</a></li>
-<li><a href="#HttpMessage_getBody">HttpMessage::getBody()</a></li>
-<li><a href="#HttpMessage_setBody">HttpMessage::setBody()</a></li>
-<li><a href="#HttpMessage_getHeader">HttpMessage::getHeader()</a></li>
-<li><a href="#HttpMessage_getHeaders">HttpMessage::getHeaders()</a></li>
-<li><a href="#HttpMessage_setHeaders">HttpMessage::setHeaders()</a></li>
-<li><a href="#HttpMessage_addHeaders">HttpMessage::addHeaders()</a></li>
-<li><a href="#HttpMessage_getType">HttpMessage::getType()</a></li>
-<li><a href="#HttpMessage_setType">HttpMessage::setType()</a></li>
-<li><a href="#HttpMessage_getResponseCode">HttpMessage::getResponseCode()</a></li>
-<li><a href="#HttpMessage_setResponseCode">HttpMessage::setResponseCode()</a></li>
-<li><a href="#HttpMessage_getResponseStatus">HttpMessage::getResponseStatus()</a></li>
-<li><a href="#HttpMessage_setResponseStatus">HttpMessage::setResponseStatus()</a></li>
-<li><a href="#HttpMessage_getRequestMethod">HttpMessage::getRequestMethod()</a></li>
-<li><a href="#HttpMessage_setRequestMethod">HttpMessage::setRequestMethod()</a></li>
-<li><a href="#HttpMessage_getRequestUrl">HttpMessage::getRequestUrl()</a></li>
-<li><a href="#HttpMessage_setRequestUrl">HttpMessage::setRequestUrl()</a></li>
-<li><a href="#HttpMessage_getHttpVersion">HttpMessage::getHttpVersion()</a></li>
-<li><a href="#HttpMessage_setHttpVersion">HttpMessage::setHttpVersion()</a></li>
-<li><a href="#HttpMessage_guessContentType">HttpMessage::guessContentType()</a></li>
-<li><a href="#HttpMessage_getParentMessage">HttpMessage::getParentMessage()</a></li>
-<li><a href="#HttpMessage_send">HttpMessage::send()</a></li>
-<li><a href="#HttpMessage_toString">HttpMessage::toString()</a></li>
-<li><a href="#HttpMessage_toMessageTypeObject">HttpMessage::toMessageTypeObject()</a></li>
-<li><a href="#HttpMessage_count">HttpMessage::count()</a></li>
-<li><a href="#HttpMessage_serialize">HttpMessage::serialize()</a></li>
-<li><a href="#HttpMessage_unserialize">HttpMessage::unserialize()</a></li>
-<li><a href="#HttpMessage_detach">HttpMessage::detach()</a></li>
-<li><a href="#HttpMessage_prepend">HttpMessage::prepend()</a></li>
-<li><a href="#HttpMessage_reverse">HttpMessage::reverse()</a></li>
-<li><a href="#HttpMessage_rewind">HttpMessage::rewind()</a></li>
-<li><a href="#HttpMessage_valid">HttpMessage::valid()</a></li>
-<li><a href="#HttpMessage_next">HttpMessage::next()</a></li>
-<li><a href="#HttpMessage_key">HttpMessage::key()</a></li>
-<li><a href="#HttpMessage_current">HttpMessage::current()</a></li>
-</li>
-</ul>
-</li>
-<li><a class="tocfile" href="#http_querystring_object.c">http_querystring_object.c</a>
-<ul>
-<li><a href="#HttpQueryString___construct">HttpQueryString::__construct()</a></li>
-<li><a href="#HttpQueryString_toString">HttpQueryString::toString()</a></li>
-<li><a href="#HttpQueryString_toArray">HttpQueryString::toArray()</a></li>
-<li><a href="#HttpQueryString_get">HttpQueryString::get()</a></li>
-<li><a href="#HttpQueryString_set">HttpQueryString::set()</a></li>
-<li><a href="#HttpQueryString_mod">HttpQueryString::mod()</a></li>
-<li><a href="#HttpQueryString_singleton">HttpQueryString::singleton()</a></li>
-<li><a href="#HttpQueryString_xlate">HttpQueryString::xlate()</a></li>
-<li><a href="#HttpQueryString_serialize">HttpQueryString::serialize()</a></li>
-<li><a href="#HttpQueryString_unserialize">HttpQueryString::unserialize()</a></li>
-<li><a href="#HttpQueryString_offsetGet">HttpQueryString::offsetGet()</a></li>
-<li><a href="#HttpQueryString_offsetSet">HttpQueryString::offsetSet()</a></li>
-<li><a href="#HttpQueryString_offsetExists">HttpQueryString::offsetExists()</a></li>
-<li><a href="#HttpQueryString_offsetUnset">HttpQueryString::offsetUnset()</a></li>
-</li>
-</ul>
-</li>
-<li><a class="tocfile" href="#http_request_object.c">http_request_object.c</a>
-<ul>
-<li><a href="#HttpRequest___construct">HttpRequest::__construct()</a></li>
-<li><a href="#HttpRequest_setOptions">HttpRequest::setOptions()</a></li>
-<li><a href="#HttpRequest_getOptions">HttpRequest::getOptions()</a></li>
-<li><a href="#HttpRequest_setSslOptions">HttpRequest::setSslOptions()</a></li>
-<li><a href="#HttpRequest_addSslOptions">HttpRequest::addSslOptions()</a></li>
-<li><a href="#HttpRequest_getSslOptions">HttpRequest::getSslOptions()</a></li>
-<li><a href="#HttpRequest_addHeaders">HttpRequest::addHeaders()</a></li>
-<li><a href="#HttpRequest_setHeaders">HttpRequest::setHeaders()</a></li>
-<li><a href="#HttpRequest_getHeaders">HttpRequest::getHeaders()</a></li>
-<li><a href="#HttpRequest_setCookies">HttpRequest::setCookies()</a></li>
-<li><a href="#HttpRequest_addCookies">HttpRequest::addCookies()</a></li>
-<li><a href="#HttpRequest_getCookies">HttpRequest::getCookies()</a></li>
-<li><a href="#HttpRequest_enableCookies">HttpRequest::enableCookies()</a></li>
-<li><a href="#HttpRequest_resetCookies">HttpRequest::resetCookies()</a></li>
-<li><a href="#HttpRequest_setUrl">HttpRequest::setUrl()</a></li>
-<li><a href="#HttpRequest_getUrl">HttpRequest::getUrl()</a></li>
-<li><a href="#HttpRequest_setMethod">HttpRequest::setMethod()</a></li>
-<li><a href="#HttpRequest_getMethod">HttpRequest::getMethod()</a></li>
-<li><a href="#HttpRequest_setContentType">HttpRequest::setContentType()</a></li>
-<li><a href="#HttpRequest_getContentType">HttpRequest::getContentType()</a></li>
-<li><a href="#HttpRequest_setQueryData">HttpRequest::setQueryData()</a></li>
-<li><a href="#HttpRequest_getQueryData">HttpRequest::getQueryData()</a></li>
-<li><a href="#HttpRequest_addQueryData">HttpRequest::addQueryData()</a></li>
-<li><a href="#HttpRequest_addPostFields">HttpRequest::addPostFields()</a></li>
-<li><a href="#HttpRequest_setPostFields">HttpRequest::setPostFields()</a></li>
-<li><a href="#HttpRequest_getPostFields">HttpRequest::getPostFields()</a></li>
-<li><a href="#HttpRequest_setRawPostData">HttpRequest::setRawPostData()</a></li>
-<li><a href="#HttpRequest_addRawPostData">HttpRequest::addRawPostData()</a></li>
-<li><a href="#HttpRequest_getRawPostData">HttpRequest::getRawPostData()</a></li>
-<li><a href="#HttpRequest_addPostFile">HttpRequest::addPostFile()</a></li>
-<li><a href="#HttpRequest_setPostFiles">HttpRequest::setPostFiles()</a></li>
-<li><a href="#HttpRequest_getPostFiles">HttpRequest::getPostFiles()</a></li>
-<li><a href="#HttpRequest_setPutFile">HttpRequest::setPutFile()</a></li>
-<li><a href="#HttpRequest_getPutFile">HttpRequest::getPutFile()</a></li>
-<li><a href="#HttpRequest_setPutData">HttpRequest::setPutData()</a></li>
-<li><a href="#HttpRequest_addPutData">HttpRequest::addPutData()</a></li>
-<li><a href="#HttpRequest_getPutData">HttpRequest::getPutData()</a></li>
-<li><a href="#HttpRequest_getResponseData">HttpRequest::getResponseData()</a></li>
-<li><a href="#HttpRequest_getResponseHeader">HttpRequest::getResponseHeader()</a></li>
-<li><a href="#HttpRequest_getResponseCookies">HttpRequest::getResponseCookies()</a></li>
-<li><a href="#HttpRequest_getResponseBody">HttpRequest::getResponseBody()</a></li>
-<li><a href="#HttpRequest_getResponseCode">HttpRequest::getResponseCode()</a></li>
-<li><a href="#HttpRequest_getResponseStatus">HttpRequest::getResponseStatus()</a></li>
-<li><a href="#HttpRequest_getResponseInfo">HttpRequest::getResponseInfo()</a></li>
-<li><a href="#HttpRequest_getResponseMessage">HttpRequest::getResponseMessage()</a></li>
-<li><a href="#HttpRequest_getRequestMessage">HttpRequest::getRequestMessage()</a></li>
-<li><a href="#HttpRequest_getRawRequestMessage">HttpRequest::getRawRequestMessage()</a></li>
-<li><a href="#HttpRequest_getRawResponseMessage">HttpRequest::getRawResponseMessage()</a></li>
-<li><a href="#HttpRequest_getHistory">HttpRequest::getHistory()</a></li>
-<li><a href="#HttpRequest_clearHistory">HttpRequest::clearHistory()</a></li>
-<li><a href="#HttpRequest_send">HttpRequest::send()</a></li>
-</li>
-</ul>
-</li>
-<li><a class="tocfile" href="#http_requestpool_object.c">http_requestpool_object.c</a>
-<ul>
-<li><a href="#HttpRequestPool___construct">HttpRequestPool::__construct()</a></li>
-<li><a href="#HttpRequestPool___destruct">HttpRequestPool::__destruct()</a></li>
-<li><a href="#HttpRequestPool_reset">HttpRequestPool::reset()</a></li>
-<li><a href="#HttpRequestPool_attach">HttpRequestPool::attach()</a></li>
-<li><a href="#HttpRequestPool_detach">HttpRequestPool::detach()</a></li>
-<li><a href="#HttpRequestPool_send">HttpRequestPool::send()</a></li>
-<li><a href="#HttpRequestPool_socketPerform">HttpRequestPool::socketPerform()</a></li>
-<li><a href="#HttpRequestPool_socketSelect">HttpRequestPool::socketSelect()</a></li>
-<li><a href="#HttpRequestPool_valid">HttpRequestPool::valid()</a></li>
-<li><a href="#HttpRequestPool_current">HttpRequestPool::current()</a></li>
-<li><a href="#HttpRequestPool_key">HttpRequestPool::key()</a></li>
-<li><a href="#HttpRequestPool_next">HttpRequestPool::next()</a></li>
-<li><a href="#HttpRequestPool_rewind">HttpRequestPool::rewind()</a></li>
-<li><a href="#HttpRequestPool_count">HttpRequestPool::count()</a></li>
-<li><a href="#HttpRequestPool_getAttachedRequests">HttpRequestPool::getAttachedRequests()</a></li>
-<li><a href="#HttpRequestPool_getFinishedRequests">HttpRequestPool::getFinishedRequests()</a></li>
-</li>
-</ul>
-</li>
-<li><a class="tocfile" href="#http_response_object.c">http_response_object.c</a>
-<ul>
-<li><a href="#HttpResponse_setHeader">HttpResponse::setHeader()</a></li>
-<li><a href="#HttpResponse_getHeader">HttpResponse::getHeader()</a></li>
-<li><a href="#HttpResponse_setCache">HttpResponse::setCache()</a></li>
-<li><a href="#HttpResponse_getCache">HttpResponse::getCache()</a></li>
-<li><a href="#HttpResponse_setGzip">HttpResponse::setGzip()</a></li>
-<li><a href="#HttpResponse_getGzip">HttpResponse::getGzip()</a></li>
-<li><a href="#HttpResponse_setCacheControl">HttpResponse::setCacheControl()</a></li>
-<li><a href="#HttpResponse_getCacheControl">HttpResponse::getCacheControl()</a></li>
-<li><a href="#HttpResponse_setContentType">HttpResponse::setContentType()</a></li>
-<li><a href="#HttpResponse_getContentType">HttpResponse::getContentType()</a></li>
-<li><a href="#HttpResponse_guessContentType">HttpResponse::guessContentType()</a></li>
-<li><a href="#HttpResponse_setContentDisposition">HttpResponse::setContentDisposition()</a></li>
-<li><a href="#HttpResponse_getContentDisposition">HttpResponse::getContentDisposition()</a></li>
-<li><a href="#HttpResponse_setETag">HttpResponse::setETag()</a></li>
-<li><a href="#HttpResponse_getETag">HttpResponse::getETag()</a></li>
-<li><a href="#HttpResponse_setLastModified">HttpResponse::setLastModified()</a></li>
-<li><a href="#HttpResponse_getLastModified">HttpResponse::getLastModified()</a></li>
-<li><a href="#HttpResponse_setThrottleDelay">HttpResponse::setThrottleDelay()</a></li>
-<li><a href="#HttpResponse_getThrottleDelay">HttpResponse::getThrottleDelay()</a></li>
-<li><a href="#HttpResponse_setBufferSize">HttpResponse::setBufferSize()</a></li>
-<li><a href="#HttpResponse_getBufferSize">HttpResponse::getBufferSize()</a></li>
-<li><a href="#HttpResponse_setData">HttpResponse::setData()</a></li>
-<li><a href="#HttpResponse_getData">HttpResponse::getData()</a></li>
-<li><a href="#HttpResponse_setStream">HttpResponse::setStream()</a></li>
-<li><a href="#HttpResponse_getStream">HttpResponse::getStream()</a></li>
-<li><a href="#HttpResponse_setFile">HttpResponse::setFile()</a></li>
-<li><a href="#HttpResponse_getFile">HttpResponse::getFile()</a></li>
-<li><a href="#HttpResponse_send">HttpResponse::send()</a></li>
-<li><a href="#HttpResponse_capture">HttpResponse::capture()</a></li>
-</li>
-</ul>
-</li>
-</ul>
-</div>
-    <p><b>Generated at: Fri, 07 Jul 2006 21:23:59 +0200</b></p>
-</body>
-</html>
-
diff --git a/docs/http.ini b/docs/http.ini
deleted file mode 100644 (file)
index a32ad46..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-; example INI file for pecl/http
-; $Id$
-
-[http]
-; enable if you want to transform all errors to exceptions (PHP >= 5 only)
-;http.only_exceptions = 1
-
-; disable if you don't want php to exit in case of redirects and cache hits;
-; a "NULL" output handler will be started instead, which discards all output
-;http.force_exit = 0
-
-; disable if you don't want 404 Not found status messages being sent,
-; if a file attempted to be sent with http_send_file() etc. cannot be found
-;http.send.not_found_404 = 0
-
-; the hashing algorithm with wich ETags are generated (MD5, SHA1, CRC32B);
-; if ext/hash is available, this can be set to any hash algorithm ext/hash supports
-; MD5 is the default and fallback algorithm
-;http.etag.mode = "MD5"
-
-; allowed request methods
-; by default PHP ignores unkown request methods
-; PHP will exit with a response status of 405 and an Allow header
-; if it encounters a request method not contained in the specified list
-;http.request.methods.allowed = "HEAD, GET, POST"
-
-; custom request methods
-;http.request.methods.custom = "KICK, BANN"
-
-; log file for positive cache hits
-;http.log.cache =
-
-; log file for redirects
-;http.log.redirect =
-
-; log file for responses with http_send_file() etc. where the file's not been found
-;http.log.not_found =
-
-; log file for requests with an unallowed request method
-;http.log.allowed_methods =
-
-; composite log file (i.e. log all messages to this file)
-;http.log.composite =
-
-; automatically deflate content if requested/supported by client
-;http.send.deflate.start_auto = 1
-;http.send.deflate.start_flags = HTTP_DEFLATE_LEVEL_DEF
-
-; automatically inflate sent content
-;http.send.inflate.start_auto = 0
-;http.send.inflate.start_flags =
-
-; global HttpRequestDataShare settings
-;http.request.datashare.cookie = 0
-;http.request.datashare.dns = 1
-
-; limit of idle persistent handles per provider
-;http.persistent.handles.limit = -1
-
-; default ident of persistent handles
-;http.persistent.handles.ident = "GLOBAL"
diff --git a/funcsummary.php b/funcsummary.php
deleted file mode 100644 (file)
index 27b602d..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-#! /usr/bin/php
-<?php
-
-function hl($m)
-{
-    return sprintf("<blockquote>%s</blockquote>\n", highlight_string($m[1], true));
-}
-function mf($f, &$m)
-{
-    return preg_match_all(
-        '/\/\* *\{\{\{ *proto (.*?)(\n|$)(.*?)PHP_(?:FUNCTION|METHOD)\((.*?)\)/s', 
-        file_get_contents($f), $m);
-}
-function ff($t)
-{
-    $t = preg_replace('/^ \* /m', '', trim($t, "*/ \n"));
-    $t = preg_replace_callback('/(\<\?php.*?\?\>)/s', 'hl', $t);
-    $t = str_replace("<br />\n<br />\n", "</p>\n<p>", nl2br(preg_replace('/\n *\* */', "\n", $t)));
-    $t = preg_replace('/(\<br \/\>\n)+\<pre\>(\<br \/\>\n)+/', '</p><pre>', $t);
-    $t = preg_replace('/(\<br \/\>\n)+\<\/pre\>(\<br \/\>\n)+/', '</pre><p>', $t);
-    $t = str_replace("</span><br />\n</code>", "</span></code>", $t);
-    return sprintf('<p>%s</p>', ltrim($t, ' *'));
-}
-function e($s)
-{
-    $a = func_get_args();
-    array_unshift($a, STDERR);
-    call_user_func_array('fprintf', $a);
-}
-
-$preface = <<<_PREFACE
-<html>
-<head>
-    <title>Function Summary of ext/%s</title>
-    <style>
-        body { 
-            font-size: 80%%; 
-            font-family: sans-serif; 
-        } 
-        h2, h3 { 
-            color: #339; 
-            clear: both;
-            font-size: 1.2em;
-            background: #ffc;
-            padding: .2em;
-        } 
-        h2.o {
-            color: #66b; 
-            clear: both;
-            font-size: 1.3em;
-            background: #f0f0f0;
-            padding: .2em;
-        }
-        p { 
-            margin-left: 1em;
-        } 
-        pre { 
-            font-size: 1.2em; 
-        } 
-        br { 
-            display: none; 
-        } 
-        blockquote {
-            margin-bottom: 3em;
-            border: 1px solid #ccc;
-            background: #f0f0f0;
-            padding: 0em 1em;
-            width: auto;
-            float: left;
-        }
-        p, pre {
-            clear: both;
-        }
-        p br, pre code br { 
-            display: block; 
-        } 
-        .toc {
-            position: absolute;
-            top: 10px;
-            right: 10px;
-            width: 300px;
-            height: 95%%;
-            overflow: scroll;
-            font-size: .9em;
-        }
-        body>div.toc {
-            position: fixed;
-        }
-        .toc ul {
-            padding-left: 15px;
-            margin-left: 0;
-        }
-        .toc li {
-            padding: 0;
-            margin: 0;
-        }
-        .tocfile {
-            font-weight: bold;
-        }
-    </style>
-</head>
-<body>
-_PREFACE;
-
-$footer = <<<_FOOTER
-    <p><b>Generated at: %s</b></p>
-</body>
-</html>
-
-_FOOTER;
-
-if ($_SERVER['argc'] < 2) {
-    die("Usage: {$_SERVER['argv'][0]} <file>[ <file> ...]\n");
-}
-
-$TOC = array();
-
-printf($preface, basename(getcwd()));
-
-$seen = array();
-foreach (array_slice($_SERVER['argv'], 1) as $fp) {
-    foreach (glob($fp) as $f) {
-        if (isset($seen[$f])) {
-              continue;
-        } else {
-           $seen[$f] = true;
-        }
-        if (mf($f, $m)) {
-            $c = null;
-            e("\nAnalyzing %s\n", basename($f));
-            printf("<h1 id=\"%s\">%s</h1>\n", basename($f), basename($f));
-            foreach ($m[1] as $i => $p) {
-                e("Documenting $p\n");
-                if ($o = preg_match('/^(.*), (.*)$/', $m[4][$i], $n)) {
-                    if ($n[1] != $c) {
-                        $c = $n[1];
-                        printf("<h2 id=\"%s\" class=\"o\">%s</h2>\n", $n[1], $n[1]);
-                    }
-                    $TOC[basename($f)][$n[1]][$n[2]] = $n[1].'::'.$n[2].'()';
-                    printf("<h%d id=\"%s\">%s</h%d>\n", 3, $n[1].'_'.$n[2], $p, 3);
-                } else {
-                    $TOC[basename($f)][$m[4][$i]] = $m[4][$i].'()';
-                    printf("<h%d id=\"%s\">%s</h%d>\n", 2, $m[4][$i], $p, 2);
-                }
-                print ff($m[3][$i]) ."\n";
-            }
-            print "<hr noshade>\n";
-        }
-    }
-}
-printf("<div class=\"toc\"><strong>Table of Contents</strong>\n<ul>\n");
-foreach ($TOC as $file => $f) {
-    printf("<li><a class=\"tocfile\" href=\"#%s\">%s</a>\n<ul>\n", $file, $file);
-    foreach ($f as $cof => $met) {
-        if (is_array($met)) {
-            foreach ($met as $id => $m) {
-                printf("<li><a href=\"#%s_%s\">%s</a></li>\n", $cof, $id, $m);
-            }
-        } else {
-            printf("<li><a href=\"#%s\">%s</a>\n", $cof, $cof);
-        }
-        printf("</li>\n");
-    }
-    printf("</ul>\n</li>\n");
-}
-printf("</ul>\n</div>\n");
-
-printf($footer, date('r'));
-e("\nDone\n");
-?>
-
diff --git a/gen_curlinfo.php b/gen_curlinfo.php
new file mode 100644 (file)
index 0000000..fea14bb
--- /dev/null
@@ -0,0 +1,98 @@
+#!/usr/bin/env php
+<?php
+// $Id: gen_curlinfo.php 323304 2012-02-17 21:13:24Z mike $
+
+error_reporting(0);
+
+function failure() {
+       // this is why error_get_last() should return a stdClass object
+       $error = error_get_last();
+       fprintf(STDERR, "FAILURE: %s\n", $error["message"]);
+       exit(-1);
+}
+
+function file_re($file, $pattern, $all = true) {
+       static $path;
+       
+       $path or $path = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1].'/include/curl/' : "/usr/local/include/curl/";
+       
+       if ($content = file_get_contents($path . $file)) {
+               if ($all) {
+                       if (preg_match_all($pattern, $content, $matches, PREG_SET_ORDER)) {
+                               return $matches;
+                       }
+               } else {
+                       if (preg_match($pattern, $content, $matches)) {
+                               return $matches;
+                       }
+               }
+               trigger_error("no match in $file for $pattern");
+       }
+       failure();
+}
+
+$ifdefs = array(
+       'PRIMARY_IP' => 'PHP_HTTP_CURL_VERSION(7,19,0)',
+       'APPCONNECT_TIME' => 'PHP_HTTP_CURL_VERSION(7,19,0)',
+    'CONDITION_UNMET' => 'PHP_HTTP_CURL_VERSION(7,19,4)',
+    'PRIMARY_PORT' => 'PHP_HTTP_CURL_VERSION(7,21,0)',
+    'LOCAL_PORT' => 'PHP_HTTP_CURL_VERSION(7,21,0)',
+    'LOCAL_IP' => 'PHP_HTTP_CURL_VERSION(7,21,0)',
+);
+$exclude = array(
+    'PRIVATE', 'LASTSOCKET', 'FTP_ENTRY_PATH', 'CERTINFO',
+    'RTSP_SESSION_ID', 'RTSP_CLIENT_CSEQ', 'RTSP_SERVER_CSEQ', 'RTSP_CSEQ_RECV'
+);
+
+$translate = array(
+       'HTTP_CONNECTCODE' => "connect_code",
+       'COOKIELIST' => 'cookies',
+);
+
+$templates = array(
+'STRING' => 
+'      if (CURLE_OK == curl_easy_getinfo(ch, %s, &c)) {
+               add_assoc_string_ex(&array, "%s", sizeof("%2$s"), c ? c : "", 1);
+       }
+',
+'DOUBLE' => 
+'      if (CURLE_OK == curl_easy_getinfo(ch, %s, &d)) {
+               add_assoc_double_ex(&array, "%s", sizeof("%2$s"), d);
+       }
+',
+'LONG' => 
+'      if (CURLE_OK == curl_easy_getinfo(ch, %s, &l)) {
+               add_assoc_long_ex(&array, "%s", sizeof("%2$s"), l);
+       }
+',
+'SLIST' =>
+'      if (CURLE_OK == curl_easy_getinfo(ch, %s, &s)) {
+               MAKE_STD_ZVAL(subarray);
+               array_init(subarray);
+               for (p = s; p; p = p->next) {
+                       if (p->data) {
+                               add_next_index_string(subarray, p->data, 1);
+                       }
+               }
+               add_assoc_zval_ex(&array, "%s", sizeof("%2$s"), subarray);
+               curl_slist_free_all(s);
+       }
+',
+);
+
+$infos = file_re('curl.h', '/^\s*(CURLINFO_(\w+))\s*=\s*CURLINFO_(STRING|LONG|DOUBLE|SLIST)\s*\+\s*\d+\s*,?\s*$/m');
+
+ob_start();
+foreach ($infos as $info) {
+       list(, $full, $short, $type) = $info;
+       if (in_array($short, $exclude)) continue;
+       if (isset($ifdefs[$short])) printf("#if %s\n", $ifdefs[$short]);
+       printf($templates[$type], $full, strtolower((isset($translate[$short])) ? $translate[$short] : $short));
+       if (isset($ifdefs[$short])) printf("#endif\n");
+}
+
+file_put_contents("php_http_curl_client.c", 
+       preg_replace('/(\/\* BEGIN::CURLINFO \*\/\n).*(\n\s*\/\* END::CURLINFO \*\/)/s', '$1'. ob_get_contents() .'$2',
+               file_get_contents("php_http_curl_client.c")));
+
+?>
diff --git a/http.c b/http.c
deleted file mode 100644 (file)
index 76629d3..0000000
--- a/http.c
+++ /dev/null
@@ -1,546 +0,0 @@
-/*
-    +--------------------------------------------------------------------+
-    | PECL :: http                                                       |
-    +--------------------------------------------------------------------+
-    | Redistribution and use in source and binary forms, with or without |
-    | modification, are permitted provided that the conditions mentioned |
-    | in the accompanying LICENSE file are met.                          |
-    +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2010, Michael Wallner <mike@php.net>            |
-    +--------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#define HTTP_WANT_SAPI
-#define HTTP_WANT_CURL
-#define HTTP_WANT_EVENT
-#define HTTP_WANT_ZLIB
-#define HTTP_WANT_MAGIC
-#include "php_http.h"
-
-#include "php_ini.h"
-#include "ext/standard/info.h"
-#include "zend_extensions.h"
-
-#include "php_http_api.h"
-#include "php_http_cache_api.h"
-#include "php_http_cookie_api.h"
-#include "php_http_encoding_api.h"
-#include "php_http_filter_api.h"
-#include "php_http_message_api.h"
-#include "php_http_persistent_handle_api.h"
-#include "php_http_request_api.h"
-#include "php_http_request_datashare_api.h"
-#include "php_http_request_method_api.h"
-#include "php_http_request_pool_api.h"
-#include "php_http_send_api.h"
-#include "php_http_url_api.h"
-
-#include "php_http_deflatestream_object.h"
-#include "php_http_exception_object.h"
-#include "php_http_inflatestream_object.h"
-#include "php_http_message_object.h"
-#include "php_http_querystring_object.h"
-#include "php_http_request_object.h"
-#include "php_http_requestdatashare_object.h"
-#include "php_http_requestpool_object.h"
-#include "php_http_response_object.h"
-#include "php_http_util_object.h"
-
-ZEND_DECLARE_MODULE_GLOBALS(http);
-HTTP_DECLARE_ARG_PASS_INFO();
-
-#ifdef COMPILE_DL_HTTP
-ZEND_GET_MODULE(http)
-#endif
-
-/* {{{ http_functions[] */
-zend_function_entry http_functions[] = {
-       PHP_FE(http_date, NULL)
-       PHP_FE(http_build_url, http_arg_pass_ref_4)
-       PHP_FE(http_build_str, NULL)
-#ifndef ZEND_ENGINE_2
-       PHP_FALIAS(http_build_query, http_build_str, NULL)
-#endif
-       PHP_FE(http_negotiate_language, http_arg_pass_ref_2)
-       PHP_FE(http_negotiate_charset, http_arg_pass_ref_2)
-       PHP_FE(http_negotiate_content_type, http_arg_pass_ref_2)
-       PHP_FE(http_negotiate, http_arg_pass_ref_3)
-       PHP_FE(http_redirect, NULL)
-       PHP_FE(http_throttle, NULL)
-       PHP_FE(http_send_status, NULL)
-       PHP_FE(http_send_last_modified, NULL)
-       PHP_FE(http_send_content_type, NULL)
-       PHP_FE(http_send_content_disposition, NULL)
-       PHP_FE(http_match_modified, NULL)
-       PHP_FE(http_match_etag, NULL)
-       PHP_FE(http_cache_last_modified, NULL)
-       PHP_FE(http_cache_etag, NULL)
-       PHP_FE(http_send_data, NULL)
-       PHP_FE(http_send_file, NULL)
-       PHP_FE(http_send_stream, NULL)
-       PHP_FE(http_chunked_decode, NULL)
-       PHP_FE(http_parse_message, NULL)
-       PHP_FE(http_parse_headers, NULL)
-       PHP_FE(http_parse_cookie, NULL)
-       PHP_FE(http_build_cookie, NULL)
-       PHP_FE(http_parse_params, NULL)
-       PHP_FE(http_get_request_headers, NULL)
-       PHP_FE(http_get_request_body, NULL)
-       PHP_FE(http_get_request_body_stream, NULL)
-       PHP_FE(http_match_request_header, NULL)
-       PHP_FE(http_persistent_handles_count, NULL)
-       PHP_FE(http_persistent_handles_clean, NULL)
-       PHP_FE(http_persistent_handles_ident, NULL)
-#ifdef HTTP_HAVE_CURL
-       PHP_FE(http_get, http_arg_pass_ref_3)
-       PHP_FE(http_head, http_arg_pass_ref_3)
-       PHP_FE(http_post_data, http_arg_pass_ref_4)
-       PHP_FE(http_post_fields, http_arg_pass_ref_5)
-       PHP_FE(http_put_data, http_arg_pass_ref_4)
-       PHP_FE(http_put_file, http_arg_pass_ref_4)
-       PHP_FE(http_put_stream, http_arg_pass_ref_4)
-       PHP_FE(http_request, http_arg_pass_ref_5)
-       PHP_FE(http_request_body_encode, NULL)
-#endif
-       PHP_FE(http_request_method_register, NULL)
-       PHP_FE(http_request_method_unregister, NULL)
-       PHP_FE(http_request_method_exists, NULL)
-       PHP_FE(http_request_method_name, NULL)
-       PHP_FE(ob_etaghandler, NULL)
-#ifdef HTTP_HAVE_ZLIB
-       PHP_FE(http_deflate, NULL)
-       PHP_FE(http_inflate, NULL)
-       PHP_FE(ob_deflatehandler, NULL)
-       PHP_FE(ob_inflatehandler, NULL)
-#endif
-       PHP_FE(http_support, NULL)
-       
-       EMPTY_FUNCTION_ENTRY
-};
-/* }}} */
-
-PHP_MINIT_FUNCTION(http);
-PHP_MSHUTDOWN_FUNCTION(http);
-PHP_RINIT_FUNCTION(http);
-PHP_RSHUTDOWN_FUNCTION(http);
-PHP_MINFO_FUNCTION(http);
-
-/* {{{ http_module_dep */
-#if ZEND_EXTENSION_API_NO >= 220050617
-static zend_module_dep http_module_deps[] = {
-#      ifdef HTTP_HAVE_SPL
-       ZEND_MOD_REQUIRED("spl")
-#      endif
-#      ifdef HTTP_HAVE_HASH
-       ZEND_MOD_REQUIRED("hash")
-#      endif
-#      ifdef HTTP_HAVE_SESSION
-       ZEND_MOD_REQUIRED("session")
-#      endif
-#      ifdef HTTP_HAVE_ICONV
-       ZEND_MOD_REQUIRED("iconv")
-#      endif
-#      ifdef HTTP_HAVE_EVENT
-       ZEND_MOD_CONFLICTS("event")
-#endif
-       {NULL, NULL, NULL, 0}
-};
-#endif
-/* }}} */
-
-/* {{{ http_module_entry */
-zend_module_entry http_module_entry = {
-#if ZEND_EXTENSION_API_NO >= 220050617
-       STANDARD_MODULE_HEADER_EX, NULL,
-       http_module_deps,
-#else
-       STANDARD_MODULE_HEADER,
-#endif
-       "http",
-       http_functions,
-       PHP_MINIT(http),
-       PHP_MSHUTDOWN(http),
-       PHP_RINIT(http),
-       PHP_RSHUTDOWN(http),
-       PHP_MINFO(http),
-       PHP_HTTP_VERSION,
-       STANDARD_MODULE_PROPERTIES
-};
-/* }}} */
-
-int http_module_number;
-
-/* {{{ http_globals */
-static void http_globals_init_once(zend_http_globals *G)
-{
-       memset(G, 0, sizeof(zend_http_globals));
-}
-
-#define http_globals_init(g) _http_globals_init((g) TSRMLS_CC)
-static inline void _http_globals_init(zend_http_globals *G TSRMLS_DC)
-{
-#ifdef HTTP_HAVE_SAPI_RTIME
-       G->request.time = sapi_get_request_time(TSRMLS_C);
-#else
-       G->request.time = time(NULL);
-#endif
-       G->send.buffer_size = 0;
-       G->read_post_data = 0;
-}
-
-#define http_globals_free(g) _http_globals_free((g) TSRMLS_CC)
-static inline void _http_globals_free(zend_http_globals *G TSRMLS_DC)
-{
-       if (G->request.headers) {
-               zend_hash_destroy(G->request.headers);
-               FREE_HASHTABLE(G->request.headers);
-               G->request.headers = NULL;
-       }
-       STR_SET(G->send.content_type, NULL);
-       STR_SET(G->send.unquoted_etag, NULL);
-       if (G->server_var) {
-               zval_ptr_dtor(&G->server_var);
-               G->server_var = NULL;
-       }
-}
-
-#if defined(ZTS) && defined(PHP_DEBUG)
-#if ZTS && PHP_DEBUG
-zend_http_globals *http_globals(void)
-{
-       TSRMLS_FETCH();
-       return HTTP_G;
-}
-#endif
-#endif
-/* }}} */
-
-/* {{{ static inline void http_check_allowed_methods(char *) */
-#define http_check_allowed_methods(m) _http_check_allowed_methods((m) TSRMLS_CC)
-static inline void _http_check_allowed_methods(const char *methods TSRMLS_DC)
-{
-       if (*methods && SG(request_info).request_method) {
-               if (SUCCESS != http_check_method_ex(SG(request_info).request_method, methods)) {
-                       char *header;
-                       spprintf(&header, 0, "Allow: %s", methods);
-                       http_exit(405, header);
-               }
-       }
-}
-/* }}} */
-
-/* {{{ PHP_INI */
-PHP_INI_MH(http_update_allowed_methods)
-{
-       if (*new_value) {
-               http_check_allowed_methods(new_value);
-       }
-       return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
-}
-PHP_INI_MH(http_update_persistent_handle_ident)
-{
-       HTTP_G->persistent.handles.ident.h = zend_hash_func(new_value, HTTP_G->persistent.handles.ident.l = new_value_length+1);
-       return OnUpdateString(entry, new_value, new_value_length, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
-}
-
-#ifndef ZEND_ENGINE_2
-#      define OnUpdateLong OnUpdateInt
-#endif
-
-PHP_INI_BEGIN()
-       HTTP_PHP_INI_ENTRY("http.etag.mode", "MD5", PHP_INI_ALL, OnUpdateString, etag.mode)
-       HTTP_PHP_INI_ENTRY("http.log.cache", "", PHP_INI_ALL, OnUpdateString, log.cache)
-       HTTP_PHP_INI_ENTRY("http.log.redirect", "", PHP_INI_ALL, OnUpdateString, log.redirect)
-       HTTP_PHP_INI_ENTRY("http.log.not_found", "", PHP_INI_ALL, OnUpdateString, log.not_found)
-       HTTP_PHP_INI_ENTRY("http.log.allowed_methods", "", PHP_INI_ALL, OnUpdateString, log.allowed_methods)
-       HTTP_PHP_INI_ENTRY("http.log.composite", "", PHP_INI_ALL, OnUpdateString, log.composite)
-       HTTP_PHP_INI_ENTRY("http.request.methods.allowed", "", PHP_INI_ALL, http_update_allowed_methods, request.methods.allowed)
-       HTTP_PHP_INI_ENTRY("http.request.methods.custom", "", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateString, request.methods.custom)
-#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
-       HTTP_PHP_INI_ENTRY("http.request.datashare.cookie", "0", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.cookie)
-       HTTP_PHP_INI_ENTRY("http.request.datashare.dns", "1", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.dns)
-       HTTP_PHP_INI_ENTRY("http.request.datashare.ssl", "0", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.ssl)
-       HTTP_PHP_INI_ENTRY("http.request.datashare.connect", "0", PHP_INI_SYSTEM, OnUpdateBool, request.datashare.connect)
-#endif
-#ifdef HTTP_HAVE_ZLIB
-       HTTP_PHP_INI_ENTRY("http.send.inflate.start_auto", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, send.inflate.start_auto)
-       HTTP_PHP_INI_ENTRY("http.send.inflate.start_flags", "0", PHP_INI_ALL, OnUpdateLong, send.inflate.start_flags)
-       HTTP_PHP_INI_ENTRY("http.send.deflate.start_auto", "0", PHP_INI_PERDIR|PHP_INI_SYSTEM, OnUpdateBool, send.deflate.start_auto)
-       HTTP_PHP_INI_ENTRY("http.send.deflate.start_flags", "0", PHP_INI_ALL, OnUpdateLong, send.deflate.start_flags)
-#endif
-       HTTP_PHP_INI_ENTRY("http.persistent.handles.limit", "-1", PHP_INI_SYSTEM, OnUpdateLong, persistent.handles.limit)
-       HTTP_PHP_INI_ENTRY("http.persistent.handles.ident", "GLOBAL", PHP_INI_ALL, http_update_persistent_handle_ident, persistent.handles.ident.s)
-       HTTP_PHP_INI_ENTRY("http.send.not_found_404", "1", PHP_INI_ALL, OnUpdateBool, send.not_found_404)
-#ifdef ZEND_ENGINE_2
-       HTTP_PHP_INI_ENTRY("http.only_exceptions", "0", PHP_INI_ALL, OnUpdateBool, only_exceptions)
-#endif
-       HTTP_PHP_INI_ENTRY("http.force_exit", "1", PHP_INI_ALL, OnUpdateBool, force_exit)
-PHP_INI_END()
-/* }}} */
-
-/* {{{ PHP_MINIT_FUNCTION */
-PHP_MINIT_FUNCTION(http)
-{
-       http_module_number = module_number;
-       ZEND_INIT_MODULE_GLOBALS(http, http_globals_init_once, NULL);
-       REGISTER_INI_ENTRIES();
-       
-       if (0
-               || SUCCESS != PHP_MINIT_CALL(http_persistent_handle) /* first */
-               || SUCCESS != PHP_MINIT_CALL(http_cookie)
-#ifdef HTTP_HAVE_ZLIB
-               || SUCCESS != PHP_MINIT_CALL(http_encoding)
-#endif
-#ifdef HTTP_HAVE_CURL
-               || SUCCESS != PHP_MINIT_CALL(http_request)
-#      ifdef ZEND_ENGINE_2
-#      endif
-#endif
-               || SUCCESS != PHP_MINIT_CALL(http_request_method)
-               || SUCCESS != PHP_MINIT_CALL(http_send)
-               || SUCCESS != PHP_MINIT_CALL(http_support)
-               || SUCCESS != PHP_MINIT_CALL(http_url)
-               
-#ifdef ZEND_ENGINE_2
-               || SUCCESS != PHP_MINIT_CALL(http_filter)
-               || SUCCESS != PHP_MINIT_CALL(http_exception_object)
-#      ifdef HTTP_HAVE_ZLIB
-               || SUCCESS != PHP_MINIT_CALL(http_deflatestream_object)
-               || SUCCESS != PHP_MINIT_CALL(http_inflatestream_object)
-#      endif
-               || SUCCESS != PHP_MINIT_CALL(http_message_object)
-               || SUCCESS != PHP_MINIT_CALL(http_querystring_object)
-#      ifdef HTTP_HAVE_CURL
-               || SUCCESS != PHP_MINIT_CALL(http_request_datashare)
-               || SUCCESS != PHP_MINIT_CALL(http_request_pool)
-               || SUCCESS != PHP_MINIT_CALL(http_request_object)
-               || SUCCESS != PHP_MINIT_CALL(http_requestdatashare_object)
-               || SUCCESS != PHP_MINIT_CALL(http_requestpool_object)
-#      endif
-#      ifndef WONKY
-               || SUCCESS != PHP_MINIT_CALL(http_response_object)
-#      endif
-               || SUCCESS != PHP_MINIT_CALL(http_util_object)
-#endif
-       ) {
-               return FAILURE;
-       }
-       
-       return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_MSHUTDOWN_FUNCTION */
-PHP_MSHUTDOWN_FUNCTION(http)
-{
-       UNREGISTER_INI_ENTRIES();
-       
-       if (0
-#ifdef HTTP_HAVE_CURL
-               || SUCCESS != PHP_MSHUTDOWN_CALL(http_request)
-#      ifdef ZEND_ENGINE_2
-               || SUCCESS != PHP_MSHUTDOWN_CALL(http_request_datashare)
-#      endif
-#endif
-               || SUCCESS != PHP_MSHUTDOWN_CALL(http_message_object)
-               || SUCCESS != PHP_MSHUTDOWN_CALL(http_persistent_handle) /* last */
-       ) {
-               return FAILURE;
-       }
-       
-       return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RINIT_FUNCTION */
-PHP_RINIT_FUNCTION(http)
-{
-       http_globals_init(HTTP_G);
-       
-       if (HTTP_G->request.methods.allowed && *HTTP_G->request.methods.allowed) {
-               http_check_allowed_methods(HTTP_G->request.methods.allowed);
-       }
-       
-       if (0
-#ifdef HTTP_HAVE_ZLIB
-               || SUCCESS != PHP_RINIT_CALL(http_encoding)
-#endif
-#ifdef HTTP_HAVE_CURL
-#      ifdef ZEND_ENGINE_2
-#              ifdef HTTP_HAVE_EVENT
-               || SUCCESS != PHP_RINIT_CALL(http_request_pool)
-#              endif
-               || SUCCESS != PHP_RINIT_CALL(http_request_datashare)
-#      endif
-#endif
-               || SUCCESS != PHP_RINIT_CALL(http_request_method)
-       ) {
-               return FAILURE;
-       }
-       
-       return SUCCESS;
-}
-/* }}} */
-
-/* {{{ PHP_RSHUTDOWN_FUNCTION */
-PHP_RSHUTDOWN_FUNCTION(http)
-{
-       STATUS status = SUCCESS;
-       
-       if (0
-#ifdef HTTP_HAVE_ZLIB
-               || SUCCESS != PHP_RSHUTDOWN_CALL(http_encoding)
-#endif
-#ifdef HTTP_HAVE_CURL
-#      ifdef ZEND_ENGINE_2
-               || SUCCESS != PHP_RSHUTDOWN_CALL(http_request_datashare)
-#      endif
-#endif
-               || SUCCESS != PHP_RSHUTDOWN_CALL(http_request_method)
-       ) {
-               status = FAILURE;
-       }
-       
-       http_globals_free(HTTP_G);
-       return status;
-}
-/* }}} */
-
-/* {{{ PHP_MINFO_FUNCTION */
-PHP_MINFO_FUNCTION(http)
-{
-       php_info_print_table_start();
-       {
-               php_info_print_table_header(2, "HTTP Support", "enabled");
-               php_info_print_table_row(2, "Extension Version", PHP_HTTP_VERSION);
-               php_info_print_table_row(2, "Registered Classes",
-#ifndef ZEND_ENGINE_2
-                       "none"
-#else
-                       "HttpUtil, "
-                       "HttpMessage, "
-#      ifdef HTTP_HAVE_CURL
-                       "HttpRequest, "
-                       "HttpRequestPool, "
-                       "HttpRequestDataShare, "
-#      endif
-#      ifdef HTTP_HAVE_ZLIB
-                       "HttpDeflateStream, "
-                       "HttpInflateStream, "
-#      endif
-#      ifndef WONKY
-                       "HttpResponse, "
-#      endif
-                       "HttpQueryString"
-#endif
-               );
-               php_info_print_table_row(2, "Output Handlers", "ob_deflatehandler, ob_inflatehandler, ob_etaghandler");
-               php_info_print_table_row(2, "Stream Filters", 
-#ifndef ZEND_ENGINE_2
-                       "none"
-#else
-                       "http.chunked_decode, http.chunked_encode, http.deflate, http.inflate"
-#endif
-               );
-       }
-       php_info_print_table_end();
-       
-       php_info_print_table_start();
-       php_info_print_table_header(3, "Used Library", "Compiled", "Linked");
-       {
-#ifdef HTTP_HAVE_CURL
-               curl_version_info_data *cv = curl_version_info(CURLVERSION_NOW);
-               php_info_print_table_row(3, "libcurl", LIBCURL_VERSION, cv->version);
-#else
-               php_info_print_table_row(2, "libcurl", "disabled", "disabled");
-#endif
-#ifdef HTTP_HAVE_EVENT
-               php_info_print_table_row(3, "libevent", HTTP_EVENT_VERSION, event_get_version());
-#else
-               php_info_print_table_row(3, "libevent", "disabled", "disabled");
-#endif
-#ifdef HTTP_HAVE_ZLIB
-               php_info_print_table_row(3, "libz", ZLIB_VERSION, zlibVersion());
-#else
-               php_info_print_table_row(3, "libz", "disabled", "disabled");
-#endif
-#if defined(HTTP_HAVE_MAGIC)
-               php_info_print_table_row(3, "libmagic", "unknown", "unknown");
-#else
-               php_info_print_table_row(3, "libmagic", "disabled", "disabled");
-#endif
-       }
-       php_info_print_table_end();
-       
-       php_info_print_table_start();
-       php_info_print_table_colspan_header(4, "Persistent Handles");
-       php_info_print_table_header(4, "Provider", "Ident", "Used", "Free");
-       {
-               HashTable *ht;
-               HashPosition pos1, pos2;
-               HashKey provider = initHashKey(0), ident = initHashKey(0);
-               zval **val, **sub, **zused, **zfree;
-               
-               if ((ht = http_persistent_handle_statall()) && zend_hash_num_elements(ht)) {
-                       FOREACH_HASH_KEYVAL(pos1, ht, provider, val) {
-                               if (zend_hash_num_elements(Z_ARRVAL_PP(val))) {
-                                       FOREACH_KEYVAL(pos2, *val, ident, sub) {
-                                               if (    SUCCESS == zend_hash_find(Z_ARRVAL_PP(sub), ZEND_STRS("used"), (void *) &zused) &&
-                                                               SUCCESS == zend_hash_find(Z_ARRVAL_PP(sub), ZEND_STRS("free"), (void *) &zfree)) {
-                                                       zval *used = http_zsep(IS_STRING, *zused);
-                                                       zval *free = http_zsep(IS_STRING, *zfree);
-                                                       php_info_print_table_row(4, provider.str, ident.str, Z_STRVAL_P(used), Z_STRVAL_P(free));
-                                                       zval_ptr_dtor(&used);
-                                                       zval_ptr_dtor(&free);
-                                               } else {
-                                                       php_info_print_table_row(4, provider.str, ident.str, "0", "0");
-                                               }
-                                       }
-                               } else {
-                                       php_info_print_table_row(4, provider.str, "N/A", "0", "0");
-                               }
-                       }
-               } else {
-                       php_info_print_table_row(4, "N/A", "N/A", "0", "0");
-               }
-               if (ht) {
-                       zend_hash_destroy(ht);
-                       FREE_HASHTABLE(ht);
-               }
-       }
-       php_info_print_table_end();
-       
-       php_info_print_table_start();
-       php_info_print_table_colspan_header(2, "Request Methods");
-       {
-               HashPosition pos;
-               phpstr *methods = phpstr_new();
-               char **name;
-               
-               FOREACH_HASH_VAL(pos, &HTTP_G->request.methods.registered, name) {
-                       if (pos->h) {
-                               phpstr_appendf(methods, "%s, ", *name);
-                       }
-               }
-               phpstr_fix(methods);
-               php_info_print_table_row(2, "Registered", PHPSTR_VAL(methods));
-               php_info_print_table_row(2, "Allowed", *HTTP_G->request.methods.allowed ? HTTP_G->request.methods.allowed : "(ANY)");
-               phpstr_free(&methods);
-       }
-       php_info_print_table_end();
-       
-       DISPLAY_INI_ENTRIES();
-}
-/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
-
diff --git a/http.dsp b/http.dsp
deleted file mode 100644 (file)
index 5edf464..0000000
--- a/http.dsp
+++ /dev/null
@@ -1,257 +0,0 @@
-# Microsoft Developer Studio Project File - Name="http" - Package Owner=<4>\r
-# Microsoft Developer Studio Generated Build File, Format Version 6.00\r
-# ** DO NOT EDIT **\r
-\r
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102\r
-\r
-CFG=http - Win32 Release_TS\r
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,\r
-!MESSAGE use the Export Makefile command and run\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "http.mak".\r
-!MESSAGE \r
-!MESSAGE You can specify a configuration when running NMAKE\r
-!MESSAGE by defining the macro CFG on the command line. For example:\r
-!MESSAGE \r
-!MESSAGE NMAKE /f "http.mak" CFG="http - Win32 Release_TS"\r
-!MESSAGE \r
-!MESSAGE Possible choices for configuration are:\r
-!MESSAGE \r
-!MESSAGE "http - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")\r
-!MESSAGE "http - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")\r
-!MESSAGE \r
-\r
-# Begin Project\r
-# PROP AllowPerConfigDependencies 0\r
-# PROP Scc_ProjName ""\r
-# PROP Scc_LocalPath ""\r
-CPP=cl.exe\r
-MTL=midl.exe\r
-RSC=rc.exe\r
-\r
-!IF  "$(CFG)" == "http - Win32 Release_TS"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "Release_TS"\r
-# PROP BASE Intermediate_Dir "Release_TS"\r
-# PROP BASE Ignore_Export_Lib 0\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Release_TS"\r
-# PROP Intermediate_Dir "Release_TS"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_HTTP" /D ZTS=1 /YX /FD /c\r
-# ADD CPP /nologo /Gd /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HTTP_EXPORTS" /D "COMPILE_DL_HTTP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_HTTP=1 /D HTTP_HAVE_CURL=1 /D HAVE_CURL_EASY_STRERROR=1 /D HAVE_CURL_SHARE_STRERROR=1 /D HAVE_CURL_MULTI_STRERROR=1 /D HAVE_CURL_EASY_RESET=1 /D HAVE_CURL_FORMGET=1 /D HAVE_GETHOSTNAME=1 /D HAVE_GETSERVBYPORT=1 /D HAVE_GETSERVBYNAME=1 /D "_WINSOCKAPI_=" /FR /YX /FD /c\r
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
-# ADD BASE RSC /l 0x406 /d "NDEBUG"\r
-# ADD RSC /l 0x406 /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386\r
-# ADD LINK32 libcurl.lib ssleay32.lib libeay32.lib zlib.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_http.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\php_build\curl\lib" /libpath:"..\..\..\php4\Release_TS" /libpath:"..\..\..\php4\Release_TS_Inline"\r
-\r
-!ELSEIF  "$(CFG)" == "http - Win32 Debug_TS"\r
-\r
-# PROP BASE Use_MFC 0\r
-# PROP BASE Use_Debug_Libraries 0\r
-# PROP BASE Output_Dir "Debug_TS"\r
-# PROP BASE Intermediate_Dir "Debug_TS"\r
-# PROP BASE Ignore_Export_Lib 0\r
-# PROP BASE Target_Dir ""\r
-# PROP Use_MFC 0\r
-# PROP Use_Debug_Libraries 0\r
-# PROP Output_Dir "Debug_TS"\r
-# PROP Intermediate_Dir "Debug_TS"\r
-# PROP Ignore_Export_Lib 0\r
-# PROP Target_Dir ""\r
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_HTTP" /D ZTS=1 /YX /FD /c\r
-# ADD CPP /nologo /MDd /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "HTTP_EXPORTS" /D "COMPILE_DL_HTTP" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_HTTP=1 /D HTTP_HAVE_CURL=1 /D HAVE_CURL_EASY_STRERROR=1 /D HAVE_CURL_SHARE_STRERROR=1 /D HAVE_CURL_MULTI_STRERROR=1 /D HAVE_CURL_EASY_RESET=1 /D HAVE_CURL_FORMGET=1 /D HAVE_GETHOSTNAME=1 /D HAVE_GETSERVBYPORT=1 /D HAVE_GETSERVBYNAME=1 /D "_WINSOCKAPI_=" /YX /FD /c\r
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32\r
-# ADD BASE RSC /l 0x406 /d "NDEBUG"\r
-# ADD RSC /l 0x406 /d "NDEBUG"\r
-BSC32=bscmake.exe\r
-# ADD BASE BSC32 /nologo\r
-# ADD BSC32 /nologo\r
-LINK32=link.exe\r
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386\r
-# ADD LINK32 libcurl.lib ssleay32.lib libeay32.lib zlib.lib winmm.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib wsock32.lib /nologo /dll /machine:I386 /out:"..\..\Debug_TS/http.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\php_build\curl\lib" /libpath:"..\..\..\php4\Release_TS" /libpath:"..\..\..\php4\Release_TS_Inline"\r
-\r
-!ENDIF \r
-\r
-# Begin Target\r
-\r
-# Name "http - Win32 Release_TS"\r
-# Name "http - Win32 Debug_TS"\r
-# Begin Group "Source Files"\r
-\r
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
-# Begin Source File\r
-\r
-SOURCE=.\http.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_encoding_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_request_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_request_info.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_request_body_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_request_method_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_functions.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_persistent_handle_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_cache_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_cookie_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_date_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_headers_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_message_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_send_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_url_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_querystring_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\http_info_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\phpstr\phpstr.c\r
-# End Source File\r
-# End Group\r
-# Begin Group "Header Files"\r
-\r
-# PROP Default_Filter "h;hpp;hxx;hm;inl"\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_encoding_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_request_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_request_int.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_request_body_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_request_method_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_persistent_handle_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_cache_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_cookie_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_date_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_message_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_send_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_headers_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_url_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_querystring_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_info_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\php_http_std_defs.h\r
-# End Source File\r
-# Begin Source File\r
-\r
-SOURCE=.\phpstr\phpstr.h\r
-# End Source File\r
-# End Group\r
-# Begin Group "Resource Files"\r
-\r
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"\r
-# End Group\r
-# End Target\r
-# End Project\r
diff --git a/http_api.c b/http_api.c
deleted file mode 100644 (file)
index 6b01a3b..0000000
+++ /dev/null
@@ -1,754 +0,0 @@
-/*
-    +--------------------------------------------------------------------+
-    | PECL :: http                                                       |
-    +--------------------------------------------------------------------+
-    | Redistribution and use in source and binary forms, with or without |
-    | modification, are permitted provided that the conditions mentioned |
-    | in the accompanying LICENSE file are met.                          |
-    +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2010, Michael Wallner <mike@php.net>            |
-    +--------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#define HTTP_WANT_SAPI
-#include "php_http.h"
-
-#include "php_output.h"
-#include "ext/standard/url.h"
-#include "ext/standard/php_lcg.h"
-
-#include "php_http_api.h"
-#include "php_http_send_api.h"
-
-#ifdef ZEND_ENGINE_2
-#      include "php_http_exception_object.h"
-#endif
-
-PHP_MINIT_FUNCTION(http_support)
-{
-       HTTP_LONG_CONSTANT("HTTP_SUPPORT", HTTP_SUPPORT);
-       HTTP_LONG_CONSTANT("HTTP_SUPPORT_REQUESTS", HTTP_SUPPORT_REQUESTS);
-       HTTP_LONG_CONSTANT("HTTP_SUPPORT_MAGICMIME", HTTP_SUPPORT_MAGICMIME);
-       HTTP_LONG_CONSTANT("HTTP_SUPPORT_ENCODINGS", HTTP_SUPPORT_ENCODINGS);
-       HTTP_LONG_CONSTANT("HTTP_SUPPORT_SSLREQUESTS", HTTP_SUPPORT_SSLREQUESTS);
-       HTTP_LONG_CONSTANT("HTTP_SUPPORT_EVENTS", HTTP_SUPPORT_EVENTS);
-       
-       HTTP_LONG_CONSTANT("HTTP_PARAMS_ALLOW_COMMA", HTTP_PARAMS_ALLOW_COMMA);
-       HTTP_LONG_CONSTANT("HTTP_PARAMS_ALLOW_FAILURE", HTTP_PARAMS_ALLOW_FAILURE);
-       HTTP_LONG_CONSTANT("HTTP_PARAMS_RAISE_ERROR", HTTP_PARAMS_RAISE_ERROR);
-       HTTP_LONG_CONSTANT("HTTP_PARAMS_DEFAULT", HTTP_PARAMS_DEFAULT);
-       
-       return SUCCESS;
-}
-
-PHP_HTTP_API long _http_support(long feature)
-{
-       long support = HTTP_SUPPORT;
-       
-#ifdef HTTP_HAVE_CURL
-       support |= HTTP_SUPPORT_REQUESTS;
-#      ifdef HTTP_HAVE_SSL
-       support |= HTTP_SUPPORT_SSLREQUESTS;
-#      endif
-#      ifdef HTTP_HAVE_EVENT
-       support |= HTTP_SUPPORT_EVENTS;
-#      endif
-#endif
-#ifdef HTTP_HAVE_MAGIC
-       support |= HTTP_SUPPORT_MAGICMIME;
-#endif
-#ifdef HTTP_HAVE_ZLIB
-       support |= HTTP_SUPPORT_ENCODINGS;
-#endif
-
-       if (feature) {
-               return (feature == (support & feature));
-       }
-       return support;
-}
-
-/* char *pretty_key(char *, size_t, zend_bool, zend_bool) */
-char *_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen)
-{
-       size_t i;
-       int wasalpha;
-       
-       if (key && key_len) {
-               if ((wasalpha = HTTP_IS_CTYPE(alpha, key[0]))) {
-                       key[0] = (char) (uctitle ? HTTP_TO_CTYPE(upper, key[0]) : HTTP_TO_CTYPE(lower, key[0]));
-               }
-               for (i = 1; i < key_len; i++) {
-                       if (HTTP_IS_CTYPE(alpha, key[i])) {
-                               key[i] = (char) (((!wasalpha) && uctitle) ? HTTP_TO_CTYPE(upper, key[i]) : HTTP_TO_CTYPE(lower, key[i]));
-                               wasalpha = 1;
-                       } else {
-                               if (xhyphen && (key[i] == '_')) {
-                                       key[i] = '-';
-                               }
-                               wasalpha = 0;
-                       }
-               }
-       }
-       return key;
-}
-/* }}} */
-
-/* {{{ http_boundary(char *, size_t) */
-size_t _http_boundary(char *buf, size_t buf_len TSRMLS_DC)
-{
-       return snprintf(buf, buf_len, "%lu%0.9f", (ulong) HTTP_G->request.time, (float) php_combined_lcg(TSRMLS_C));
-}
-/* }}} */
-
-/* {{{ void http_error(long, long, char*) */
-void _http_error_ex(long type TSRMLS_DC, long code, const char *format, ...)
-{
-       va_list args;
-       
-       va_start(args, format);
-#ifdef ZEND_ENGINE_2
-       if ((type == E_THROW) || (GLOBAL_ERROR_HANDLING == EH_THROW)) {
-               char *message;
-               zend_class_entry *ce = http_exception_get_for_code(code);
-               
-               http_try {
-                       vspprintf(&message, 0, format, args);
-                       zend_throw_exception(ce, message, code TSRMLS_CC);
-                       efree(message);
-               } http_catch(GLOBAL_EXCEPTION_CLASS ? GLOBAL_EXCEPTION_CLASS : HTTP_EX_DEF_CE);
-       } else
-#endif
-       php_verror(NULL, "", type, format, args TSRMLS_CC);
-       va_end(args);
-}
-/* }}} */
-
-#ifdef ZEND_ENGINE_2
-static inline void copy_bt_args(zval *from, zval *to TSRMLS_DC)
-{
-       zval **args, **trace_0, *old_trace_0, *trace = NULL;
-       
-       if ((trace = zend_read_property(ZEND_EXCEPTION_GET_DEFAULT(), from, "trace", lenof("trace"), 0 TSRMLS_CC))) {
-               if (Z_TYPE_P(trace) == IS_ARRAY && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) {
-                       old_trace_0 = *trace_0;
-                       if (Z_TYPE_PP(trace_0) == IS_ARRAY && SUCCESS == zend_hash_find(Z_ARRVAL_PP(trace_0), "args", sizeof("args"), (void *) &args)) {
-                               if ((trace = zend_read_property(ZEND_EXCEPTION_GET_DEFAULT(), to, "trace", lenof("trace"), 0 TSRMLS_CC))) {
-                                       if (Z_TYPE_P(trace) == IS_ARRAY && SUCCESS == zend_hash_index_find(Z_ARRVAL_P(trace), 0, (void *) &trace_0)) {
-                                               ZVAL_ADDREF(*args);
-                                               add_assoc_zval(*trace_0, "args", *args);
-                                       }
-                               }
-                       }
-               }
-       }
-}
-
-/* {{{ zval *http_exception_wrap(zval *, zval *, zend_class_entry *) */
-zval *_http_exception_wrap(zval *old_exception, zval *new_exception, zend_class_entry *ce TSRMLS_DC)
-{
-       int inner = 1;
-       char *message;
-       zval *sub_exception, *tmp_exception;
-       
-       if (!new_exception) {
-               MAKE_STD_ZVAL(new_exception);
-               object_init_ex(new_exception, ce);
-               
-               zend_update_property(ce, new_exception, "innerException", lenof("innerException"), old_exception TSRMLS_CC);
-               copy_bt_args(old_exception, new_exception TSRMLS_CC);
-               
-               sub_exception = old_exception;
-               
-               while ((sub_exception = zend_read_property(Z_OBJCE_P(sub_exception), sub_exception, "innerException", lenof("innerException"), 0 TSRMLS_CC)) && Z_TYPE_P(sub_exception) == IS_OBJECT) {
-                       ++inner;
-               }
-               
-               spprintf(&message, 0, "Exception caused by %d inner exception(s)", inner);
-               zend_update_property_string(ZEND_EXCEPTION_GET_DEFAULT(), new_exception, "message", lenof("message"), message TSRMLS_CC);
-               efree(message);
-       } else {
-               sub_exception = new_exception;
-               tmp_exception = new_exception;
-               
-               while ((tmp_exception = zend_read_property(Z_OBJCE_P(tmp_exception), tmp_exception, "innerException", lenof("innerException"), 0 TSRMLS_CC)) && Z_TYPE_P(tmp_exception) == IS_OBJECT) {
-                       sub_exception = tmp_exception;
-               }
-               
-               zend_update_property(Z_OBJCE_P(sub_exception), sub_exception, "innerException", lenof("innerException"), old_exception TSRMLS_CC);
-               copy_bt_args(old_exception, new_exception TSRMLS_CC);
-               copy_bt_args(old_exception, sub_exception TSRMLS_CC);
-       }
-#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
-       Z_ADDREF_P(old_exception);
-       zend_exception_set_previous(new_exception, old_exception TSRMLS_CC);
-#endif
-       zval_ptr_dtor(&old_exception);
-       return new_exception;
-}
-/* }}} */
-
-/* {{{ STATUS http_object_new(zend_object_value *, const char *, uint, http_object_new_t, zend_class_entry *, void *, void **) */
-STATUS _http_object_new(zend_object_value *ov, const char *cname_str, uint cname_len, http_object_new_t create, zend_class_entry *parent_ce, void *intern_ptr, void **obj_ptr TSRMLS_DC)
-{
-       zend_class_entry *ce = parent_ce;
-       
-       if (cname_str && cname_len) {
-               if (!(ce = zend_fetch_class(HTTP_ZAPI_CONST_CAST(char *) cname_str, cname_len, ZEND_FETCH_CLASS_DEFAULT TSRMLS_CC))) {
-                       return FAILURE;
-               }
-               if (!instanceof_function(ce, parent_ce TSRMLS_CC)) {
-                       http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Class %s does not extend %s", cname_str, parent_ce->name);
-                       return FAILURE;
-               }
-       }
-       
-       *ov = create(ce, intern_ptr, obj_ptr TSRMLS_CC);
-       return SUCCESS;
-}
-/* }}} */
-#endif /* ZEND_ENGINE_2 */
-
-/* {{{ void http_log(char *, char *, char *) */
-void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC)
-{
-       time_t now;
-       struct tm nowtm;
-       char datetime[20] = {0};
-       
-       now = HTTP_G->request.time;
-       strftime(datetime, sizeof(datetime), "%Y-%m-%d %H:%M:%S", php_localtime_r(&now, &nowtm));
-
-#define HTTP_LOG_WRITE(file, type, msg) \
-       if (file && *file) { \
-               php_stream *log = php_stream_open_wrapper_ex(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL, HTTP_DEFAULT_STREAM_CONTEXT); \
-                \
-               if (log) { \
-                       php_stream_printf(log TSRMLS_CC, "%s\t[%s]\t%s\t<%s>%s", datetime, type, msg, SG(request_info).request_uri, PHP_EOL); \
-                       php_stream_close(log); \
-               } \
-        \
-       }
-       
-       HTTP_LOG_WRITE(file, ident, message);
-       HTTP_LOG_WRITE(HTTP_G->log.composite, ident, message);
-}
-/* }}} */
-
-static void http_ob_blackhole(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC)
-{
-       *handled_output = ecalloc(1,1);
-       *handled_output_len = 0;
-}
-
-/* {{{ STATUS http_exit(int, char*, char*) */
-STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header TSRMLS_DC)
-{
-       if (    (send_header && (SUCCESS != http_send_status_header(status, header))) ||
-                       (status && (SUCCESS != http_send_status(status)))) {
-               http_error_ex(HE_WARNING, HTTP_E_HEADER, "Failed to exit with status/header: %d - %s", status, STR_PTR(header));
-               STR_FREE(header);
-               STR_FREE(body);
-               return FAILURE;
-       }
-
-#ifndef PHP_OUTPUT_NEWAPI
-       if (!OG(ob_lock) &&
-               !php_ob_handler_used("zlib output compression" TSRMLS_CC) && !php_ob_handler_used("ob_gzhandler" TSRMLS_CC)) {
-               php_end_ob_buffers(0 TSRMLS_CC);
-       }
-#endif
-
-       if ((SUCCESS == sapi_send_headers(TSRMLS_C)) && body) {
-               PHPWRITE(body, strlen(body));
-       }
-       
-       switch (status) {
-               case 301:       http_log(HTTP_G->log.redirect, "301-REDIRECT", header);                 break;
-               case 302:       http_log(HTTP_G->log.redirect, "302-REDIRECT", header);                 break;
-               case 303:       http_log(HTTP_G->log.redirect, "303-REDIRECT", header);                 break;
-               case 305:       http_log(HTTP_G->log.redirect, "305-REDIRECT", header);                 break;
-               case 307:       http_log(HTTP_G->log.redirect, "307-REDIRECT", header);                 break;
-               case 304:       http_log(HTTP_G->log.cache, "304-CACHE", header);                               break;
-               case 404:       http_log(HTTP_G->log.not_found, "404-NOTFOUND", NULL);                  break;
-               case 405:       http_log(HTTP_G->log.allowed_methods, "405-ALLOWED", header);   break;
-               default:        http_log(NULL, header, body);                                                                   break;
-       }
-       
-       STR_FREE(header);
-       STR_FREE(body);
-       
-       if (HTTP_G->force_exit) {
-               zend_bailout();
-       } else {
-#ifdef PHP_OUTPUT_NEWAPI
-               php_output_start_devnull(TSRMLS_C);
-#else
-               php_ob_set_internal_handler(http_ob_blackhole, 4096, "blackhole", 0 TSRMLS_CC);
-#endif
-       }
-       
-       return SUCCESS;
-}
-/* }}} */
-
-/* {{{ STATUS http_check_method(char *) */
-STATUS _http_check_method_ex(const char *method, const char *methods)
-{
-       const char *found;
-
-       if (    (found = strstr(methods, method)) &&
-                       (found == method || !HTTP_IS_CTYPE(alpha, found[-1])) &&
-                       (strlen(found) >= strlen(method) && !HTTP_IS_CTYPE(alpha, found[strlen(method)]))) {
-               return SUCCESS;
-       }
-       return FAILURE;
-}
-/* }}} */
-
-/* {{{ zval *http_get_server_var_ex(char *, size_t) */
-PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_len, zend_bool check TSRMLS_DC)
-{
-       zval **hsv, **var;
-       char *env;
-       
-       /* if available, this is a lot faster than accessing $_SERVER */
-       if (sapi_module.getenv) {
-               if ((!(env = sapi_module.getenv((char *) key, key_len TSRMLS_CC))) || (check && !*env)) {
-                       return NULL;
-               }
-               if (HTTP_G->server_var) {
-                       zval_ptr_dtor(&HTTP_G->server_var);
-               }
-               MAKE_STD_ZVAL(HTTP_G->server_var);
-               ZVAL_STRING(HTTP_G->server_var, env, 1);
-               return HTTP_G->server_var;
-       }
-       
-#ifdef ZEND_ENGINE_2
-       zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC);
-#endif
-       
-       if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void *) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) {
-               return NULL;
-       }
-       if ((SUCCESS != zend_hash_find(Z_ARRVAL_PP(hsv), HTTP_ZAPI_CONST_CAST(char *) key, key_len + 1, (void *) &var))) {
-               return NULL;
-       }
-       if (check && !((Z_TYPE_PP(var) == IS_STRING) && Z_STRVAL_PP(var) && Z_STRLEN_PP(var))) {
-               return NULL;
-       }
-       return *var;
-}
-/* }}} */
-
-/* {{{ STATUS http_get_request_body(char **, size_t *) */
-PHP_HTTP_API STATUS _http_get_request_body_ex(char **body, size_t *length, zend_bool dup TSRMLS_DC)
-{
-       *length = 0;
-       *body = NULL;
-       
-       if (SG(request_info).raw_post_data) {
-               *length = SG(request_info).raw_post_data_length;
-               *body = SG(request_info).raw_post_data;
-               
-               if (dup) {
-                       *body = estrndup(*body, *length);
-               }
-               return SUCCESS;
-       } else if (sapi_module.read_post && !HTTP_G->read_post_data) {
-               char *buf = emalloc(4096);
-               int len;
-               
-               HTTP_G->read_post_data = 1;
-               
-               while (0 < (len = sapi_module.read_post(buf, 4096 TSRMLS_CC))) {
-                       SG(read_post_bytes) += len;
-                       *body = erealloc(*body, *length + len + 1);
-                       memcpy(*body + *length, buf, len);
-                       *length += len;
-                       (*body)[*length] = '\0';
-                       if (len < 4096) {
-                               break;
-                       }
-               }
-               efree(buf);
-               
-               /* check for error */
-               if (len < 0) {
-                       STR_FREE(*body);
-                       *length = 0;
-                       return FAILURE;
-               }
-               
-               SG(request_info).raw_post_data = *body;
-               SG(request_info).raw_post_data_length = *length;
-               
-               if (dup) {
-                       *body = estrndup(*body, *length);
-               }
-               return SUCCESS;
-       }
-       
-       return FAILURE;
-}
-/* }}} */
-
-/* {{{ php_stream *http_get_request_body_stream(void) */
-PHP_HTTP_API php_stream *_http_get_request_body_stream(TSRMLS_D)
-{
-       php_stream *s = NULL;
-       
-       if (SG(request_info).raw_post_data) {
-               s = php_stream_open_wrapper("php://input", "rb", 0, NULL);
-       } else if (sapi_module.read_post && !HTTP_G->read_post_data) {
-               HTTP_G->read_post_data = 1;
-               
-               if ((s = php_stream_temp_new())) {
-                       char *buf = emalloc(4096);
-                       int len;
-                       
-                       while (0 < (len = sapi_module.read_post(buf, 4096 TSRMLS_CC))) {
-                               SG(read_post_bytes) += len;
-                               php_stream_write(s, buf, len);
-                               if (len < 4096) {
-                                       break;
-                               }
-                       }
-                       efree(buf);
-                       
-                       if (len < 0) {
-                               php_stream_close(s);
-                               s = NULL;
-                       } else {
-                               php_stream_rewind(s);
-                       }
-               }
-       }
-       
-       return s;
-}
-/* }}} */
-
-/* {{{ void http_parse_params_default_callback(...) */
-PHP_HTTP_API void _http_parse_params_default_callback(void *arg, const char *key, int keylen, const char *val, int vallen TSRMLS_DC)
-{
-       char *kdup;
-       zval tmp, *entry;
-       HashTable *ht = (HashTable *) arg;
-       
-       if (ht) {
-               INIT_ZARR(tmp, ht);
-               
-               if (vallen) {
-                       MAKE_STD_ZVAL(entry);
-                       array_init(entry);
-                       if (keylen) {
-                               kdup = estrndup(key, keylen);
-                               add_assoc_stringl_ex(entry, kdup, keylen + 1, (char *) val, vallen, 1);
-                               efree(kdup);
-                       } else {
-                               add_next_index_stringl(entry, (char *) val, vallen, 1);
-                       }
-                       add_next_index_zval(&tmp, entry);
-               } else {
-                       add_next_index_stringl(&tmp, (char *) key, keylen, 1);
-               }
-       }
-}
-/* }}} */
-
-/* {{{ STATUS http_parse_params(const char *, HashTable *) */
-PHP_HTTP_API STATUS _http_parse_params_ex(const char *param, int flags, http_parse_params_callback cb, void *cb_arg TSRMLS_DC)
-{
-#define ST_QUOTE       1
-#define ST_VALUE       2
-#define ST_KEY         3
-#define ST_ASSIGN      4
-#define ST_ADD         5
-       
-       int st = ST_KEY, keylen = 0, vallen = 0;
-       char *s, *c, *key = NULL, *val = NULL;
-       
-       for(c = s = estrdup(param);;) {
-       continued:
-#if 0
-       {
-               char *tk = NULL, *tv = NULL;
-               
-               if (key) {
-                       if (keylen) {
-                               tk= estrndup(key, keylen);
-                       } else {
-                               tk = ecalloc(1, 7);
-                               memcpy(tk, key, 3);
-                               tk[3]='.'; tk[4]='.'; tk[5]='.';
-                       }
-               }
-               if (val) {
-                       if (vallen) {
-                               tv = estrndup(val, vallen);
-                       } else {
-                               tv = ecalloc(1, 7);
-                               memcpy(tv, val, 3);
-                               tv[3]='.'; tv[4]='.'; tv[5]='.';
-                       }
-               }
-               fprintf(stderr, "[%6s] %c \"%s=%s\"\n",
-                               (
-                                               st == ST_QUOTE ? "QUOTE" :
-                                               st == ST_VALUE ? "VALUE" :
-                                               st == ST_KEY ? "KEY" :
-                                               st == ST_ASSIGN ? "ASSIGN" :
-                                               st == ST_ADD ? "ADD":
-                                               "HUH?"
-                               ), *c?*c:'0', tk, tv
-               );
-               STR_FREE(tk); STR_FREE(tv);
-       }
-#endif
-               switch (st) {
-                       case ST_QUOTE:
-                       quote:
-                               if (*c == '"') {
-                                       if (*(c-1) == '\\') {
-                                               memmove(c-1, c, strlen(c)+1);
-                                               goto quote;
-                                       } else {
-                                               goto add;
-                                       }
-                               } else {
-                                       if (!val) {
-                                               val = c;
-                                       }
-                                       if (!*c) {
-                                               --val;
-                                               st = ST_ADD;
-                                       }
-                               }
-                               break;
-                               
-                       case ST_VALUE:
-                               switch (*c) {
-                                       case '"':
-                                               if (!val) {
-                                                       st = ST_QUOTE;
-                                               }
-                                               break;
-                                       
-                                       case ' ':
-                                               break;
-                                       
-                                       case ';':
-                                       case '\0':
-                                               goto add;
-                                               break;
-                                       case ',':
-                                               if (flags & HTTP_PARAMS_ALLOW_COMMA) {
-                                                       goto add;
-                                               }
-                                       default:
-                                               if (!val) {
-                                                       val = c;
-                                               }
-                                               break;
-                               }
-                               break;
-                               
-                       case ST_KEY:
-                               switch (*c) {
-                                       case ',':
-                                               if (flags & HTTP_PARAMS_ALLOW_COMMA) {
-                                                       goto allow_comma;
-                                               }
-                                       case '\r':
-                                       case '\n':
-                                       case '\t':
-                                       case '\013':
-                                       case '\014':
-                                               goto failure;
-                                               break;
-                                       
-                                       case ' ':
-                                               if (key) {
-                                                       keylen = c - key;
-                                                       st = ST_ASSIGN;
-                                               }
-                                               break;
-                                       
-                                       case ';':
-                                       case '\0':
-                                       allow_comma:
-                                               if (key) {
-                                                       keylen = c-- - key;
-                                                       st = ST_ADD;
-                                               }
-                                               break;
-                                       
-                                       case ':':
-                                               if (!(flags & HTTP_PARAMS_COLON_SEPARATOR)) {
-                                                       goto not_separator;
-                                               }
-                                               if (key) {
-                                                       keylen = c - key;
-                                                       st = ST_VALUE;
-                                               } else {
-                                                       goto failure;
-                                               }
-                                               break;
-                                               
-                                       case '=':
-                                               if (flags & HTTP_PARAMS_COLON_SEPARATOR) {
-                                                       goto not_separator;
-                                               }
-                                               if (key) {
-                                                       keylen = c - key;
-                                                       st = ST_VALUE;
-                                               } else {
-                                                       goto failure;
-                                               }
-                                               break;
-                                       
-                                       default:
-                                       not_separator:
-                                               if (!key) {
-                                                       key = c;
-                                               }
-                                               break;
-                               }
-                               break;
-                               
-                       case ST_ASSIGN:
-                               if (*c == '=') {
-                                       st = ST_VALUE;
-                               } else if (!*c || *c == ';' || ((flags & HTTP_PARAMS_ALLOW_COMMA) && *c == ',')) {
-                                       st = ST_ADD;
-                               } else if (*c != ' ') {
-                                       goto failure;
-                               }
-                               break;
-                               
-                       case ST_ADD:
-                       add:
-                               if (val) {
-                                       vallen = c - val;
-                                       if (st != ST_QUOTE) {
-                                               while (val[vallen-1] == ' ') --vallen;
-                                       }
-                               } else {
-                                       val = "";
-                                       vallen = 0;
-                               }
-                               
-                               cb(cb_arg, key, keylen, val, vallen TSRMLS_CC);
-                               
-                               st = ST_KEY;
-                               key = val = NULL;
-                               keylen = vallen = 0;
-                               break;
-               }
-               if (*c) {
-                       ++c;
-               } else if (st == ST_ADD) {
-                       goto add;
-               } else {
-                       break;
-               }
-       }
-       
-       efree(s);
-       return SUCCESS;
-       
-failure:
-       if (flags & HTTP_PARAMS_RAISE_ERROR) {
-               http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Unexpected character (%c) at pos %tu of %zu", *c, c-s, strlen(s));
-       }
-       if (flags & HTTP_PARAMS_ALLOW_FAILURE) {
-               if (st == ST_KEY) {
-                       if (key) {
-                               keylen = c - key;
-                       } else {
-                               key = c;
-                       }
-               } else {
-                       --c;
-               }
-               st = ST_ADD;
-               goto continued;
-       }
-       efree(s);
-       return FAILURE;
-}
-/* }}} */
-
-/* {{{ array_join */
-int apply_array_append_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
-{
-       int flags;
-       char *key = NULL;
-       HashTable *dst;
-       zval **data = NULL, **value = (zval **) pDest;
-       
-       dst = va_arg(args, HashTable *);
-       flags = va_arg(args, int);
-       
-       if ((!(flags & ARRAY_JOIN_STRONLY)) || hash_key->nKeyLength) {
-               if ((flags & ARRAY_JOIN_PRETTIFY) && hash_key->nKeyLength) {
-                       key = pretty_key(estrndup(hash_key->arKey, hash_key->nKeyLength - 1), hash_key->nKeyLength - 1, 1, 1);
-                       zend_hash_find(dst, key, hash_key->nKeyLength, (void *) &data);
-               } else {
-                       zend_hash_quick_find(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void *) &data);
-               }
-               
-               ZVAL_ADDREF(*value);
-               if (data) {
-                       add_next_index_zval(http_zset(IS_ARRAY, *data), *value);
-               } else if (key) {
-                       zend_hash_add(dst, key, hash_key->nKeyLength, value, sizeof(zval *), NULL);
-               } else {
-                       zend_hash_quick_add(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, value, sizeof(zval *), NULL);
-               }
-               
-               if (key) {
-                       efree(key);
-               }
-       }
-       
-       return ZEND_HASH_APPLY_KEEP;
-}
-
-int apply_array_merge_func(void *pDest HTTP_ZAPI_HASH_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
-{
-       int flags;
-       char *key = NULL;
-       HashTable *dst;
-       zval **value = (zval **) pDest;
-       
-       dst = va_arg(args, HashTable *);
-       flags = va_arg(args, int);
-       
-       if ((!(flags & ARRAY_JOIN_STRONLY)) || hash_key->nKeyLength) {
-               ZVAL_ADDREF(*value);
-               if ((flags & ARRAY_JOIN_PRETTIFY) && hash_key->nKeyLength) {
-                       key = pretty_key(estrndup(hash_key->arKey, hash_key->nKeyLength - 1), hash_key->nKeyLength - 1, 1, 1);
-                       zend_hash_update(dst, key, hash_key->nKeyLength, (void *) value, sizeof(zval *), NULL);
-                       efree(key);
-               } else {
-                       zend_hash_quick_update(dst, hash_key->arKey, hash_key->nKeyLength, hash_key->h, (void *) value, sizeof(zval *), NULL);
-               }
-       }
-       
-       return ZEND_HASH_APPLY_KEEP;
-}
-/* }}} */
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
-
diff --git a/http_cache_api.c b/http_cache_api.c
deleted file mode 100644 (file)
index b6bc237..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
-    +--------------------------------------------------------------------+
-    | PECL :: http                                                       |
-    +--------------------------------------------------------------------+
-    | Redistribution and use in source and binary forms, with or without |
-    | modification, are permitted provided that the conditions mentioned |
-    | in the accompanying LICENSE file are met.                          |
-    +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2010, Michael Wallner <mike@php.net>            |
-    +--------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#define HTTP_WANT_SAPI
-#include "php_http.h"
-
-#include "php_output.h"
-#include "php_streams.h"
-
-#include "php_http_api.h"
-#include "php_http_cache_api.h"
-#include "php_http_date_api.h"
-#include "php_http_send_api.h"
-
-/* {{{ char *http_etag(void *, size_t, http_send_mode) */
-PHP_HTTP_API char *_http_etag(const void *data_ptr, size_t data_len, http_send_mode data_mode TSRMLS_DC)
-{
-       void *ctx = http_etag_init();
-       
-       if (data_mode == SEND_DATA) {
-               http_etag_update(ctx, data_ptr, data_len);
-       } else {
-               STATUS ss = FAILURE;
-               php_stream_statbuf ssb;
-               
-               if (data_mode == SEND_RSRC) {
-                       ss = php_stream_stat((php_stream *) data_ptr, &ssb);
-               } else {
-                       ss = php_stream_stat_path((char *) data_ptr, &ssb);
-               }
-               
-               if (SUCCESS != ss) {
-                       efree(ctx);
-                       return NULL;
-               } else {
-                       size_t ssb_len;
-                       char ssb_buf[128];
-                       
-                       ssb_len = snprintf(ssb_buf, sizeof(ssb_buf), "%ld=%ld=%ld", (long) ssb.sb.st_mtime, 
-                                                                                                                       (long) ssb.sb.st_ino, 
-                                                                                                                       (long) ssb.sb.st_size);
-                       http_etag_update(ctx, ssb_buf, ssb_len);
-               }
-       }
-       
-       return http_etag_finish(ctx);
-}
-/* }}} */
-
-/* {{{ time_t http_last_modified(void *, http_send_mode) */
-PHP_HTTP_API time_t _http_last_modified(const void *data_ptr, http_send_mode data_mode TSRMLS_DC)
-{
-       php_stream_statbuf ssb;
-
-       switch (data_mode) {
-               case SEND_DATA: return HTTP_G->request.time;
-               case SEND_RSRC: return php_stream_stat((php_stream *) data_ptr, &ssb) ? 0 : ssb.sb.st_mtime;
-               default:                return php_stream_stat_path((char *) data_ptr, &ssb) ? 0 : ssb.sb.st_mtime;
-       }
-}
-/* }}} */
-
-/* {{{ zend_bool http_match_last_modified(char *, time_t) */
-PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t, zend_bool enforce_presence TSRMLS_DC)
-{
-       zend_bool retval;
-       zval *zmodified;
-       char *modified, *chr_ptr;
-
-       if (!(zmodified = http_get_server_var(entry, 1))) {
-               return !enforce_presence;
-       }
-
-       modified = estrndup(Z_STRVAL_P(zmodified), Z_STRLEN_P(zmodified));
-       if ((chr_ptr = strrchr(modified, ';'))) {
-               chr_ptr = 0;
-       }
-       
-       retval = (t <= http_parse_date_ex(modified, 1));
-       efree(modified);
-       return retval;
-}
-/* }}} */
-
-/* {{{ zend_bool http_match_etag(char *, char *) */
-PHP_HTTP_API zend_bool _http_match_etag_ex(const char *entry, const char *etag, zend_bool enforce_presence TSRMLS_DC)
-{
-       zval *zetag;
-       char *quoted_etag;
-       zend_bool result;
-
-       if (!(zetag = http_get_server_var_ex(entry, strlen(entry)+1, 1))) {
-               return !enforce_presence;
-       }
-
-       if (NULL != strchr(Z_STRVAL_P(zetag), '*')) {
-               return 1;
-       }
-
-       spprintf(&quoted_etag, 0, "\"%s\"", etag);
-       if (!strchr(Z_STRVAL_P(zetag), ',')) {
-               result = !strcmp(Z_STRVAL_P(zetag), quoted_etag);
-       } else {
-               result = (NULL != strstr(Z_STRVAL_P(zetag), quoted_etag));
-       }
-       efree(quoted_etag);
-       
-       return result;
-}
-/* }}} */
-
-/* {{{ STATUS http_cache_last_modified(time_t, time_t, char *, size_t) */
-PHP_HTTP_API STATUS _http_cache_last_modified(time_t last_modified,
-       time_t send_modified, const char *cache_control, size_t cc_len TSRMLS_DC)
-{
-       char *sent_header = NULL;
-       
-       if (SG(headers_sent)) {
-               return FAILURE;
-       }
-       
-       if (cc_len && (SUCCESS != http_send_cache_control(cache_control, cc_len))) {
-               return FAILURE;
-       }
-
-       if (SUCCESS != http_send_last_modified_ex(send_modified, &sent_header)) {
-               return FAILURE;
-       }
-
-       if (http_match_last_modified("HTTP_IF_MODIFIED_SINCE", last_modified)) {
-               http_exit_ex(304, sent_header, NULL, 0);
-       } else {
-               STR_FREE(sent_header);
-       }
-
-       return SUCCESS;
-}
-/* }}} */
-
-/* {{{ STATUS http_cache_etag(char *, size_t, char *, size_t) */
-PHP_HTTP_API STATUS _http_cache_etag(const char *etag, size_t etag_len,
-       const char *cache_control, size_t cc_len TSRMLS_DC)
-{
-       char *sent_header = NULL;
-       
-       if (SG(headers_sent)) {
-               return FAILURE;
-       }
-       
-       if (cc_len && (SUCCESS != http_send_cache_control(cache_control, cc_len))) {
-               return FAILURE;
-       }
-
-       if (etag_len) {
-               if (SUCCESS != http_send_etag_ex(etag, etag_len, &sent_header)) {
-                       return FAILURE;
-               }
-               if (http_match_etag("HTTP_IF_NONE_MATCH", etag)) {
-                       http_exit_ex(304, sent_header, NULL, 0);
-               } else {
-                       STR_FREE(sent_header);
-               }
-               return SUCCESS;
-       }
-       
-       /* start ob_etaghandler */
-       return http_start_ob_etaghandler();
-}
-/* }}} */
-
-PHP_HTTP_API STATUS _http_start_ob_etaghandler(TSRMLS_D)
-{
-       /* already running? */
-#ifdef PHP_OUTPUT_NEWAPI
-    STATUS rv;
-
-    if (php_output_handler_conflict(ZEND_STRL("ob_etaghandler"), ZEND_STRL("ob_etaghandler") TSRMLS_CC)) {
-        return FAILURE;
-    }
-#else
-       if (php_ob_handler_used("ob_etaghandler" TSRMLS_CC)) {
-               http_error(HE_WARNING, HTTP_E_RUNTIME, "ob_etaghandler can only be used once");
-               return FAILURE;
-       }
-#endif
-       HTTP_G->etag.started = 1;
-#ifdef PHP_OUTPUT_NEWAPI
-    return php_output_start_internal(ZEND_STRL("ob_etaghandler"), _http_ob_etaghandler, HTTP_G->send.buffer_size, 0 TSRMLS_CC);
-#else
-       return php_start_ob_buffer_named("ob_etaghandler", HTTP_G->send.buffer_size, 0 TSRMLS_CC);
-#endif
-}
-
-PHP_HTTP_API zend_bool _http_interrupt_ob_etaghandler(TSRMLS_D)
-{
-       if (HTTP_G->etag.started) {
-               HTTP_G->etag.started = 0;
-               if (HTTP_G->etag.ctx) {
-                       efree(HTTP_G->etag.ctx);
-                       HTTP_G->etag.ctx = NULL;
-               }
-               return 1;
-       }
-       return 0;
-}
-
-/* {{{ void http_ob_etaghandler(char *, uint, char **, uint *, int) */
-void _http_ob_etaghandler(char *output, uint output_len,
-       char **handled_output, uint *handled_output_len, int mode TSRMLS_DC)
-{
-       /* passthru */
-       *handled_output_len = output_len;
-       *handled_output = estrndup(output, output_len);
-       
-       /* are we supposed to run? */
-       if (HTTP_G->etag.started) {
-               /* initialize the etag context */
-               if (mode & PHP_OUTPUT_HANDLER_START) {
-                       HTTP_G->etag.ctx = http_etag_init();
-               }
-               
- &nbs