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"
+ php_http_encoding_api.h phpstr/phpstr.h missing.h"
ifdef([PHP_INSTALL_HEADERS], [
PHP_INSTALL_HEADERS(ext/http, $PHP_HTTP_HEADERS)
/* $Id$ */
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
-#include "zend_extensions.h"
+#define HTTP_WANT_CURL
+#define HTTP_WANT_ZLIB
+#define HTTP_WANT_MAGIC
+#include "php_http.h"
#include "SAPI.h"
#include "php_ini.h"
#include "ext/standard/info.h"
+#include "zend_extensions.h"
-#include "php_http.h"
-#include "php_http_std_defs.h"
#include "php_http_api.h"
#include "php_http_send_api.h"
#include "php_http_cache_api.h"
#include "php_http_headers_api.h"
+#include "php_http_message_api.h"
#include "php_http_request_method_api.h"
#ifdef HTTP_HAVE_CURL
# include "php_http_request_api.h"
# include "php_http_exception_object.h"
#endif
-#include "missing.h"
-#include "phpstr/phpstr.h"
-
-#ifdef HTTP_HAVE_CURL
-# ifdef PHP_WIN32
-# include <winsock2.h>
-# endif
-# include <curl/curl.h>
-#endif
-#ifdef HTTP_HAVE_ZLIB
-# include <zlib.h>
-#endif
-
-#include <ctype.h>
ZEND_DECLARE_MODULE_GLOBALS(http);
HTTP_DECLARE_ARG_PASS_INFO();
static zend_module_dep http_module_dep[] = {
# ifdef HAVE_SPL
ZEND_MOD_REQUIRED("spl")
+# endif
+# ifdef HTTP_HAVE_EXT_HASH
+ ZEND_MOD_REQUIRED("hash")
# endif
{NULL, NULL, NULL, 0}
};
PHP_RINIT(http),
PHP_RSHUTDOWN(http),
PHP_MINFO(http),
- HTTP_PEXT_VERSION,
+ PHP_EXT_HTTP_VERSION,
STANDARD_MODULE_PROPERTIES
};
/* }}} */
php_info_print_table_start();
{
php_info_print_table_row(2, "Extended HTTP support", "enabled");
- php_info_print_table_row(2, "Extension Version", HTTP_PEXT_VERSION);
+ php_info_print_table_row(2, "Extension Version", PHP_EXT_HTTP_VERSION);
#ifdef HTTP_HAVE_CURL
php_info_print_table_row(2, "cURL HTTP Requests", curl_version());
#else
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+
+#include "php_http.h"
#include "SAPI.h"
+#include "php_output.h"
#include "ext/standard/url.h"
#include "ext/standard/head.h"
-#include "php_http.h"
-#include "php_http_std_defs.h"
#include "php_http_api.h"
-#include "php_http_headers_api.h"
-#include "php_http_request_api.h"
#include "php_http_send_api.h"
#ifdef ZEND_ENGINE_2
-# include "zend_exceptions.h"
# include "php_http_exception_object.h"
#endif
-#include <ctype.h>
-
-#ifdef HTTP_HAVE_MAGIC
-# if defined(PHP_WIN32) && !defined(USE_MAGIC_DLL) && !defined(USE_MAGIC_STATIC)
-# define USE_MAGIC_STATIC
-# endif
-# include <magic.h>
-#endif
-
ZEND_EXTERN_MODULE_GLOBALS(http);
PHP_MINIT_FUNCTION(http_support)
/* }}} */
-/* {{{ char *http_guess_content_type(char *magic_file, long magic_mode, void *data, size_t size, http_send_mode mode) */
-PHP_HTTP_API char *_http_guess_content_type(const char *magicfile, long magicmode, void *data_ptr, size_t data_len, http_send_mode data_mode TSRMLS_DC)
-{
- char *ct = NULL;
-
-#ifdef HTTP_HAVE_MAGIC
- /* magic_load() fails if MAGIC_MIME is set because it
- cowardly adds .mime to the file name */
- struct magic_set *magic = magic_open(magicmode &~ MAGIC_MIME);
-
- if (!magic) {
- http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid magic mode: %ld", magicmode);
- } else if (-1 == magic_load(magic, magicfile)) {
- http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Failed to load magic database '%s' (%s)", magicfile, magic_error(magic));
- } else {
- const char *ctype = NULL;
-
- magic_setflags(magic, magicmode);
-
- switch (data_mode)
- {
- case SEND_RSRC:
- {
- char *buffer;
- size_t b_len;
-
- b_len = php_stream_copy_to_mem(data_ptr, &buffer, 65536, 0);
- ctype = magic_buffer(magic, buffer, b_len);
- efree(buffer);
- }
- break;
-
- case SEND_DATA:
- ctype = magic_buffer(magic, data_ptr, data_len);
- break;
-
- default:
- ctype = magic_file(magic, data_ptr);
- break;
- }
-
- if (ctype) {
- ct = estrdup(ctype);
- } else {
- http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Failed to guess Content-Type: %s", magic_error(magic));
- }
- }
- if (magic) {
- magic_close(magic);
- }
-#else
- http_error(HE_WARNING, HTTP_E_RUNTIME, "Cannot guess Content-Type; libmagic not available");
-#endif
-
- return ct;
-}
-/* }}} */
/*
* Local variables:
* tab-width: 4
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+
+#include "php_http.h"
#include "SAPI.h"
-#include "php_streams.h"
#include "php_output.h"
+#include "php_streams.h"
-#include "php_http.h"
-#include "php_http_std_defs.h"
#include "php_http_api.h"
#include "php_http_cache_api.h"
-#include "php_http_send_api.h"
#include "php_http_date_api.h"
+#include "php_http_send_api.h"
ZEND_EXTERN_MODULE_GLOBALS(http);
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
#include "php_http.h"
-#include "php_http_std_defs.h"
-
-#include <ctype.h>
+#include "php_http_date_api.h"
static int check_day(char *day, size_t len);
static int check_month(char *month);
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
-
-#include "php_http_encoding_api.h"
#include "php_http.h"
-#include "php_http_api.h"
-#ifdef HTTP_HAVE_ZLIB
-# include "php_http_send_api.h"
-# include "php_http_headers_api.h"
-# include <zlib.h>
-#endif
+#include "php_http_api.h"
+#include "php_http_encoding_api.h"
+#include "php_http_send_api.h"
+#include "php_http_headers_api.h"
ZEND_EXTERN_MODULE_GLOBALS(http);
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
-#ifdef ZEND_ENGINE_2
+#include "php_http.h"
-#include "zend_exceptions.h"
+#ifdef ZEND_ENGINE_2
-#include "php_http.h"
-#include "php_http_std_defs.h"
#include "php_http_exception_object.h"
#define HTTP_EX_DEF_CE http_exception_object_ce
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+
+#include "php_http.h"
#ifdef ZEND_ENGINE_2
-#include "php_http_std_defs.h"
+#include "php_streams.h"
#include "php_http_api.h"
#include "php_http_filter_api.h"
-#include "phpstr/phpstr.h"
-
-#include "php_streams.h"
-
PHP_MINIT_FUNCTION(http_filter)
{
php_stream_filter_register_factory("http.*", &http_filter_factory TSRMLS_CC);
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
-#include "zend_operators.h"
+#define HTTP_WANT_CURL
+#include "php_http.h"
#include "SAPI.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
+#include "zend_operators.h"
+
#if defined(HAVE_PHP_SESSION) && !defined(COMPILE_DL_SESSION)
# include "ext/session/php_session.h"
#endif
-#include "php_http.h"
-#include "php_http_std_defs.h"
#include "php_http_api.h"
-#include "php_http_request_api.h"
#include "php_http_cache_api.h"
-#include "php_http_request_method_api.h"
-#include "php_http_request_api.h"
#include "php_http_date_api.h"
+#include "php_http_encoding_api.h"
#include "php_http_headers_api.h"
#include "php_http_message_api.h"
+#include "php_http_request_api.h"
+#include "php_http_request_method_api.h"
#include "php_http_send_api.h"
#include "php_http_url_api.h"
-#include "php_http_encoding_api.h"
-
-#include "phpstr/phpstr.h"
ZEND_EXTERN_MODULE_GLOBALS(http)
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
-#include "ext/standard/php_string.h"
+#include "php_http.h"
+
#include "ext/standard/url.h"
+#include "ext/standard/php_string.h"
-#include "php_http.h"
-#include "php_http_std_defs.h"
#include "php_http_api.h"
#include "php_http_headers_api.h"
-#include "php_http_info_api.h"
-
-#include <ctype.h>
ZEND_EXTERN_MODULE_GLOBALS(http);
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
#include "php_http.h"
+
#include "php_http_api.h"
-#include "php_http_std_defs.h"
#include "php_http_info_api.h"
-#include <ctype.h>
-
ZEND_EXTERN_MODULE_GLOBALS(http);
PHP_HTTP_API void _http_info_default_callback(void **nothing, HashTable **headers, http_info *info TSRMLS_DC)
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+#define HTTP_WANT_CURL
#include "php_http.h"
-#include "php_http_std_defs.h"
+
+#include "SAPI.h"
+
#include "php_http_api.h"
-#include "php_http_message_api.h"
+#include "php_http_encoding_api.h"
#include "php_http_headers_api.h"
-#include "php_http_send_api.h"
+#include "php_http_message_api.h"
#include "php_http_request_api.h"
+#include "php_http_send_api.h"
#include "php_http_url_api.h"
-#include "php_http_encoding_api.h"
-
-#include "phpstr/phpstr.h"
ZEND_EXTERN_MODULE_GLOBALS(http);
#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_api.h"
-#include "php_http_std_defs.h"
+#include "php_http_message_api.h"
#include "php_http_message_object.h"
#include "php_http_exception_object.h"
-#include "phpstr/phpstr.h"
-#include "missing.h"
-
#ifndef WONKY
# include "zend_interfaces.h"
# if defined(HAVE_SPL)
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+
+#define HTTP_WANT_CURL
+#include "php_http.h"
#ifdef HTTP_HAVE_CURL
-#include "php_http.h"
-#include "php_http_std_defs.h"
#include "php_http_api.h"
#include "php_http_request_api.h"
#include "php_http_request_method_api.h"
#include "php_http_url_api.h"
+
#ifdef ZEND_ENGINE_2
# include "php_http_request_object.h"
#endif
-#include "phpstr/phpstr.h"
-
-#ifdef PHP_WIN32
-# include <winsock2.h>
-#endif
-
-#include <curl/curl.h>
-
/* {{{ cruft for thread safe SSL crypto locks */
#if defined(ZTS) && defined(HTTP_HAVE_SSL)
# ifdef PHP_WIN32
HTTP_CURL_OPT(FOLLOWLOCATION, 0);
HTTP_CURL_OPT(UNRESTRICTED_AUTH, 0);
HTTP_CURL_OPT(REFERER, NULL);
- HTTP_CURL_OPT(USERAGENT, "PECL::HTTP/" HTTP_PEXT_VERSION " (PHP/" PHP_VERSION ")");
+ HTTP_CURL_OPT(USERAGENT, "PECL::HTTP/" PHP_EXT_HTTP_VERSION " (PHP/" PHP_VERSION ")");
HTTP_CURL_OPT(HTTPHEADER, NULL);
HTTP_CURL_OPT(COOKIE, NULL);
HTTP_CURL_OPT(COOKIEFILE, NULL);
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+#define HTTP_WANT_CURL
#include "php_http.h"
-#include "php_http_std_defs.h"
+
#include "php_http_api.h"
+#include "php_http_request_api.h"
#include "php_http_request_method_api.h"
-#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
+
+#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL) && !defined(WONKY)
# include "php_http_request_object.h"
#endif
-#include "missing.h"
-#include "phpstr/phpstr.h"
-
ZEND_EXTERN_MODULE_GLOBALS(http);
/* {{{ char *http_request_methods[] */
/* $Id$ */
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+
+#define HTTP_WANT_CURL
+#include "php_http.h"
#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
#include "zend_interfaces.h"
-#include "php_http_std_defs.h"
-#include "php_http_request_object.h"
-#include "php_http_request_api.h"
-#include "php_http_request_pool_api.h"
-#include "php_http.h"
#include "php_http_api.h"
-#include "php_http_url_api.h"
+#include "php_http_exception_object.h"
#include "php_http_message_api.h"
#include "php_http_message_object.h"
-#include "php_http_exception_object.h"
-
-#include "missing.h"
-
-#ifdef PHP_WIN32
-# include <winsock2.h>
-#endif
-#include <curl/curl.h>
+#include "php_http_request_api.h"
+#include "php_http_request_object.h"
+#include "php_http_request_pool_api.h"
+#include "php_http_url_api.h"
ZEND_EXTERN_MODULE_GLOBALS(http);
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+
+#define HTTP_WANT_CURL
+#include "php_http.h"
#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
-#include "php_http.h"
-#include "php_http_std_defs.h"
#include "php_http_api.h"
#include "php_http_request_api.h"
-#include "php_http_request_pool_api.h"
#include "php_http_request_object.h"
+#include "php_http_request_pool_api.h"
#include "php_http_requestpool_object.h"
#ifndef HTTP_DEBUG_REQPOOLS
/* $Id$ */
-
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+
+#define HTTP_WANT_CURL
+#include "php_http.h"
#if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
-#include "php_http_std_defs.h"
+#include "zend_interfaces.h"
+
#include "php_http_api.h"
-#include "php_http_requestpool_object.h"
-#include "php_http_request_pool_api.h"
-#include "php_http_request_object.h"
#include "php_http_exception_object.h"
+#include "php_http_request_api.h"
+#include "php_http_request_object.h"
+#include "php_http_request_pool_api.h"
+#include "php_http_requestpool_object.h"
-#include "missing.h"
-
-#include "zend_interfaces.h"
#if defined(HAVE_SPL) && !defined(WONKY)
/* SPL doesn't install its headers */
extern PHPAPI zend_class_entry *spl_ce_Countable;
#endif
-#ifdef PHP_WIN32
-# include <winsock2.h>
-#endif
-#include <curl/curl.h>
-
#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)
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
-#include "missing.h"
+#define HTTP_WANT_MAGIC
+#include "php_http.h"
/* broken static properties in PHP 5.0 */
#if defined(ZEND_ENGINE_2) && !defined(WONKY)
#include "SAPI.h"
#include "php_ini.h"
-#include "php_http.h"
#include "php_http_api.h"
-#include "php_http_std_defs.h"
-#include "php_http_response_object.h"
-#include "php_http_exception_object.h"
-#include "php_http_send_api.h"
#include "php_http_cache_api.h"
+#include "php_http_exception_object.h"
#include "php_http_headers_api.h"
+#include "php_http_response_object.h"
+#include "php_http_send_api.h"
-#ifdef HTTP_HAVE_MAGIC
-# include <magic.h>
-#endif
ZEND_EXTERN_MODULE_GLOBALS(http);
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+
+#define HTTP_WANT_MAGIC
+#include "php_http.h"
#include "SAPI.h"
#include "php_streams.h"
#include "ext/standard/php_lcg.h"
-#include "php_http.h"
-#include "php_http_std_defs.h"
#include "php_http_api.h"
-#include "php_http_date_api.h"
-#include "php_http_send_api.h"
-#include "php_http_headers_api.h"
-#include "php_http_date_api.h"
#include "php_http_cache_api.h"
+#include "php_http_date_api.h"
#include "php_http_encoding_api.h"
+#include "php_http_headers_api.h"
+#include "php_http_send_api.h"
ZEND_EXTERN_MODULE_GLOBALS(http);
}
/* }}} */
+/* {{{ char *http_guess_content_type(char *magic_file, long magic_mode, void *data, size_t size, http_send_mode mode) */
+PHP_HTTP_API char *_http_guess_content_type(const char *magicfile, long magicmode, void *data_ptr, size_t data_len, http_send_mode data_mode TSRMLS_DC)
+{
+ char *ct = NULL;
+
+#ifdef HTTP_HAVE_MAGIC
+ /* magic_load() fails if MAGIC_MIME is set because it
+ cowardly adds .mime to the file name */
+ struct magic_set *magic = magic_open(magicmode &~ MAGIC_MIME);
+
+ if (!magic) {
+ http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Invalid magic mode: %ld", magicmode);
+ } else if (-1 == magic_load(magic, magicfile)) {
+ http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Failed to load magic database '%s' (%s)", magicfile, magic_error(magic));
+ } else {
+ const char *ctype = NULL;
+
+ magic_setflags(magic, magicmode);
+
+ switch (data_mode)
+ {
+ case SEND_RSRC:
+ {
+ char *buffer;
+ size_t b_len;
+
+ b_len = php_stream_copy_to_mem(data_ptr, &buffer, 65536, 0);
+ ctype = magic_buffer(magic, buffer, b_len);
+ efree(buffer);
+ }
+ break;
+
+ case SEND_DATA:
+ ctype = magic_buffer(magic, data_ptr, data_len);
+ break;
+
+ default:
+ ctype = magic_file(magic, data_ptr);
+ break;
+ }
+
+ if (ctype) {
+ ct = estrdup(ctype);
+ } else {
+ http_error_ex(HE_WARNING, HTTP_E_RUNTIME, "Failed to guess Content-Type: %s", magic_error(magic));
+ }
+ }
+ if (magic) {
+ magic_close(magic);
+ }
+#else
+ http_error(HE_WARNING, HTTP_E_RUNTIME, "Cannot guess Content-Type; libmagic not available");
+#endif
+
+ return ct;
+}
+/* }}} */
+
/*
* Local variables:
* tab-width: 4
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
-#include "php.h"
+
+#define HTTP_WANT_NETDB
+#include "php_http.h"
#include "SAPI.h"
#include "zend_ini.h"
#include "php_output.h"
#include "ext/standard/url.h"
-#include "php_http.h"
#include "php_http_api.h"
#include "php_http_url_api.h"
-#include "php_http_std_defs.h"
-
-#include "phpstr/phpstr.h"
-
-#ifdef PHP_WIN32
-# include <winsock2.h>
-#elif defined(HAVE_NETDB_H)
-# include <netdb.h>
-#endif
ZEND_EXTERN_MODULE_GLOBALS(http);
#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)
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
-<package version="1.0" packagerversion="1.4.4">
+<package version="1.0" packagerversion="1.4.3">
<name>pecl_http</name>
<summary>Extended HTTP Support</summary>
<description>* Building absolute URLs
</maintainer>
</maintainers>
<release>
- <version>0.18.1</version>
- <date>2005-11-17</date>
+ <version>0.19.0</version>
+ <date>2005-11-21</date>
<license>BSD, revised</license>
<state>beta</state>
- <notes>* Fixed build with PHP-4 and PHP-5.0
+ <notes>* Fixed bug in http_negotiate_*() when client sends spaces within accept headers
+
+- Removed support for ETag hashing through libmhash
+
++ Added http_negotiate_content_type()
</notes>
<deps>
<dep type="php" rel="ge" version="4.3"/>
</deps>
<configureoptions>
<configureoption name="with-http-curl-requests" default="yes" prompt="whether to enable cURL HTTP requests; specify libcurl directory"/>
- <configureoption name="with-http-mhash-etags" default="yes" prompt="whether to enable mhash ETag generator; specify libmhash directory"/>
<configureoption name="with-http-magic-mime" default="no" prompt="whether to enable response content type guessing; specify libmagic directory"/>
<configureoption name="with-http-zlib-compression" default="yes" prompt="whether to enable support for gzencoded/deflated message bodies; specify zlib directory"/>
</configureoptions>
<file role="test" name="etag_mode_042.phpt"/>
<file role="test" name="etag_mode_043.phpt"/>
<file role="test" name="etag_mode_044.phpt"/>
- <file role="test" name="etag_mode_crc.phpt"/>
<file role="test" name="exceptions.phpt"/>
<file role="test" name="get_request_data_001.phpt"/>
<file role="test" name="HttpMessage_001.phpt"/>
#ifndef PHP_EXT_HTTP_H
#define PHP_EXT_HTTP_H
-#define HTTP_PEXT_VERSION "0.18.1"
+#define PHP_EXT_HTTP_VERSION "0.19.0"
-/* make compile on Win32 */
-#ifdef HTTP_HAVE_CURL
+#include "php.h"
+#include "php_http_std_defs.h"
+#include "phpstr/phpstr.h"
+#include "missing.h"
+
+
+#ifdef HTTP_WANT_NETDB
+# ifdef PHP_WIN32
+# include <winsock2.h>
+# elif defined(HAVE_NETDB_H)
+# include <netdb.h>
+# endif
+#endif
+
+#if defined(HTTP_WANT_CURL) && defined(HTTP_HAVE_CURL)
# ifdef PHP_WIN32
# include <winsock2.h>
# endif
# include <curl/curl.h>
#endif
-#include "phpstr/phpstr.h"
+#if defined(HTTP_WANT_MAGIC) && defined(HTTP_HAVE_MAGIC)
+# if defined(PHP_WIN32) && !defined(USE_MAGIC_DLL) && !defined(USE_MAGIC_STATIC)
+# define USE_MAGIC_STATIC
+# endif
+# include <magic.h>
+#endif
+
+#if defined(HTTP_WANT_ZLIB) && defined(HTTP_HAVE_ZLIB)
+# include <zlib.h>
+#endif
+
+#include <ctype.h>
extern zend_module_entry http_module_entry;
#define phpext_http_ptr &http_module_entry
#ifndef PHP_HTTP_API_H
#define PHP_HTTP_API_H
-#include "php_http_std_defs.h"
-#include "php_http_send_api.h"
-
#define HTTP_SUPPORT 0x01L
#define HTTP_SUPPORT_REQUESTS 0x02L
#define HTTP_SUPPORT_MAGICMIME 0x04L
PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zend_bool check TSRMLS_DC);
#define http_get_request_body(b, l) _http_get_request_body_ex((b), (l), 1 TSRMLS_CC)
-#define http_get_Request_body_ex(b, l, d) _http_get_request_body_ex((b), (l), (d) TSRMLS_CC)
+#define http_get_request_body_ex(b, l, d) _http_get_request_body_ex((b), (l), (d) TSRMLS_CC)
PHP_HTTP_API STATUS _http_get_request_body_ex(char **body, size_t *length, zend_bool dup TSRMLS_DC);
-#define http_guess_content_type(mf, mm, d, l, m) _http_guess_content_type((mf), (mm), (d), (l), (m) TSRMLS_CC)
-PHP_HTTP_API char *_http_guess_content_type(const char *magic_file, long magic_mode, void *data_ptr, size_t data_len, http_send_mode mode TSRMLS_DC);
-
#define http_locate_body _http_locate_body
static inline const char *_http_locate_body(const char *message)
return z;
}
-
#endif
/*
#ifndef PHP_HTTP_CACHE_API_H
#define PHP_HTTP_CACHE_API_H
-#include "zend_ini.h"
+#include "php_http_send_api.h"
#include "ext/standard/crc32.h"
#include "ext/standard/sha1.h"
#include "ext/standard/md5.h"
-
-#include "php_http_std_defs.h"
-#include "php_http.h"
-#include "php_http_api.h"
-#include "php_http_send_api.h"
-
#if defined(HTTP_HAVE_EXT_HASH)
# include "php_hash.h"
#elif defined(HTTP_HAVE_HASH_EXT_HASH)
#ifndef PHP_HTTP_DATE_API_H
#define PHP_HTTP_DATE_API_H
-#include "php_http_std_defs.h"
-
#define http_date(t) _http_date((t) TSRMLS_CC)
PHP_HTTP_API char *_http_date(time_t t TSRMLS_DC);
#ifndef PHP_HTTP_ENCODING_API_H
#define PHP_HTTP_ENCODING_API_H
-#include "php_http_std_defs.h"
-
#ifdef HTTP_HAVE_ZLIB
-# include "phpstr/phpstr.h"
# include <zlib.h>
#endif
#define PHP_HTTP_EXCEPTION_OBJECT_H
#ifdef ZEND_ENGINE_2
+#include "zend_exceptions.h"
+
PHP_MINIT_FUNCTION(http_exception_object);
extern zend_class_entry *http_exception_object_ce;
#ifndef PHP_HTTP_HEADERS_API_H
#define PHP_HTTP_HEADERS_API_H
-#include "php_http_std_defs.h"
#include "php_http_info_api.h"
#define HTTP_REDIRECT 302L
#define PHP_HTTP_MESSAGE_API_H
#include "php_http_info_api.h"
-#include "phpstr/phpstr.h"
typedef enum {
HTTP_MSG_NONE = 0,
#define PHP_HTTP_MESSAGE_OBJECT_H
#ifdef ZEND_ENGINE_2
-#include "php_http_message_api.h"
-
typedef struct {
zend_object zo;
http_message *message;
#ifdef HTTP_HAVE_CURL
-#include "php_http_std_defs.h"
#include "php_http_request_method_api.h"
-#include "phpstr/phpstr.h"
-
-#ifdef PHP_WIN32
-# include <winsock2.h>
-#endif
-#include <curl/curl.h>
-
extern PHP_MINIT_FUNCTION(http_request);
extern PHP_MSHUTDOWN_FUNCTION(http_request);
#ifndef PHP_HTTP_REQUEST_METHOD_API_H
#define PHP_HTTP_REQUEST_METHOD_API_H
-#include "php_http_std_defs.h"
-#include "phpstr/phpstr.h"
-
typedef enum {
HTTP_NO_REQUEST_METHOD = 0,
/* HTTP/1.1 */
#ifdef HTTP_HAVE_CURL
#ifdef ZEND_ENGINE_2
-#ifdef PHP_WIN32
-# include <winsock2.h>
-#endif
-
-#include <curl/curl.h>
-
-#include "php_http_request_api.h"
#include "php_http_request_pool_api.h"
-#include "phpstr/phpstr.h"
typedef struct {
zend_object zo;
#define PHP_HTTP_REQUEST_POOL_API_H
#ifdef HTTP_HAVE_CURL
-#include "php_http_std_defs.h"
-#include "php_http_request_api.h"
-#include "phpstr/phpstr.h"
-
-#ifdef PHP_WIN32
-# include <winsock2.h>
-#endif
-
-#include <curl/curl.h>
-
typedef struct {
CURLM *ch;
zend_llist finished;
#ifdef HTTP_HAVE_CURL
#ifdef ZEND_ENGINE_2
-#ifdef PHP_WIN32
-# include <winsock2.h>
-#endif
-
-#include <curl/curl.h>
-
-#include "php_http_request_pool_api.h"
-
typedef struct {
zend_object zo;
http_request_pool pool;
#ifndef PHP_HTTP_RESPONSE_OBJECT_H
#define PHP_HTTP_RESPONSE_OBJECT_H
#ifdef ZEND_ENGINE_2
-
-#include "missing.h"
-
#ifndef WONKY
extern zend_class_entry *http_response_object_ce;
#ifndef PHP_HTTP_SEND_API_H
#define PHP_HTTP_SEND_API_H
-#include "SAPI.h"
-#include "php_streams.h"
-#include "php_http_std_defs.h"
-
typedef enum {
SEND_DATA,
SEND_RSRC
#define http_send_stream_ex(s, c, nc) _http_send_stream_ex((s), (c), (nc) TSRMLS_CC)
PHP_HTTP_API STATUS _http_send_stream_ex(php_stream *s, zend_bool close_stream, zend_bool no_cache TSRMLS_DC);
+#define http_guess_content_type(mf, mm, d, l, m) _http_guess_content_type((mf), (mm), (d), (l), (m) TSRMLS_CC)
+PHP_HTTP_API char *_http_guess_content_type(const char *magic_file, long magic_mode, void *data_ptr, size_t data_len, http_send_mode mode TSRMLS_DC);
+
#endif
/*
#ifndef PHP_HTTP_URL_API_H
#define PHP_HTTP_URL_API_H
-#include "php_http_std_defs.h"
-
#define http_absolute_uri(url) http_absolute_url(url)
#define http_absolute_uri_ex(url, url_len, proto, proto_len, host, host_len, port) _http_absolute_url_ex((url), (url_len), (proto), (proto_len), (host), (host_len), (port) TSRMLS_CC)
#define http_absolute_url(url) http_absolute_url_ex((url), strlen(url), NULL, 0, NULL, 0, 0)
http_send_data("abc\n");
?>
--EXPECTF--
-Content-type: %s
X-Powered-By: PHP/%s
Cache-Control: private, must-revalidate, max-age=0
Accept-Ranges: bytes
ETag: "edeaaff3f1774ad2888673770c6d64097e391bc362d7d6fb34982ddf0efd18cb"
Content-Length: 4
+Content-type: %s
abc