From f8f0fd4dc265150a309824448b08249151d2ec45 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 9 Feb 2005 19:03:20 +0000 Subject: [PATCH] * attempt to make http_build_query available for PHP4 --- http.c | 7 +++++++ http_api.c | 5 ++--- php_http.h | 4 ++++ php_http_api.h | 4 ++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/http.c b/http.c index 74e2968..e432ef0 100644 --- a/http.c +++ b/http.c @@ -31,6 +31,10 @@ #include "php_http.h" #include "php_http_api.h" +#ifdef ZEND_ENGINE_2 +#include "ext/standard/php_http.h" +#endif + #ifdef HTTP_HAVE_CURL #ifdef PHP_WIN32 @@ -75,6 +79,9 @@ function_entry http_functions[] = { #endif PHP_FE(http_auth_basic, NULL) PHP_FE(http_auth_basic_cb, NULL) +#ifndef ZEND_ENGINE_2 + PHP_FE(http_build_query, NULL) +#endif {NULL, NULL, NULL} }; /* }}} */ diff --git a/http_api.c b/http_api.c index a321350..613d259 100644 --- a/http_api.c +++ b/http_api.c @@ -36,11 +36,10 @@ #include "SAPI.h" -#if (PHP_MAJOR_VERSION >= 5) +#ifdef ZEND_ENGINE_2 #include "ext/standard/php_http.h" #else -#include "php_http_build_query.h" -#include "http_build_query.c" +#include "php_http_build_query.c" #endif #include "php_http.h" diff --git a/php_http.h b/php_http.h index 4ed736c..cf955a8 100644 --- a/php_http.h +++ b/php_http.h @@ -34,6 +34,10 @@ extern zend_module_entry http_module_entry; #define HTTP_G(v) (http_globals.v) #endif +#ifndef ZEND_ENGINE_2 +#include "php_http_build_query.h" +#endif + PHP_FUNCTION(http_date); PHP_FUNCTION(http_absolute_uri); PHP_FUNCTION(http_negotiate_language); diff --git a/php_http_api.h b/php_http_api.h index 56cf541..61ae827 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -24,6 +24,10 @@ #define PHP_HTTP_API #endif +#ifndef ZEND_ENGINE_2 +#include "php_http_build_query.h" +#endif + /* make functions that return SUCCESS|FAILURE more obvious */ typedef int STATUS; -- 2.30.2