From: Andrei Zmievski Date: Mon, 22 Oct 2001 15:18:06 +0000 (+0000) Subject: @- Added session_cache_expire() function. (patch from anuradha@gnu.org) X-Git-Tag: POST_PARAMETER_PARSING_API~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1beb9b21e50bf78d906dcd0a5a2644925e606d66;p=php @- Added session_cache_expire() function. (patch from anuradha@gnu.org) --- diff --git a/ext/session/session.c b/ext/session/session.c index bc9e0cc372..9a9708a6cc 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -67,6 +67,7 @@ function_entry session_functions[] = { PHP_FE(session_unset, NULL) PHP_FE(session_set_save_handler, NULL) PHP_FE(session_cache_limiter, NULL) + PHP_FE(session_cache_expire, NULL) PHP_FE(session_set_cookie_params, NULL) PHP_FE(session_get_cookie_params, NULL) PHP_FE(session_write_close, NULL) @@ -1174,6 +1175,29 @@ PHP_FUNCTION(session_cache_limiter) } /* }}} */ +/* {{{ proto int session_cache_expire([int new_cache_expire]) + Return the current cache expire. If new_cache_expire is given, the current cache_expire is replaced with new_cache_expire */ +PHP_FUNCTION(session_cache_expire) +{ + zval **p_cache_expire; + int ac = ZEND_NUM_ARGS(); + long old; + PSLS_FETCH(); + + old = PS(cache_expire); + + if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &p_cache_expire) == FAILURE) + WRONG_PARAM_COUNT; + + if (ac == 1) { + convert_to_long_ex(p_cache_expire); + PS(cache_expire) = Z_LVAL_PP(p_cache_expire); + } + + RETVAL_LONG(old); +} +/* }}} */ + /* {{{ static void php_register_var(zval** entry TSRMLS_DC) */ static void php_register_var(zval** entry TSRMLS_DC) {