php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch php-trunk-session-status-bools for Session related Bug #52982Patch version 2011-07-26 18:53 UTC Return to Bug #52982 | Download this patchThis patch renders other patches obsolete Obsolete patches:
Developer: arpad@php.netIndex: ext/session/session.c =================================================================== --- ext/session/session.c (revision 313745) +++ ext/session/session.c (working copy) @@ -1830,6 +1830,30 @@ } /* }}} */ +/* {{{ proto bool session_is_active(void) + Returns whether the session is active */ +static PHP_FUNCTION(session_is_active) +{ + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + RETURN_BOOL(PS(session_status) == php_session_active); +} +/* }}} */ + +/* {{{ proto bool session_is_available(void) + Returns whether the session is available */ +static PHP_FUNCTION(session_is_available) +{ + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + RETURN_BOOL(PS(session_status) != php_session_disabled); +} +/* }}} */ + /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_session_name, 0, 0, 0) ZEND_ARG_INFO(0, name) @@ -1903,6 +1927,8 @@ 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_is_active, arginfo_session_void) + PHP_FE(session_is_available, arginfo_session_void) PHP_FALIAS(session_commit, session_write_close, arginfo_session_void) PHP_FE_END }; |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Thu Nov 21 15:01:30 2024 UTC |