Re: [PATCH] session_cache_expire
On Sat, Oct 20, 2001 at 10:01:20AM +0200, Markus Fischer wrote:
> >
> > Sascha and Andrei,
> >
> > Here is a patch which implements a session_cache_expire() in a similar manner
> > to session_cache_limiter(). It applies cleantly to php-4.0.6.
>
> I can't step for other but I guess you'll have to supply it
> against current cvs ....
Ok. Here is a patch against the current CVS.
Please apply.
Cheers,
Anuradha
--
Debian GNU/Linux (kernel 2.4.12)
Don't worry over what other people are thinking about you. They're too
busy worrying over what you are thinking about them.
diff -rua ext.old/session/php_session.h ext/session/php_session.h
--- ext.old/session/php_session.h Mon Oct 22 09:39:33 2001
+++ ext/session/php_session.h Mon Oct 22 09:39:40 2001
@@ -111,6 +111,7 @@
PHP_FUNCTION(session_unset);
PHP_FUNCTION(session_set_save_handler);
PHP_FUNCTION(session_cache_limiter);
+PHP_FUNCTION(session_cache_expire);
PHP_FUNCTION(session_set_cookie_params);
PHP_FUNCTION(session_get_cookie_params);
PHP_FUNCTION(session_write_close);
diff -rua ext.old/session/session.c ext/session/session.c
--- ext.old/session/session.c Mon Oct 22 09:39:27 2001
+++ ext/session/session.c Mon Oct 22 09:48:32 2001
@@ -67,6 +67,7 @@
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)
@@ -1171,6 +1172,29 @@
}
RETVAL_STRING(old, 0);
+}
+/* }}} */
+
+/* {{{ 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);
}
/* }}} */
Thread (4 messages)