summaryrefslogtreecommitdiff
path: root/ext/session/mod_user.c
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2016-09-01 10:12:26 +0900
committerYasuo Ohgaki <yohgaki@php.net>2016-09-01 10:12:26 +0900
commita4a2f66e75b07583267be9f72b6cf968d73977b9 (patch)
tree584f040cd1ecb8c668c6b570af6441fe459f27a2 /ext/session/mod_user.c
parentb36ae7467e3c601e1921f1405c68a6793e956b49 (diff)
downloadphp-git-a4a2f66e75b07583267be9f72b6cf968d73977b9.tar.gz
Revert "Revert "Implement RFC Add session_gc() https://wiki.php.net/rfc/session-gc""
This reverts commit 355c7e7d1cdc180d368c6214ea7605443fc88c92.
Diffstat (limited to 'ext/session/mod_user.c')
-rw-r--r--ext/session/mod_user.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/session/mod_user.c b/ext/session/mod_user.c
index beddce8883..0cdbaf96f9 100644
--- a/ext/session/mod_user.c
+++ b/ext/session/mod_user.c
@@ -176,13 +176,22 @@ PS_DESTROY_FUNC(user)
PS_GC_FUNC(user)
{
zval args[1];
- STDVARS;
+ zval retval;
ZVAL_LONG(&args[0], maxlifetime);
ps_call_handler(&PSF(gc), 1, args, &retval);
- FINISH;
+ if (Z_TYPE(retval) == IS_LONG) {
+ convert_to_long(&retval);
+ return Z_LVAL(retval);
+ }
+ /* This is for older API compatibility */
+ if (Z_TYPE(retval) == IS_TRUE) {
+ return 1;
+ }
+ /* Anything else is some kind of error */
+ return -1; // Error
}
PS_CREATE_SID_FUNC(user)