From: Michael Wallner Date: Thu, 21 Jul 2005 09:33:10 +0000 (+0000) Subject: - fix refelction info X-Git-Tag: RELEASE_0_10_0~33 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=402ada5cf64b817dd4c4cfd4c112b59b1139dff5;p=m6w6%2Fext-http - fix refelction info --- diff --git a/http_message_object.c b/http_message_object.c index 99bc276..08f37f4 100644 --- a/http_message_object.c +++ b/http_message_object.c @@ -31,57 +31,57 @@ #include "phpstr/phpstr.h" -#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpMessage, method, ZEND_RETURN_REFERENCE_AGNOSTIC, req_args) -#define HTTP_EMPTY_ARGS(method, ret_ref) HTTP_EMPTY_ARGS_EX(HttpMessage, method, ret_ref) -#define HTTP_MESSAGE_ME(method, visibility) PHP_ME(HttpMessage, method, HTTP_ARGS(HttpMessage, method), visibility) +#define HTTP_BEGIN_ARGS(method, ret_ref, req_args) HTTP_BEGIN_ARGS_EX(HttpMessage, method, ret_ref, req_args) +#define HTTP_EMPTY_ARGS(method, ret_ref) HTTP_EMPTY_ARGS_EX(HttpMessage, method, ret_ref) +#define HTTP_MESSAGE_ME(method, visibility) PHP_ME(HttpMessage, method, HTTP_ARGS(HttpMessage, method), visibility) -HTTP_BEGIN_ARGS(__construct, 0) +HTTP_BEGIN_ARGS(__construct, 0, 0) HTTP_ARG_VAL(message, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(fromString, 1) +HTTP_BEGIN_ARGS(fromString, 1, 1) HTTP_ARG_VAL(message, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getBody, 0); HTTP_EMPTY_ARGS(getHeaders, 0); -HTTP_BEGIN_ARGS(setHeaders, 1) +HTTP_BEGIN_ARGS(setHeaders, 0, 1) HTTP_ARG_VAL(headers, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(addHeaders, 1) +HTTP_BEGIN_ARGS(addHeaders, 0, 1) HTTP_ARG_VAL(headers, 0) HTTP_ARG_VAL(append, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getType, 0); -HTTP_BEGIN_ARGS(setType, 1) +HTTP_BEGIN_ARGS(setType, 0, 1) HTTP_ARG_VAL(type, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getResponseCode, 0); -HTTP_BEGIN_ARGS(setResponseCode, 1) +HTTP_BEGIN_ARGS(setResponseCode, 0, 1) HTTP_ARG_VAL(response_code, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getRequestMethod, 0); -HTTP_BEGIN_ARGS(setRequestMethod, 1) +HTTP_BEGIN_ARGS(setRequestMethod, 0, 1) HTTP_ARG_VAL(request_method, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getRequestUri, 0); -HTTP_BEGIN_ARGS(setRequestUri, 1) +HTTP_BEGIN_ARGS(setRequestUri, 0, 1) HTTP_ARG_VAL(uri, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getHttpVersion, 0); -HTTP_BEGIN_ARGS(setHttpVersion, 1) +HTTP_BEGIN_ARGS(setHttpVersion, 0, 1) HTTP_ARG_VAL(http_version, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getParentMessage, 1); HTTP_EMPTY_ARGS(send, 0); -HTTP_BEGIN_ARGS(toString, 0) +HTTP_BEGIN_ARGS(toString, 0, 0) HTTP_ARG_VAL(include_parent, 0) HTTP_END_ARGS; diff --git a/http_request_object.c b/http_request_object.c index 94de28a..c324240 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -38,82 +38,82 @@ #endif #include -#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpRequest, method, ZEND_RETURN_REFERENCE_AGNOSTIC, req_args) -#define HTTP_EMPTY_ARGS(method, ret_ref) HTTP_EMPTY_ARGS_EX(HttpRequest, method, ret_ref) -#define HTTP_REQUEST_ME(method, visibility) PHP_ME(HttpRequest, method, HTTP_ARGS(HttpRequest, method), visibility) +#define HTTP_BEGIN_ARGS(method, ret_ref, req_args) HTTP_BEGIN_ARGS_EX(HttpRequest, method, ret_ref, req_args) +#define HTTP_EMPTY_ARGS(method, ret_ref) HTTP_EMPTY_ARGS_EX(HttpRequest, method, ret_ref) +#define HTTP_REQUEST_ME(method, visibility) PHP_ME(HttpRequest, method, HTTP_ARGS(HttpRequest, method), visibility) HTTP_EMPTY_ARGS(__destruct, 0); -HTTP_BEGIN_ARGS(__construct, 0) +HTTP_BEGIN_ARGS(__construct, 0, 0) HTTP_ARG_VAL(url, 0) HTTP_ARG_VAL(method, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getOptions, 0); HTTP_EMPTY_ARGS(unsetOptions, 0); -HTTP_BEGIN_ARGS(setOptions, 1) +HTTP_BEGIN_ARGS(setOptions, 0, 1) HTTP_ARG_VAL(options, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getSslOptions, 0); HTTP_EMPTY_ARGS(unsetSslOptions, 0); -HTTP_BEGIN_ARGS(setSslOptions, 1) +HTTP_BEGIN_ARGS(setSslOptions, 0, 1) HTTP_ARG_VAL(ssl_options, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getHeaders, 0); HTTP_EMPTY_ARGS(unsetHeaders, 0); -HTTP_BEGIN_ARGS(addHeaders, 1) +HTTP_BEGIN_ARGS(addHeaders, 0, 1) HTTP_ARG_VAL(headers, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getCookies, 0); HTTP_EMPTY_ARGS(unsetCookies, 0); -HTTP_BEGIN_ARGS(addCookies, 1) +HTTP_BEGIN_ARGS(addCookies, 0, 1) HTTP_ARG_VAL(cookies, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getUrl, 0); -HTTP_BEGIN_ARGS(setUrl, 1) +HTTP_BEGIN_ARGS(setUrl, 0, 1) HTTP_ARG_VAL(url, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getMethod, 0); -HTTP_BEGIN_ARGS(setMethod, 1) +HTTP_BEGIN_ARGS(setMethod, 0, 1) HTTP_ARG_VAL(request_method, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getContentType, 0); -HTTP_BEGIN_ARGS(setContentType, 1) +HTTP_BEGIN_ARGS(setContentType, 0, 1) HTTP_ARG_VAL(content_type, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getQueryData, 0); HTTP_EMPTY_ARGS(unsetQueryData, 0); -HTTP_BEGIN_ARGS(setQueryData, 1) +HTTP_BEGIN_ARGS(setQueryData, 0, 1) HTTP_ARG_VAL(query_data, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(addQueryData, 1) +HTTP_BEGIN_ARGS(addQueryData, 0, 1) HTTP_ARG_VAL(query_data, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getPostFields, 0); HTTP_EMPTY_ARGS(unsetPostFields, 0); -HTTP_BEGIN_ARGS(setPostFields, 1) +HTTP_BEGIN_ARGS(setPostFields, 0, 1) HTTP_ARG_VAL(post_fields, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(addPostFields, 1) +HTTP_BEGIN_ARGS(addPostFields, 0, 1) HTTP_ARG_VAL(post_fields, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getPostFiles, 0); HTTP_EMPTY_ARGS(unsetPostFiles, 0); -HTTP_BEGIN_ARGS(setPostFiles, 1) +HTTP_BEGIN_ARGS(setPostFiles, 0, 1) HTTP_ARG_VAL(post_files, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(addPostFile, 2) +HTTP_BEGIN_ARGS(addPostFile, 0, 2) HTTP_ARG_VAL(formname, 0) HTTP_ARG_VAL(filename, 0) HTTP_ARG_VAL(content_type, 0) @@ -121,22 +121,22 @@ HTTP_END_ARGS; HTTP_EMPTY_ARGS(getPutFile, 0); HTTP_EMPTY_ARGS(unsetPutFile, 0); -HTTP_BEGIN_ARGS(setPutFile, 1) +HTTP_BEGIN_ARGS(setPutFile, 0, 1) HTTP_ARG_VAL(filename, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getResponseData, 0); -HTTP_BEGIN_ARGS(getResponseHeader, 0) +HTTP_BEGIN_ARGS(getResponseHeader, 0, 0) HTTP_ARG_VAL(name, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(getResponseCookie, 0) +HTTP_BEGIN_ARGS(getResponseCookie, 0, 0) HTTP_ARG_VAL(name, 0) HTTP_END_ARGS; HTTP_EMPTY_ARGS(getResponseBody, 0); HTTP_EMPTY_ARGS(getResponseCode, 0); -HTTP_BEGIN_ARGS(getResponseInfo, 0) +HTTP_BEGIN_ARGS(getResponseInfo, 0, 0) HTTP_ARG_VAL(name, 0) HTTP_END_ARGS; diff --git a/http_requestpool_object.c b/http_requestpool_object.c index af2dcf7..28aa366 100644 --- a/http_requestpool_object.c +++ b/http_requestpool_object.c @@ -34,9 +34,9 @@ #endif #include -#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpRequestPool, method, ZEND_RETURN_REFERENCE_AGNOSTIC, req_args) -#define HTTP_EMPTY_ARGS(method, ret_ref) HTTP_EMPTY_ARGS_EX(HttpRequestPool, method, ret_ref) -#define HTTP_REQPOOL_ME(method, visibility) PHP_ME(HttpRequestPool, method, HTTP_ARGS(HttpRequestPool, method), visibility) +#define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpRequestPool, method, 0, req_args) +#define HTTP_EMPTY_ARGS(method, ret_ref) HTTP_EMPTY_ARGS_EX(HttpRequestPool, method, ret_ref) +#define HTTP_REQPOOL_ME(method, visibility) PHP_ME(HttpRequestPool, method, HTTP_ARGS(HttpRequestPool, method), visibility) HTTP_BEGIN_ARGS_AR(HttpRequestPool, __construct, 0, 0) HTTP_ARG_OBJ(HttpRequest, request0, 0) diff --git a/http_response_object.c b/http_response_object.c index bb2f0ce..add22bf 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -160,11 +160,11 @@ static inline void _http_response_object_declare_default_properties(TSRMLS_D) { zend_class_entry *ce = http_response_object_ce; - DCL_STATIC_PROP(PRIVATE, long, sent, 0); + DCL_STATIC_PROP(PRIVATE, bool, sent, 0); + DCL_STATIC_PROP(PRIVATE, bool, catch, 0); DCL_STATIC_PROP(PRIVATE, long, mode, -1); - DCL_STATIC_PROP(PRIVATE, long, catch, 0); - DCL_STATIC_PROP(PROTECTED, long, cache, 0); - DCL_STATIC_PROP(PROTECTED, long, gzip, 0); + DCL_STATIC_PROP(PROTECTED, bool, cache, 0); + DCL_STATIC_PROP(PROTECTED, bool, gzip, 0); DCL_STATIC_PROP(PROTECTED, long, stream, 0); DCL_STATIC_PROP(PROTECTED, string, file, ""); DCL_STATIC_PROP(PROTECTED, string, data, ""); @@ -249,7 +249,7 @@ PHP_METHOD(HttpResponse, getGzip) /* {{{ proto bool HttpResponse::setCacheControl(string control[, long max_age = 0]) * - * Set a custom cache-control header, usually being "private" or "public"; + * Set a custom cache-control header, usually being "private" or "public"; * The max_age parameter controls how long the cache entry is valid on the client side. */ PHP_METHOD(HttpResponse, setCacheControl) @@ -613,7 +613,7 @@ PHP_METHOD(HttpResponse, send) zval *cd = GET_STATIC_PROP(contentDisposition); if (Z_STRLEN_P(cd)) { char *cds; - + spprintf(&cds, 0, "Content-Disposition: %s", Z_STRVAL_P(cd)); http_send_header(cds); efree(cds);