summaryrefslogtreecommitdiff
path: root/ext/session/mod_user_class.c
diff options
context:
space:
mode:
authorArpad Ray <arraypad@gmail.com>2013-06-27 11:27:49 +0100
committerArpad Ray <arraypad@gmail.com>2013-06-27 12:29:44 +0100
commitb66c14b0c82ad0ed4ea117f7b789eef6e3a95ef4 (patch)
tree3717bcbf6d8632c480bd1f059ee235db1b55090d /ext/session/mod_user_class.c
parent60bbc78bde18d2d21cd4c0eaf86d348368c8aca9 (diff)
parent6809c388b5d8bb03515f7b4ba391724f9a8df8e0 (diff)
downloadphp-git-b66c14b0c82ad0ed4ea117f7b789eef6e3a95ef4.tar.gz
Merge PR 109 - Add create_sid to session_set_save_handler and SessionHandler
Allows user session handlers to create session IDs by adding an optional 7th argument to session_set_save_handler() and a create_sid() method to SessionHandler.
Diffstat (limited to 'ext/session/mod_user_class.c')
-rw-r--r--ext/session/mod_user_class.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c
index 1ed1e7bbd5..ea53af9ebe 100644
--- a/ext/session/mod_user_class.c
+++ b/ext/session/mod_user_class.c
@@ -141,3 +141,19 @@ PHP_METHOD(SessionHandler, gc)
RETVAL_BOOL(SUCCESS == PS(default_mod)->s_gc(&PS(mod_data), maxlifetime, &nrdels TSRMLS_CC));
}
/* }}} */
+
+/* {{{ proto char SessionHandler::create_sid()
+ Wraps the old create_sid handler */
+PHP_METHOD(SessionHandler, create_sid)
+{
+ char *id;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ id = PS(default_mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC);
+
+ RETURN_STRING(id, 0);
+}
+/* }}} */