diff options
| author | Zeev Suraski <zeev@php.net> | 2000-05-26 11:12:49 +0000 |
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 2000-05-26 11:12:49 +0000 |
| commit | fb69f854aff36433e0dfc7878e001b3a33472400 (patch) | |
| tree | b5bed5ffe3f7723fa69446c8c62dc8f26b22ab6d /ext/session/session.c | |
| parent | 8e12a0126e4c7f5045bca98883b040e32b64347f (diff) | |
| download | php-git-fb69f854aff36433e0dfc7878e001b3a33472400.tar.gz | |
Use the INI framework in the session module
Diffstat (limited to 'ext/session/session.c')
| -rw-r--r-- | ext/session/session.c | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/ext/session/session.c b/ext/session/session.c index 32c3db5c61..366bf076ff 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -68,22 +68,22 @@ function_entry session_functions[] = { }; PHP_INI_BEGIN() - PHP_INI_ENTRY("session.save_path", "/tmp", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.auto_start", "0", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.gc_probability", "1", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.serialize_handler", "php", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.cookie_lifetime", "0", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.cookie_path", "/", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.cookie_domain", "", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.use_cookies", "1", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.referer_check", "", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.entropy_file", "", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.entropy_length", "0", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.cache_limiter", "nocache", PHP_INI_ALL, NULL) - PHP_INI_ENTRY("session.cache_expire", "180", PHP_INI_ALL, NULL) + STD_PHP_INI_ENTRY("session.save_path", "/tmp", PHP_INI_ALL, OnUpdateString, save_path, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.name", "PHPSESSID", PHP_INI_ALL, OnUpdateString, session_name, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.save_handler", "files", PHP_INI_ALL, OnUpdateString, save_handler, php_ps_globals, ps_globals) + STD_PHP_INI_BOOLEAN("session.auto_start", "0", PHP_INI_ALL, OnUpdateBool, auto_start, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.gc_probability", "1", PHP_INI_ALL, OnUpdateInt, gc_probability, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.gc_maxlifetime", "1440", PHP_INI_ALL, OnUpdateInt, gc_maxlifetime, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.serialize_handler", "php", PHP_INI_ALL, OnUpdateString, serialize_handler, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.cookie_lifetime", "0", PHP_INI_ALL, OnUpdateInt, cookie_lifetime, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.cookie_path", "/", PHP_INI_ALL, OnUpdateString, cookie_path, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.cookie_domain", "", PHP_INI_ALL, OnUpdateString, cookie_domain, php_ps_globals, ps_globals) + STD_PHP_INI_BOOLEAN("session.use_cookies", "1", PHP_INI_ALL, OnUpdateBool, use_cookies, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.referer_check", "", PHP_INI_ALL, OnUpdateString, extern_referer_chk, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.entropy_file", "", PHP_INI_ALL, OnUpdateString, entropy_file, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.entropy_length", "0", PHP_INI_ALL, OnUpdateInt, entropy_length, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.cache_limiter", "nocache", PHP_INI_ALL, OnUpdateString, cache_limiter, php_ps_globals, ps_globals) + STD_PHP_INI_ENTRY("session.cache_expire", "180", PHP_INI_ALL, OnUpdateInt, cache_expire, php_ps_globals, ps_globals) /* Commented out until future discussion */ /* PHP_INI_ENTRY("session.encode_sources", "globals,track", PHP_INI_ALL, NULL) */ PHP_INI_END() @@ -1229,26 +1229,19 @@ PHP_FUNCTION(session_unset) static void php_rinit_session_globals(PSLS_D) { - PS(mod) = _php_find_ps_module(INI_STR("session.save_handler") PSLS_CC); - PS(serializer) = \ - _php_find_ps_serializer(INI_STR("session.serialize_handler") PSLS_CC); + PS(mod) = _php_find_ps_module(PS(save_handler) PSLS_CC); + PS(serializer) = _php_find_ps_serializer(PS(serialize_handler) PSLS_CC); zend_hash_init(&PS(vars), 0, NULL, NULL, 0); PS(define_sid) = 0; - PS(use_cookies) = INI_BOOL("session.use_cookies"); PS(save_path) = estrdup(INI_STR("session.save_path")); PS(session_name) = estrdup(INI_STR("session.name")); PS(entropy_file) = estrdup(INI_STR("session.entropy_file")); - PS(entropy_length) = INI_INT("session.entropy_length"); - PS(gc_probability) = INI_INT("session.gc_probability"); - PS(gc_maxlifetime) = INI_INT("session.gc_maxlifetime"); PS(extern_referer_chk) = estrdup(INI_STR("session.referer_check")); PS(id) = NULL; - PS(cookie_lifetime) = INI_INT("session.cookie_lifetime"); PS(cookie_path) = estrdup(INI_STR("session.cookie_path")); PS(cookie_domain) = estrdup(INI_STR("session.cookie_domain")); PS(cache_limiter) = estrdup(INI_STR("session.cache_limiter")); - PS(cache_expire) = INI_INT("session.cache_expire"); PS(nr_open_sessions) = 0; PS(mod_data) = NULL; } @@ -1282,7 +1275,7 @@ PHP_RINIT_FUNCTION(session) return SUCCESS; } - if (INI_INT("session.auto_start")) + if (PS(auto_start)) _php_session_start(PSLS_C); return SUCCESS; |
