php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #52982
Patch php-trunk-session-status-bools revision 2011-07-26 18:53 UTC by arpad@php.net
Patch php-trunk-session-status revision 2011-07-26 18:52 UTC by arpad@php.net
Patch session.c.patch.txt revision 2010-10-04 07:05 UTC by php dot net at kenman dot net
revision 2010-10-04 02:46 UTC by php dot net at kenman dot net

Patch php-trunk-session-status for Session related Bug #52982

Patch version 2011-07-26 18:52 UTC

Return to Bug #52982 | Download this patch
Patch Revisions:

Developer: arpad@php.net

Index: ext/session/session.c
===================================================================
--- ext/session/session.c	(revision 313745)
+++ ext/session/session.c	(working copy)
@@ -1830,6 +1830,18 @@
 }
 /* }}} */
 
+/* {{{ proto int session_status(void)
+   Returns the current session status */
+static PHP_FUNCTION(session_status)
+{
+	if (zend_parse_parameters_none() == FAILURE) {
+		return;
+	}
+
+	RETURN_LONG(PS(session_status));
+}
+/* }}} */
+
 /* {{{ arginfo */
 ZEND_BEGIN_ARG_INFO_EX(arginfo_session_name, 0, 0, 0)
 	ZEND_ARG_INFO(0, name)
@@ -1903,6 +1915,7 @@
 	PHP_FE(session_set_cookie_params, arginfo_session_set_cookie_params)
 	PHP_FE(session_get_cookie_params, arginfo_session_void)
 	PHP_FE(session_write_close,       arginfo_session_void)
+	PHP_FE(session_status,            arginfo_session_void)
 	PHP_FALIAS(session_commit, session_write_close, arginfo_session_void)
 	PHP_FE_END
 };
@@ -2004,6 +2017,11 @@
 #endif
 	php_session_rfc1867_orig_callback = php_rfc1867_callback;
 	php_rfc1867_callback = php_session_rfc1867_callback;
+
+	REGISTER_LONG_CONSTANT("PHP_SESSION_DISABLED", php_session_disabled, CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("PHP_SESSION_NONE", php_session_none, CONST_CS | CONST_PERSISTENT);
+	REGISTER_LONG_CONSTANT("PHP_SESSION_ACTIVE", php_session_active, CONST_CS | CONST_PERSISTENT);
+
 	return SUCCESS;
 }
 /* }}} */
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 02:01:28 2024 UTC