- no need to check for COMPILE_DL_SESSION
authorMichael Wallner <mike@php.net>
Thu, 29 Dec 2005 14:53:12 +0000 (14:53 +0000)
committerMichael Wallner <mike@php.net>
Thu, 29 Dec 2005 14:53:12 +0000 (14:53 +0000)
config.w32
http.c
http_functions.c
package2.xml

index 64cecdcae1b9601548f219f4554d2388f02752e3..af583c2c91e7ff9d91cf1a5dfac7aec635bbd527 100644 (file)
@@ -81,6 +81,10 @@ if (PHP_HTTP != "no") {
                        ADD_EXTENSION_DEP("http", "hash", true);
                }
        }
+       
+       if (PHP_SESSION != "no") {
+               ADD_EXTENSION_DEP("http", "session", true);
+       }
 
        CURL_LIB = PHP_DEBUG != "no" ? "libcurld.lib":"libcurl.lib";
     if (CHECK_HEADER_ADD_INCLUDE("curl/curl.h", "CFLAGS_HTTP") &&
diff --git a/http.c b/http.c
index d22499c4a8d3dd35d68b00f2c12c53fdcf86e0bb..039f7206234d9909ebff8751415180651e34c915 100644 (file)
--- a/http.c
+++ b/http.c
@@ -129,6 +129,9 @@ static zend_module_dep http_module_dep[] = {
 #      endif
 #      ifdef HTTP_HAVE_EXT_HASH
        ZEND_MOD_REQUIRED("hash")
+#      endif
+#      ifdef HAVE_PHP_SESSION
+       ZEND_MOD_REQUIRED("session")
 #      endif
        {NULL, NULL, NULL, 0}
 };
index a1620e6b80f2fec52fcd9a9e5fec8fbfaa5436cf..444637efe9f76403fb07bc03accbb42e8740f939 100644 (file)
@@ -26,7 +26,7 @@
 #include "ext/standard/php_string.h"
 #include "zend_operators.h"
 
-#if defined(HAVE_PHP_SESSION) && !defined(COMPILE_DL_SESSION)
+#ifdef HAVE_PHP_SESSION
 #      include "ext/session/php_session.h"
 #endif
 
@@ -672,6 +672,7 @@ PHP_FUNCTION(http_redirect)
                RETURN_FALSE;
        }
 
+#ifdef HAVE_PHP_SESSION
        /* append session info */
        if (session) {
                if (!params) {
@@ -679,39 +680,13 @@ PHP_FUNCTION(http_redirect)
                        MAKE_STD_ZVAL(params);
                        array_init(params);
                }
-#ifdef HAVE_PHP_SESSION
-#      ifdef COMPILE_DL_SESSION
-               if (SUCCESS == zend_get_module_started("session")) {
-                       zval nm_retval, id_retval, func;
-                       
-                       INIT_PZVAL(&func);
-                       INIT_PZVAL(&nm_retval);
-                       INIT_PZVAL(&id_retval);
-                       ZVAL_NULL(&nm_retval);
-                       ZVAL_NULL(&id_retval);
-                       
-                       ZVAL_STRINGL(&func, "session_id", lenof("session_id"), 0);
-                       call_user_function(EG(function_table), NULL, &func, &id_retval, 0, NULL TSRMLS_CC);
-                       ZVAL_STRINGL(&func, "session_name", lenof("session_name"), 0);
-                       call_user_function(EG(function_table), NULL, &func, &nm_retval, 0, NULL TSRMLS_CC);
-                       
-                       if (    Z_TYPE(nm_retval) == IS_STRING && Z_STRLEN(nm_retval) &&
-                                       Z_TYPE(id_retval) == IS_STRING && Z_STRLEN(id_retval)) {
-                               if (add_assoc_stringl_ex(params, Z_STRVAL(nm_retval), Z_STRLEN(nm_retval)+1, 
-                                               Z_STRVAL(id_retval), Z_STRLEN(id_retval), 0) != SUCCESS) {
-                                       http_error(HE_WARNING, HTTP_E_RUNTIME, "Could not append session information");
-                               }
-                       }
-               }
-#      else
                if (PS(session_status) == php_session_active) {
                        if (add_assoc_string(params, PS(session_name), PS(id), 1) != SUCCESS) {
                                http_error(HE_WARNING, HTTP_E_RUNTIME, "Could not append session information");
                        }
                }
-#      endif
-#endif
        }
+#endif
 
        /* treat params array with http_build_query() */
        if (params) {
index 26b487cc9aa852dc8997b3201419ddad300506a4..c88dbfdae7d7cc15d0ee475293c4f3f7f7499b50 100644 (file)
@@ -252,6 +252,7 @@ Special thanks for this release go to Ilia Alshanetsky.
    </pearinstaller>
   </required>
   <optional>
+   <extension><name>spl</name></extension>
    <extension><name>session</name></extension>
    <extension><name>hash</name></extension>
   </optional>