X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_util_object.c;h=03429f44e167fc18858ac4ea7b71e626dd2ef678;hp=d4c544d92c3f485adbeefde6e839c78426849c31;hb=ef227f4f7f697c954eef0adb9f9f897148a771ca;hpb=402b8c161ea5d8e9862413a0282fb9757db9926e diff --git a/http_util_object.c b/http_util_object.c index d4c544d..03429f4 100644 --- a/http_util_object.c +++ b/http_util_object.c @@ -1,16 +1,13 @@ /* - +----------------------------------------------------------------------+ - | PECL :: http | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, that | - | is bundled with this package in the file LICENSE, and is available | - | through the world-wide-web at http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Copyright (c) 2004-2005 Michael Wallner | - +----------------------------------------------------------------------+ + +--------------------------------------------------------------------+ + | 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-2005, Michael Wallner | + +--------------------------------------------------------------------+ */ /* $Id$ */ @@ -19,12 +16,11 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include "php.h" + +#include "php_http.h" #ifdef ZEND_ENGINE_2 -#include "php_http.h" -#include "php_http_std_defs.h" #include "php_http_util_object.h" #define HTTP_BEGIN_ARGS(method, req_args) HTTP_BEGIN_ARGS_EX(HttpUtil, method, 0, req_args) @@ -36,7 +32,7 @@ HTTP_BEGIN_ARGS(date, 0) HTTP_ARG_VAL(timestamp, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(absoluteUri, 1) +HTTP_BEGIN_ARGS(buildUri, 1) HTTP_ARG_VAL(url, 0) HTTP_ARG_VAL(proto, 0) HTTP_ARG_VAL(host, 0) @@ -45,12 +41,17 @@ HTTP_END_ARGS; HTTP_BEGIN_ARGS(negotiateLanguage, 1) HTTP_ARG_VAL(supported, 0) - HTTP_ARG_VAL(default, 0) + HTTP_ARG_VAL(result, 1) HTTP_END_ARGS; HTTP_BEGIN_ARGS(negotiateCharset, 1) HTTP_ARG_VAL(supported, 0) - HTTP_ARG_VAL(default, 0) + HTTP_ARG_VAL(result, 1) +HTTP_END_ARGS; + +HTTP_BEGIN_ARGS(negotiateContentType, 1) + HTTP_ARG_VAL(supported, 0) + HTTP_ARG_VAL(result, 1) HTTP_END_ARGS; HTTP_BEGIN_ARGS(matchModified, 1) @@ -69,49 +70,75 @@ HTTP_BEGIN_ARGS(matchRequestHeader, 2) HTTP_ARG_VAL(case_sensitive, 0) HTTP_END_ARGS; +HTTP_BEGIN_ARGS(parseMessage, 1) + HTTP_ARG_VAL(message_string, 0) +HTTP_END_ARGS; + +HTTP_BEGIN_ARGS(parseHeaders, 1) + HTTP_ARG_VAL(headers_string, 0) +HTTP_END_ARGS; + +HTTP_BEGIN_ARGS(parseCookie, 1) + HTTP_ARG_VAL(cookie_string, 0) +HTTP_END_ARGS; + HTTP_BEGIN_ARGS(chunkedDecode, 1) HTTP_ARG_VAL(encoded_string, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(splitResponse, 1) - HTTP_ARG_VAL(response_string, 0) +HTTP_BEGIN_ARGS(gzEncode, 1) + HTTP_ARG_VAL(plain, 0) + HTTP_ARG_VAL(level, 0) + HTTP_ARG_VAL(mtime, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(parseHeaders, 1) - HTTP_ARG_VAL(headers_string, 0) +HTTP_BEGIN_ARGS(gzDecode, 1) + HTTP_ARG_VAL(encoded, 0) +HTTP_END_ARGS; + +HTTP_BEGIN_ARGS(deflate, 1) + HTTP_ARG_VAL(plain, 0) + HTTP_ARG_VAL(level, 0) + HTTP_ARG_VAL(zlib_header, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(authBasic, 2) - HTTP_ARG_VAL(username, 0) - HTTP_ARG_VAL(password, 0) - HTTP_ARG_VAL(realm, 0) +HTTP_BEGIN_ARGS(inflate, 1) + HTTP_ARG_VAL(encoded, 0) HTTP_END_ARGS; -HTTP_BEGIN_ARGS(authBasicCallback, 1) - HTTP_ARG_VAL(callback, 0) - HTTP_ARG_VAL(realm, 0) +HTTP_BEGIN_ARGS(support, 0) + HTTP_ARG_VAL(feature, 0) HTTP_END_ARGS; zend_class_entry *http_util_object_ce; zend_function_entry http_util_object_fe[] = { HTTP_UTIL_ALIAS(date, http_date) - HTTP_UTIL_ALIAS(absoluteUri, http_absolute_uri) + HTTP_UTIL_ALIAS(buildUri, http_build_uri) HTTP_UTIL_ALIAS(negotiateLanguage, http_negotiate_language) HTTP_UTIL_ALIAS(negotiateCharset, http_negotiate_charset) + HTTP_UTIL_ALIAS(negotiateContentType, http_negotiate_content_type) HTTP_UTIL_ALIAS(matchModified, http_match_modified) HTTP_UTIL_ALIAS(matchEtag, http_match_etag) HTTP_UTIL_ALIAS(matchRequestHeader, http_match_request_header) - HTTP_UTIL_ALIAS(chunkedDecode, http_chunked_decode) - HTTP_UTIL_ALIAS(splitResponse, http_split_response) + HTTP_UTIL_ALIAS(parseMessage, http_parse_message) HTTP_UTIL_ALIAS(parseHeaders, http_parse_headers) - HTTP_UTIL_ALIAS(authBasic, http_auth_basic) - HTTP_UTIL_ALIAS(authBasicCallback, http_auth_basic_cb) - {NULL, NULL, NULL} + HTTP_UTIL_ALIAS(parseCookie, http_parse_cookie) + HTTP_UTIL_ALIAS(chunkedDecode, http_chunked_decode) +#ifdef HTTP_HAVE_ZLIB + HTTP_UTIL_ALIAS(gzEncode, http_gzencode) + HTTP_UTIL_ALIAS(gzDecode, http_gzdecode) + HTTP_UTIL_ALIAS(deflate, http_deflate) + HTTP_UTIL_ALIAS(inflate, http_inflate) +#endif /* HTTP_HAVE_ZLIB */ + HTTP_UTIL_ALIAS(support, http_support) + + EMPTY_FUNCTION_ENTRY }; -void _http_util_object_init(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(http_util_object) { HTTP_REGISTER_CLASS(HttpUtil, http_util_object, NULL, 0); + return SUCCESS; } #endif /* ZEND_ENGINE_2 */