CVS update: php4/ext/session

From: Date: Sun, 06 Jun 1999 19:53:59 +0000
Subject: CVS update: php4/ext/session
Groups: php.version4 
Request: Send a blank email to php-version4+get-1347@lists.php.net to get a copy of this message
Date: Sunday June 6, 1999 @ 15:53 Author: zeev Update of /repository/php4/ext/session In directory php:/tmp/cvs-serv4834/ext/session Modified Files: mod_files.c session.c Log Message: - Fix PSLS issues - Add a standard info function for the session module (use them!) - Replace PATH_MAX with MAXPATHLEN (that's our platform indepedent constant) Index: php4/ext/session/mod_files.c diff -u php4/ext/session/mod_files.c:1.1 php4/ext/session/mod_files.c:1.2 --- php4/ext/session/mod_files.c:1.1 Sat Jun 5 15:52:58 1999 +++ php4/ext/session/mod_files.c Sun Jun 6 15:53:59 1999 @@ -42,10 +42,12 @@ char *basedir; } ps_files; + ps_module ps_mod_files = { PS_MOD(files) }; + #define PS_FILES_DATA ps_files *data = *mod_data PS_OPEN_FUNC(files) @@ -76,7 +78,7 @@ static void _ps_files_open(ps_files *data, const char *key) { - char buf[PATH_MAX]; + char buf[MAXPATHLEN]; if(data->fd < 0 || !data->lastkey || strcmp(key, data->lastkey)) { if(data->lastkey) efree(data->lastkey); @@ -84,7 +86,7 @@ data->lastkey = estrdup(key); - snprintf(buf, PATH_MAX, "%s/%s", data->basedir, key); + snprintf(buf, MAXPATHLEN, "%s/%s", data->basedir, key); data->fd = open(buf, O_CREAT | O_RDWR, 0600); if(data->fd > -1) { flock(data->fd, LOCK_EX); @@ -137,10 +139,10 @@ PS_DELETE_FUNC(files) { - char buf[PATH_MAX]; + char buf[MAXPATHLEN]; PS_FILES_DATA; - snprintf(buf, PATH_MAX, "%s/%s", data->basedir, key); + snprintf(buf, MAXPATHLEN, "%s/%s", data->basedir, key); unlink(buf); return SUCCESS; Index: php4/ext/session/session.c diff -u php4/ext/session/session.c:1.13 php4/ext/session/session.c:1.14 --- php4/ext/session/session.c:1.13 Sun Jun 6 15:26:31 1999 +++ php4/ext/session/session.c Sun Jun 6 15:53:59 1999 @@ -38,15 +38,17 @@ */ #if !(WIN32|WINNT) #include <sys/time.h> +#else +#include "win32/time.h" #endif #include "php.h" #include "php_ini.h" #include "SAPI.h" - #include "php_session.h" -#include "../standard/md5.h" +#include "ext/standard/md5.h" +#include "ext/standard/php3_var.h" #ifdef ZTS @@ -77,17 +79,19 @@ PHP_INI_ENTRY("session_auto_start", "0", PHP_INI_ALL, NULL) PHP_INI_END() + static int php_minit_session(INIT_FUNC_ARGS); static int php_rinit_session(INIT_FUNC_ARGS); static int php_mshutdown_session(SHUTDOWN_FUNC_ARGS); static int php_rshutdown_session(SHUTDOWN_FUNC_ARGS); +static void php_info_isapi(ZEND_MODULE_INFO_FUNC_ARGS); zend_module_entry session_module_entry = { "session", session_functions, php_minit_session, php_mshutdown_session, php_rinit_session, php_rshutdown_session, - NULL, + php_info_isapi, STANDARD_MODULE_PROPERTIES, }; @@ -279,8 +283,6 @@ { pval **ppid; int send_cookie = 1; - char *session_data; - int datalen; ELS_FETCH(); if(!PS(id) && @@ -347,7 +349,7 @@ ps_module *tempmod; convert_to_string(p_name); - tempmod = _php_find_ps_module(p_name->value.str.val); + tempmod = _php_find_ps_module(p_name->value.str.val PSLS_CC); if(tempmod) { if(PS(mod_data)) PS(mod)->close(&PS(mod_data)); @@ -458,6 +460,7 @@ { int len; char *enc; + PSLS_FETCH(); enc = _php_session_encode(&len PSLS_CC); RETVAL_STRINGL(enc, len, 0); @@ -469,6 +472,7 @@ PHP_FUNCTION(session_decode) { pval *str; + PSLS_FETCH(); if(ARG_COUNT(ht) != 1 || getParameters(ht, 1, &str) == FAILURE) { WRONG_PARAM_COUNT; @@ -490,7 +494,7 @@ void php_rinit_globals(PSLS_D) { - PS(mod) = _php_find_ps_module(INI_STR("session_module_name")); + PS(mod) = _php_find_ps_module(INI_STR("session_module_name") PSLS_CC); zend_hash_init(&PS(vars), 0, NULL, NULL, 0); PS(save_path) = estrdup(INI_STR("session_save_path")); @@ -517,7 +521,7 @@ php_rinit_globals(PSLS_C); if(INI_INT("session_auto_start")) { - _php_session_start(); + _php_session_start(PSLS_C); } if(PS(mod) == NULL) return FAILURE; @@ -530,7 +534,7 @@ PSLS_FETCH(); if(PS(nr_open_sessions) > 0) { - _php_session_save_current_state(); + _php_session_save_current_state(PSLS_C); } php_rshutdown_globals(PSLS_C); return SUCCESS; @@ -549,4 +553,10 @@ { UNREGISTER_INI_ENTRIES(); return SUCCESS; +} + + +static void php_info_isapi(ZEND_MODULE_INFO_FUNC_ARGS) +{ + DISPLAY_INI_ENTRIES(); }

« previous php.version4 (#1347) next »