- fix dep on SPL in PHP-5.1
authorMichael Wallner <mike@php.net>
Wed, 9 Nov 2005 19:36:13 +0000 (19:36 +0000)
committerMichael Wallner <mike@php.net>
Wed, 9 Nov 2005 19:36:13 +0000 (19:36 +0000)
config.m4
http.c

index aa63ea43e7425410b4a650fa42e92eafc4199c4b..1952cd94922378927d766d5290689803e98a69bd 100644 (file)
--- 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 a4b430a6812a5e6cec58e9f63554de080bd8641a..b81c8cb00ff5986a33a6686d73adba3f8cc2b4d2 100644 (file)
--- 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
 };
 /* }}} */