Browse Source

- Fixed bug: #17977, session build as shared works now with mm handler too.

- Added listing of save handlers into phpinfo() output
experimental/new_apache_hooks
foobar 24 years ago
parent
commit
087f2be56f
  1. 19
      ext/session/config.m4
  2. 11
      ext/session/mod_mm.c
  3. 12
      ext/session/mod_mm.h
  4. 33
      ext/session/session.c

19
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

11
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
/*

12
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

33
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();

Loading…
Cancel
Save