summaryrefslogtreecommitdiff
path: root/ext/session/mod_user.c
diff options
context:
space:
mode:
authorYasuo Ohgaki <yohgaki@php.net>2016-08-29 05:57:37 +0900
committerYasuo Ohgaki <yohgaki@php.net>2016-08-29 05:57:37 +0900
commit1cf179e4150308d8217d9517408ca5e22b5d607f (patch)
tree9176fa1156823cb17cdeef5f12ee12d01197a0d2 /ext/session/mod_user.c
parentbe0958d291e30dc025f6c519266beeddfc72ea0c (diff)
downloadphp-git-1cf179e4150308d8217d9517408ca5e22b5d607f.tar.gz
Implement RFC Add session_gc() https://wiki.php.net/rfc/session-gc
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)