]> granicus.if.org Git - php/commitdiff
- Fixed bug: #17977, session build as shared works now with mm handler too.
authorfoobar <sniper@php.net>
Fri, 28 Jun 2002 02:27:02 +0000 (02:27 +0000)
committerfoobar <sniper@php.net>
Fri, 28 Jun 2002 02:27:02 +0000 (02:27 +0000)
- Added listing of save handlers into phpinfo() output

ext/session/config.m4
ext/session/mod_mm.c
ext/session/mod_mm.h
ext/session/session.c

index 7259849c7943e8d3ddb1658c6ca40fbdf6a7362f..d9b8d64faff5c02fe6b5fc399bad219afd648087 100644 (file)
@@ -8,6 +8,15 @@ PHP_ARG_WITH(mm,for mm support,
 PHP_ARG_ENABLE(session, whether to enable PHP sessions,
 [  --disable-session       Disable session support], yes)
 
+if test "$PHP_SESSION" != "no"; then
+  AC_CHECK_FUNCS(pread pwrite)
+  PHP_MISSING_PWRITE_DECL
+  PHP_MISSING_PREAD_DECL
+  PHP_NEW_EXTENSION(session, session.c mod_files.c mod_mm.c mod_user.c, $ext_shared)
+  PHP_SUBST(SESSION_SHARED_LIBADD)
+  AC_DEFINE(HAVE_PHP_SESSION,1,[ ])
+fi
+
 if test "$PHP_MM" != "no"; then
   for i in /usr/local /usr $PHP_MM; do
     if test -f "$i/include/mm.h"; then
@@ -22,14 +31,4 @@ if test "$PHP_MM" != "no"; then
   PHP_ADD_LIBRARY_WITH_PATH(mm, $MM_DIR/lib, SESSION_SHARED_LIBADD)
   PHP_ADD_INCLUDE($MM_DIR/include)
   AC_DEFINE(HAVE_LIBMM, 1, [Whether you have libmm])
-  PHP_MODULE_PTR(phpext_ps_mm_ptr)
-fi
-
-if test "$PHP_SESSION" != "no"; then
-  AC_CHECK_FUNCS(pread pwrite)
-  PHP_MISSING_PWRITE_DECL
-  PHP_MISSING_PREAD_DECL
-  PHP_NEW_EXTENSION(session, session.c mod_files.c mod_mm.c mod_user.c, $ext_shared)
-  PHP_SUBST(SESSION_SHARED_LIBADD)
-  AC_DEFINE(HAVE_PHP_SESSION,1,[ ])
 fi
index 1f05b4b73329ac3f297e9d83b7ada766fbbc81cd..a555e5d2e0f6fe1e55d9edc73121e0e532a0d4d1 100644 (file)
@@ -423,17 +423,6 @@ PS_GC_FUNC(mm)
        return SUCCESS;
 }
 
-zend_module_entry php_session_mm_module = {
-       STANDARD_MODULE_HEADER,
-       "session mm",
-       NULL,
-       PHP_MINIT(ps_mm), PHP_MSHUTDOWN(ps_mm),
-       NULL, NULL,
-       NULL,
-    NO_VERSION_YET,
-       STANDARD_MODULE_PROPERTIES
-};
-
 #endif
 
 /*
index 39df1a73cd0766f074e7ecfc09d67cbc5ed6fac6..7d5939f04942e6a0a235692d368b2c9c79cb4cdb 100644 (file)
 
 #include "php_session.h"
 
+PHP_MINIT_FUNCTION(ps_mm);
+PHP_MSHUTDOWN_FUNCTION(ps_mm);
+
 extern ps_module ps_mod_mm;
 #define ps_mm_ptr &ps_mod_mm
 
-extern zend_module_entry php_session_mm_module;
-#define phpext_ps_mm_ptr &php_session_mm_module
-
 PS_FUNCS(mm);
 
-#else
-
-#define ps_mm_ptr NULL
-#define phpext_ps_mm_ptr NULL
-
 #endif
-
 #endif
index 7e3ea9befe3ae2f850312d641fec39e3f3e4343e..0ef8356b47a803d31e6d5c3b9e187d242ffecc8a 100644 (file)
 #include "mod_files.h"
 #include "mod_user.h"
 
+#ifdef HAVE_LIBMM
+#include "mod_mm.h"
+#endif
+
 /* {{{ session_functions[]
  */
 function_entry session_functions[] = {
@@ -1459,21 +1463,50 @@ PHP_MINIT_FUNCTION(session)
        zend_register_auto_global("_SESSION", sizeof("_SESSION")-1 TSRMLS_CC);
 
        PS(module_number) = module_number; /* if we really need this var we need to init it in zts mode as well! */
+
        REGISTER_INI_ENTRIES();
+
+#ifdef HAVE_LIBMM
+       PHP_MINIT(ps_mm) (INIT_FUNC_ARGS_PASSTHRU);
+#endif
        return SUCCESS;
 }
 
 PHP_MSHUTDOWN_FUNCTION(session)
 {
        UNREGISTER_INI_ENTRIES();
+
+#ifdef HAVE_LIBMM
+       PHP_MSHUTDOWN(ps_mm) (SHUTDOWN_FUNC_ARGS_PASSTHRU);
+#endif
+
        return SUCCESS;
 }
 
 
 PHP_MINFO_FUNCTION(session)
 {
+       ps_module **mod;
+       smart_str handlers = {0};
+       int i;
+       
+       for (i = 0, mod = ps_modules; i < MAX_MODULES; i++, mod++) {
+               if (*mod && (*mod)->name) {
+                       smart_str_appends(&handlers, (*mod)->name);
+                       smart_str_appendc(&handlers, ' ');
+               }
+       }
+       
        php_info_print_table_start();
        php_info_print_table_row(2, "Session Support", "enabled" );
+
+       if (handlers.c) {
+               smart_str_0(&handlers);
+               php_info_print_table_row(2, "Registered save handlers", handlers.c);
+               smart_str_free(&handlers);
+       } else {
+               php_info_print_table_row(2, "Registered save handlers", "none");
+       }
        php_info_print_table_end();
 
        DISPLAY_INI_ENTRIES();