cvs: php4 /ext/session config.m4 mod_mm.c mod_mm.h session.c

From: Date: Fri, 28 Jun 2002 02:27:02 +0000
Subject: cvs: php4 /ext/session config.m4 mod_mm.c mod_mm.h session.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12586@lists.php.net to get a copy of this message
sniper Thu Jun 27 22:27:02 2002 EDT Modified files: /php4/ext/session config.m4 mod_mm.c mod_mm.h session.c Log: - Fixed bug: #17977, session build as shared works now with mm handler too. - Added listing of save handlers into phpinfo() output Index: php4/ext/session/config.m4 diff -u php4/ext/session/config.m4:1.18 php4/ext/session/config.m4:1.19 --- php4/ext/session/config.m4:1.18 Sat May 4 12:48:48 2002 +++ php4/ext/session/config.m4 Thu Jun 27 22:27:02 2002 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 1.18 2002/05/04 16:48:48 sas Exp $ +dnl $Id: config.m4,v 1.19 2002/06/28 02:27:02 sniper Exp $ dnl PHP_ARG_WITH(mm,for mm support, @@ -8,6 +8,15 @@ 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 @@ 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: php4/ext/session/mod_mm.c diff -u php4/ext/session/mod_mm.c:1.38 php4/ext/session/mod_mm.c:1.39 --- php4/ext/session/mod_mm.c:1.38 Wed Mar 6 07:25:01 2002 +++ php4/ext/session/mod_mm.c Thu Jun 27 22:27:02 2002 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: mod_mm.c,v 1.38 2002/03/06 12:25:01 sas Exp $ */ +/* $Id: mod_mm.c,v 1.39 2002/06/28 02:27:02 sniper Exp $ */ #include "php.h" @@ -422,17 +422,6 @@ 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: php4/ext/session/mod_mm.h diff -u php4/ext/session/mod_mm.h:1.6 php4/ext/session/mod_mm.h:1.7 --- php4/ext/session/mod_mm.h:1.6 Thu Feb 28 03:26:40 2002 +++ php4/ext/session/mod_mm.h Thu Jun 27 22:27:02 2002 @@ -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 Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.309 php4/ext/session/session.c:1.310 --- php4/ext/session/session.c:1.309 Wed Jun 12 04:18:36 2002 +++ php4/ext/session/session.c Thu Jun 27 22:27:02 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.309 2002/06/12 08:18:36 sas Exp $ */ +/* $Id: session.c,v 1.310 2002/06/28 02:27:02 sniper Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -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 @@ 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();

« previous php.cvs (#12586) next »