sniper Sun Feb 13 12:51:33 2005 EDT Modified files: (Branch: PHP_4_3) /php-src/ext/session session.c Log: MFH: - Added the alias session_commit() (more intuitive name for session_write_close()) MFH: - Partial sync of the file by adding macro SESSION_CHECK_ACTIVE_STATE http://cvs.php.net/diff.php/php-src/ext/session/session.c?r1=1.336.2.49&r2=1.336.2.50&ty=u Index: php-src/ext/session/session.c diff -u php-src/ext/session/session.c:1.336.2.49 php-src/ext/session/session.c:1.336.2.50 --- php-src/ext/session/session.c:1.336.2.49 Fri Jan 21 11:04:54 2005 +++ php-src/ext/session/session.c Sun Feb 13 12:51:32 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: session.c,v 1.336.2.49 2005/01/21 16:04:54 sesser Exp $ */ +/* $Id: session.c,v 1.336.2.50 2005/02/13 17:51:32 sniper Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -75,6 +75,7 @@ PHP_FE(session_set_cookie_params, NULL) PHP_FE(session_get_cookie_params, NULL) PHP_FE(session_write_close, NULL) + PHP_FALIAS(session_commit, session_write_close, NULL) {NULL, NULL, NULL} }; /* }}} */ @@ -84,12 +85,16 @@ static ps_module *_php_find_ps_module(char *name TSRMLS_DC); static const ps_serializer *_php_find_ps_serializer(char *name TSRMLS_DC); +#define SESSION_CHECK_ACTIVE_STATE \ + if (PS(session_status) == php_session_active) { \ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time."); \ + return FAILURE; \ + } + static PHP_INI_MH(OnUpdateSaveHandler) { - if (PS(session_status) == php_session_active) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time."); - return FAILURE; - } + SESSION_CHECK_ACTIVE_STATE; + PS(mod) = _php_find_ps_module(new_value TSRMLS_CC); if (PG(modules_activated) && !PS(mod)) { @@ -101,10 +106,8 @@ static PHP_INI_MH(OnUpdateSerializer) { - if (PS(session_status) == php_session_active) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time."); - return FAILURE; - } + SESSION_CHECK_ACTIVE_STATE; + PS(serializer) = _php_find_ps_serializer(new_value TSRMLS_CC); if (PG(modules_activated) && !PS(serializer)) { @@ -511,8 +514,7 @@ zval *session_vars = NULL; /* Unconditionally destroy existing arrays -- possible dirty data */ - zend_hash_del(&EG(symbol_table), "HTTP_SESSION_VARS", - sizeof("HTTP_SESSION_VARS")); + zend_hash_del(&EG(symbol_table), "HTTP_SESSION_VARS", sizeof("HTTP_SESSION_VARS")); zend_hash_del(&EG(symbol_table), "_SESSION", sizeof("_SESSION")); MAKE_STD_ZVAL(session_vars);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php