HttpResponse class is only available for PHP >= 5.1
-HttpResponse::guessContentType() is not available on Windows at the time this
-was written, unless you compile PHP or ext/http yourself[1]. Additionally
-you'll need to fix the magic.mime file that's shipped with PHP by executing
-`sed -e "s/\t!/\\\!/" magic.mime > magic.good` and then of course use the new
-magic file.
-
-[1] Fetch http://dev.iworks.at/PATCHES/fileinfo/fileinfo-win32build.zip (84k)
ADD_SOURCES(configure_module_dirname + "/phpstr", "phpstr.c", "http");
AC_DEFINE("HAVE_HTTP", 1, "Have extended HTTP support");
+ MHASH_LIB = PHP_DEBUG != "no" ? "libmhash-staticd.lib":"libmhash-static.lib";
if (CHECK_HEADER_ADD_INCLUDE('mhash.h', 'CFLAGS_HTTP') &&
- CHECK_LIB('libmhash.lib', 'http', PHP_HTTP)) {
+ (CHECK_LIB(MHASH_LIB, 'http', PHP_HTTP) ||
+ CHECK_LIB('libmhash.lib', 'http', PHP_HTTP))) {
AC_DEFINE('HTTP_HAVE_MHASH', 1 , "Have mhash library");
} else {
WARNING("mhash etag generator not enabled; libraries and headers not found");
}
+ CURL_LIB = PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib";
if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") &&
- CHECK_LIB("libcurl.lib", "http", PHP_HTTP) &&
+ CHECK_LIB(CURL_LIB, "http", PHP_HTTP) &&
CHECK_LIB("ssleay32.lib", "http", PHP_HTTP) &&
CHECK_LIB("libeay32.lib", "http", PHP_HTTP) &&
CHECK_LIB("zlib.lib", "http", PHP_HTTP) &&
}
MAGIC_LIB = PHP_DEBUG != "no" ? "libmagic-staticd.lib":"libmagic-static.lib";
-
if (CHECK_HEADER_ADD_INCLUDE("magic.h", "CFLAGS_HTTP") &&
CHECK_LIB(MAGIC_LIB, "http", PHP_HTTP)) {
AC_DEFINE("HTTP_HAVE_MAGIC", 1, "Have magic library");
+ AC_DEFINE("USE_MAGIC_STATIC", "", "");
} else {
WARNING("content type guessing not enabled; libraries and headers not found");
}
#include <ctype.h>
#ifdef HTTP_HAVE_MAGIC
-# if defined(PHP_WIN32) && !defined(USE_MAGIC_DLL)
+# if defined(PHP_WIN32) && !defined(USE_MAGIC_DLL) && !defined(USE_MAGIC_STATIC)
# define USE_MAGIC_STATIC
# endif
# include <magic.h>
void _http_error_ex(long type, long code, const char *format, ...)
{
va_list args;
- zend_bool throw_exception = 0;
TSRMLS_FETCH();
-
- if (type == E_THROW) {
- throw_exception = 1;
- type = E_WARNING;
- } else if (PG(error_handling) == EH_THROW) {
- throw_exception = 1;
- }
-
+
va_start(args, format);
#ifdef ZEND_ENGINE_2
- if (throw_exception) {
+ if ((type == E_THROW) || (PG(error_handling) == EH_THROW)) {
char *message;
vspprintf(&message, 0, format, args);
#endif
#define HE_THROW E_THROW
#ifdef ZEND_ENGINE_2
+# define HE_THROE E_THROW
# define HE_NOTICE (HTTP_G(only_exceptions) ? E_THROW : E_NOTICE)
# define HE_WARNING (HTTP_G(only_exceptions) ? E_THROW : E_WARNING)
# define HE_ERROR (HTTP_G(only_exceptions) ? E_THROW : E_ERROR)
#else
+# define HE_THROW E_WARNING
# define HE_NOTICE E_NOTICE
# define HE_WARNING E_WARNING
# define HE_ERROR E_ERROR