+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef PHP_WIN32
+#include <php_config.h>
+#endif
+#include <php.h>
+#include <SAPI.h>
+
+#include <ext/raphf/php_raphf.h>
+#include <ext/propro/php_propro.h>
+#include <ext/standard/php_string.h>
+#include <ext/spl/spl_iterators.h>
+#include <ext/date/php_date.h>
+
+#include <zend_interfaces.h>
+#include <zend_exceptions.h>
+
+
+#ifdef PHP_WIN32
+# define PHP_HTTP_API __declspec(dllexport)
+#elif defined(__GNUC__) && __GNUC__ >= 4
+# define PHP_HTTP_API extern __attribute__ ((visibility("default")))
+#else
+# define PHP_HTTP_API extern
+#endif
+
+/* make functions that return SUCCESS|FAILURE more obvious */
+typedef int STATUS;
+
+#if (defined(HAVE_ICONV) || defined(PHP_HTTP_HAVE_EXT_ICONV)) && (PHP_HTTP_SHARED_DEPS || !defined(COMPILE_DL_ICONV))
+# define PHP_HTTP_HAVE_ICONV
+#endif
+
+#if (defined(HAVE_HASH_EXT) || defined(PHP_HTTP_HAVE_EXT_HASH)) && (PHP_HTTP_SHARED_DEPS || !defined(COMPILE_DL_HASH)) && defined(PHP_HTTP_HAVE_PHP_HASH_H)
+# define PHP_HTTP_HAVE_HASH
+#endif
+
+#if (defined(HAVE_JSON) || defined(PHP_HTTP_HAVE_EXT_JSON)) && (PHP_HTTP_SHARED_DEPS || !defined(COMPILE_DL_JSON))
+# define PHP_HTTP_HAVE_JSON
+#endif
+
+#ifdef PHP_WIN32
+# define CURL_STATICLIB
+# define PHP_HTTP_HAVE_NETDB
+# include <winsock2.h>
+#elif defined(HAVE_NETDB_H)
+# define PHP_HTTP_HAVE_NETDB
+# include <netdb.h>
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+# ifdef HAVE_ERRNO_H
+# include <errno.h>
+# endif
+#endif
+
+#include <ctype.h>
+#define PHP_HTTP_IS_CTYPE(type, c) is##type((int) (unsigned char) (c))
+#define PHP_HTTP_TO_CTYPE(type, c) to##type((int) (unsigned char) (c))