summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/session/config.m419
-rw-r--r--ext/session/mod_mm.c11
-rw-r--r--ext/session/mod_mm.h12
-rw-r--r--ext/session/session.c33
4 files changed, 45 insertions, 30 deletions
diff --git a/ext/session/config.m4 b/ext/session/config.m4
index 7259849c79..d9b8d64faf 100644
--- a/ext/session/config.m4
+++ b/ext/session/config.m4
@@ -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
diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c
index 1f05b4b733..a555e5d2e0 100644
--- a/ext/session/mod_mm.c
+++ b/ext/session/mod_mm.c
@@ -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
/*
diff --git a/ext/session/mod_mm.h b/ext/session/mod_mm.h
index 39df1a73cd..7d5939f049 100644
--- a/ext/session/mod_mm.h
+++ b/ext/session/mod_mm.h
@@ -23,19 +23,13 @@
#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
diff --git a/ext/session/session.c b/ext/session/session.c
index 7e3ea9befe..0ef8356b47 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -50,6 +50,10 @@
#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();