HttpResponse class is only available for PHP >= 5.1
Not all places where files are handled check for open_basedir and/or safe_mode.
+
+
+Internals:
+ - the request bodies created in http_request_pool_attach() are not
+ destroyed in http_request_pool_detach(); may be a memory problem
+ in long running scripts
\ No newline at end of file
phpincludedir=$(prefix)/include/php
-HTTP_HEADER_FILES= \
- phpstr/phpstr.h \
- php_http_cache_api.h \
- php_http_headers_api.h \
- php_http_response_object.h \
- php_http_util_object.h \
- php_http.h \
- php_http_request_api.h \
- php_http_message_api.h \
- php_http_send_api.h \
- php_http_api.h \
- php_http_date_api.h \
- php_http_message_object.h \
- php_http_std_defs.h \
- php_http_exception_object.h \
- php_http_request_object.h \
- php_http_requestpool_object.h \
- php_http_url_api.h
-
install-http-headers:
@echo "Installing HTTP headers: $(INSTALL_ROOT)$(phpincludedir)/ext/http/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(phpincludedir)/ext/http
PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, [$ext_shared])
PHP_ADD_BUILD_DIR($ext_builddir/phpstr, 1)
PHP_SUBST([HTTP_SHARED_LIBADD])
- PHP_ADD_MAKEFILE_FRAGMENT
- AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support])
-dnl ---
-dnl odd warnings
-dnl ---
-dnl CFLAGS=" -g -O2 -W -Wchar-subscripts -Wformat=2 -Wno-format-y2k -Wimplicit -Wmissing-braces -Wunused-variable -Wbad-function-cast -Wpointer-arith -Wsign-compare -Winline"
-dnl PHP_SUBST([CFLAGS])
+ HTTP_HEADER_FILES= \
+ phpstr/phpstr.h \
+ 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_SUBST([HTTP_HEADER_FILES])
+
+ ifdef([PHP_INSTALL_HEADERS],
+ [
+ PHP_INSTALL_HEADERS(ext/http, [HTTP_HEADER_FILES])
+ ], [
+ PHP_ADD_MAKEFILE_FRAGMENT
+ ])
+ AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support])
fi
#endif
/* {{{ http_functions[] */
-function_entry http_functions[] = {
+zend_function_entry http_functions[] = {
PHP_FE(http_test, NULL)
PHP_FE(http_date, NULL)
PHP_FE(http_absolute_uri, NULL)
PHP_FE(http_build_query, NULL)
#endif
PHP_FE(ob_etaghandler, NULL)
- {NULL, NULL, NULL}
+
+ EMPTY_FUNCTION_ENTRY
};
/* }}} */
zval array;
Z_ARRVAL(array) = headers;
- header_len = body ? body - header : strlen(header) + 1;
+ if (body) {
+ header_len = body - header;
+ } else {
+ header_len = strlen(header) + 1;
+ }
line = header;
while (header_len >= (size_t) (line - begin)) {
ZEND_MALIAS(HttpMessage, __toString, toString, HTTP_ARGS(HttpMessage, toString), ZEND_ACC_PUBLIC)
HTTP_MESSAGE_ME(fromString, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
- {NULL, NULL, NULL}
+
+ EMPTY_FUNCTION_ENTRY
};
static zend_object_handlers http_message_object_handlers;
HTTP_REQUEST_ALIAS(methodName, http_request_method_name)
HTTP_REQUEST_ALIAS(methodExists, http_request_method_exists)
- {NULL, NULL, NULL}
+ EMPTY_FUNCTION_ENTRY
};
static zend_object_handlers http_request_object_handlers;
*/
PHP_METHOD(HttpRequest, send)
{
- STATUS status = FAILURE;
http_request_body body = {0, NULL, 0};
getObject(http_request_object, obj);
HTTP_REQPOOL_ME(next, ZEND_ACC_PUBLIC)
HTTP_REQPOOL_ME(rewind, ZEND_ACC_PUBLIC)
- {NULL, NULL, NULL}
+ EMPTY_FUNCTION_ENTRY
};
static zend_object_handlers http_requestpool_object_handlers;
HTTP_RESPONSE_ALIAS(getRequestHeaders, http_get_request_headers)
HTTP_RESPONSE_ALIAS(getRequestBody, http_get_request_body)
- {NULL, NULL, NULL}
+ EMPTY_FUNCTION_ENTRY
};
void _http_response_object_init(INIT_FUNC_ARGS)
HTTP_UTIL_ALIAS(chunkedDecode, http_chunked_decode)
HTTP_UTIL_ALIAS(parseMessage, http_parse_message)
HTTP_UTIL_ALIAS(parseHeaders, http_parse_headers)
- {NULL, NULL, NULL}
+
+ EMPTY_FUNCTION_ENTRY
};
void _http_util_object_init(INIT_FUNC_ARGS)
PHP_METHOD(HttpRequest, methodName);
PHP_METHOD(HttpRequest, methodExists);
-PHP_METHOD(HttpRequest, debugWrapper);
-
#endif
#endif
#endif
# define HTTP_ARG_OBJ(class, name, allow_null) ZEND_ARG_OBJ_INFO(1, name, class, allow_null)
#endif
+#ifdef ZEND_ENGINE_2
+# define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL, 0}
+#else
+# define EMPTY_FUNCTION_ENTRY {NULL, NULL, NULL}
+#endif
+
#ifdef HTTP_HAVE_CURL
# ifdef ZEND_ENGINE_2
# define HTTP_DECLARE_ARG_PASS_INFO() \