From 24d2d35cd00eca44a97a6b11340c2790421216fa Mon Sep 17 00:00:00 2001
From: Michael Wallner
Date: Sat, 22 Apr 2006 21:04:37 +0000
Subject: [PATCH] - split off query strin API and use it in http_build_url()
with HTTP_URL_JOIN_QUERY
---
config.m4 | 5 +-
config.w32 | 2 +-
docs/functions.html | 10 +-
http.dsp | 8 ++
http_functions.c | 2 +-
http_querystring_api.c | 204 +++++++++++++++++++++++++++++++++++++
http_querystring_object.c | 174 +------------------------------
http_url_api.c | 20 +++-
package2.xml | 1 +
php_http_querystring_api.h | 44 ++++++++
tests/build_url_004.phpt | 4 +-
11 files changed, 290 insertions(+), 184 deletions(-)
create mode 100644 http_querystring_api.c
create mode 100644 php_http_querystring_api.h
diff --git a/config.m4 b/config.m4
index 6450d56..555bbc7 100644
--- a/config.m4
+++ b/config.m4
@@ -232,7 +232,8 @@ dnl ----
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_deflatestream_object.c http_inflatestream_object.c http_cookie_api.c \
+ http_querystring_api.c"
PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, $ext_shared)
PHP_ADD_BUILD_DIR($ext_builddir/phpstr, 1)
PHP_SUBST([HTTP_SHARED_LIBADD])
@@ -244,7 +245,7 @@ dnl ----
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_cookie_api.h php_http_querystring_api.h"
ifdef([PHP_INSTALL_HEADERS], [
PHP_INSTALL_HEADERS(ext/http, $PHP_HTTP_HEADERS)
], [
diff --git a/config.w32 b/config.w32
index e0a8af8..c82eca4 100644
--- a/config.w32
+++ b/config.w32
@@ -56,7 +56,7 @@ if (PHP_HTTP != "no") {
"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_cookie_api.c http_querystring_api.c",
null,
"/I\"" + configure_module_dirname + "/phpstr\"");
ADD_SOURCES(configure_module_dirname + "/phpstr", "phpstr.c", "http");
diff --git a/docs/functions.html b/docs/functions.html
index e0d1e1c..7139f2a 100644
--- a/docs/functions.html
+++ b/docs/functions.html
@@ -74,7 +74,7 @@
looking like: "Wed, 22 Dec 2004 11:34:47 GMT"
Accepts an optional unix timestamp as parameter.
Returns the HTTP date as string.
-string http_build_url(mixed url[, mixed parts[, int flags = HTTP_URL_REPLACE[, array &new_url]]])
+string http_build_url([mixed url[, mixed parts[, int flags = HTTP_URL_REPLACE[, array &new_url]]]])
Build an URL.
Expexts (part(s) of) an URL as first parameter in form of a string or assoziative array
like parse_url() returns. Accepts an optional second parameter in the same way as the
@@ -84,7 +84,7 @@ with the results as associative array like parse_url() would return.
The parts of the second URL will be merged into the first according to the flags argument.
The following flags are recognized:
- HTTP_URL_REPLACE: (default) set parts of the second url will replace the parts in the first
- HTTP_URL_JOIN_PATH: the path of the second url will be merged into the one of the first
- - HTTP_URL_JOIN_QUERY: the two querystrings will be merged naivly; no replacements are done
+ - HTTP_URL_JOIN_QUERY: the two querystrings will be merged recursively
- HTTP_URL_STRIP_USER: the user part will not appear in the result
- HTTP_URL_STRIP_PASS: the password part will not appear in the result
- HTTP_URL_STRIP_AUTH: neither the user nor the password part will appear in the result
@@ -476,6 +476,9 @@ all supported features.
http_inflatestream_object.c
HttpInflateStream
+void HttpInflateStream::__construct([int flags = 0])
+Creates a new HttpInflateStream object instance.
+Accepts an optional int parameter specifying how to initialize the inflate stream.
string HttpInflateStream::update(string data)
Passes more data through the inflate stream.
Expects a string parameter containing (a part of) the data to inflate.
@@ -1245,6 +1248,7 @@ http.cache_log is set.
http_inflatestream_object.c
- Generated at: Thu, 13 Apr 2006 17:25:58 +0200
+ Generated at: Sat, 22 Apr 2006 23:03:59 +0200