From 3f048c60b3f3b8151eb86121eed8c9b8927c55dc Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 9 Nov 2005 19:36:13 +0000 Subject: [PATCH] - fix dep on SPL in PHP-5.1 --- config.m4 | 4 ++-- http.c | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/config.m4 b/config.m4 index aa63ea4..1952cd9 100644 --- a/config.m4 +++ b/config.m4 @@ -202,9 +202,9 @@ dnl ---- php_http_encoding_api.h phpstr/phpstr.h" PHP_SUBST([PHP_HTTP_HEADERS]) - dnl outside src dir + dnl outside src dir, adds install-http target PHP_ADD_MAKEFILE_FRAGMENT - dnl within src dir + dnl within src dir, installs http headers ifdef([PHP_INSTALL_HEADERS], [PHP_INSTALL_HEADERS(ext/http, $PHP_HTTP_HEADER_FILES)], [ ]) AC_DEFINE([HAVE_HTTP], [1], [Have extended HTTP support]) diff --git a/http.c b/http.c index a4b430a..b81c8cb 100644 --- a/http.c +++ b/http.c @@ -18,6 +18,8 @@ #endif #include "php.h" +#include "zend_extensions.h" + #include "SAPI.h" #include "php_ini.h" #include "ext/standard/info.h" @@ -128,9 +130,23 @@ zend_function_entry http_functions[] = { }; /* }}} */ +/* {{{ http_module_dep */ +#if ZEND_EXTENSION_API_NO >= 220050617 +static zend_module_dep http_module_dep[] = { +# ifdef HAVE_SPL + ZEND_MOD_REQUIRED("spl") +# endif + {NULL, NULL, NULL, 0} +}; +#endif +/* }}} */ + /* {{{ http_module_entry */ zend_module_entry http_module_entry = { -#if ZEND_MODULE_API_NO >= 20010901 +#if ZEND_EXTENSION_API_NO >= 220050617 + STANDARD_MODULE_HEADER_EX, NULL, + http_module_dep, +#else STANDARD_MODULE_HEADER, #endif "http", @@ -140,9 +156,7 @@ zend_module_entry http_module_entry = { PHP_RINIT(http), PHP_RSHUTDOWN(http), PHP_MINFO(http), -#if ZEND_MODULE_API_NO >= 20010901 HTTP_PEXT_VERSION, -#endif STANDARD_MODULE_PROPERTIES }; /* }}} */ -- 2.30.2