com php-src: Revert "Implemented Request #11100 (session_gc () function).": ext/session/session.c
| From: | Yasuo Ohgaki | Date: | Wed, 12 Mar 2014 21:30:32 +0000 |
| Subject: | com php-src: Revert "Implemented Request #11100 (session_gc () function).": ext/session/session.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76474@lists.php.net to get a copy of this message | ||
Commit: 7dec5789fe67f3b5540b54c9747f9c7a10c1931d
Author: Yasuo Ohgaki <yohgaki@php.net> Thu, 13 Mar 2014 06:30:32 +0900
Parents: 0bf5bce6ad8184efc22495bd4eb15fcc9fe8dc46
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7dec5789fe67f3b5540b54c9747f9c7a10c1931d
Log:
Revert "Implemented Request #11100 (session_gc() function)."
This reverts commit 54a42f0d0cf85fe0c032009b1f601427ae1c8566.
Conflicts:
ext/session/tests/session_gc_basic.phpt
Bugs:
https://bugs.php.net/11100
Changed paths:
M ext/session/session.c
Diff:
diff --git a/ext/session/session.c b/ext/session/session.c
index 38aee7d..d6a60fe 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -2192,39 +2192,6 @@ static PHP_FUNCTION(session_status)
}
/* }}} */
-/* {{{ proto int session_gc([int maxlifetime])
- Execute garbage collection returns number of deleted data */
-static PHP_FUNCTION(session_gc)
-{
- int nrdels = -1;
- long maxlifetime = PS(gc_maxlifetime);
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &maxlifetime) == FAILURE)
{
- return;
- }
-
- /* Session must be active to have PS(mod) */
- if (PS(session_status) != php_session_active) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to garbage collect without active
session");
- RETURN_FALSE;
- }
-
- if (!PS(mod) || !PS(mod)->s_gc) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session save handler does not have gc()");
- RETURN_FALSE;
- }
- PS(mod)->s_gc(&PS(mod_data), maxlifetime, &nrdels TSRMLS_CC);
-
- if (nrdels < 0) {
- /* Files save handler return -1 if there is not a permission to remove.
- Save handlder should return negative nrdels when something wrong. */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session gc failed. Check permission or session
storage");
- RETURN_FALSE;
- }
- RETURN_LONG((long)nrdels);
-}
-/* }}} */
-
/* {{{ proto void session_register_shutdown(void)
Registers session_write_close() as a shutdown function */
static PHP_FUNCTION(session_register_shutdown)
@@ -2320,10 +2287,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_session_set_cookie_params, 0, 0, 1)
ZEND_ARG_INFO(0, httponly)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO(arginfo_session_gc, 0)
- ZEND_ARG_INFO(0, maxlifetime)
-ZEND_END_ARG_INFO()
-
ZEND_BEGIN_ARG_INFO(arginfo_session_class_open, 0)
ZEND_ARG_INFO(0, save_path)
ZEND_ARG_INFO(0, session_name)
@@ -2376,7 +2339,6 @@ static const zend_function_entry session_functions[] = {
PHP_FE(session_abort, arginfo_session_void)
PHP_FE(session_reset, arginfo_session_void)
PHP_FE(session_status, arginfo_session_void)
- PHP_FE(session_gc, arginfo_session_gc)
PHP_FE(session_register_shutdown, arginfo_session_void)
PHP_FALIAS(session_commit, session_write_close, arginfo_session_void)
PHP_FE_END