mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Added session_is_registered(varname) function.
This commit is contained in:
parent
17f725d21a
commit
a6aacfd2b6
2 changed files with 28 additions and 0 deletions
|
@ -96,6 +96,7 @@ PHP_FUNCTION(session_id);
|
||||||
PHP_FUNCTION(session_decode);
|
PHP_FUNCTION(session_decode);
|
||||||
PHP_FUNCTION(session_register);
|
PHP_FUNCTION(session_register);
|
||||||
PHP_FUNCTION(session_unregister);
|
PHP_FUNCTION(session_unregister);
|
||||||
|
PHP_FUNCTION(session_is_registered);
|
||||||
PHP_FUNCTION(session_encode);
|
PHP_FUNCTION(session_encode);
|
||||||
PHP_FUNCTION(session_start);
|
PHP_FUNCTION(session_start);
|
||||||
PHP_FUNCTION(session_destroy);
|
PHP_FUNCTION(session_destroy);
|
||||||
|
|
|
@ -65,6 +65,7 @@ function_entry session_functions[] = {
|
||||||
PHP_FE(session_decode, NULL)
|
PHP_FE(session_decode, NULL)
|
||||||
PHP_FE(session_register, NULL)
|
PHP_FE(session_register, NULL)
|
||||||
PHP_FE(session_unregister, NULL)
|
PHP_FE(session_unregister, NULL)
|
||||||
|
PHP_FE(session_is_registered, NULL)
|
||||||
PHP_FE(session_encode, NULL)
|
PHP_FE(session_encode, NULL)
|
||||||
PHP_FE(session_start, NULL)
|
PHP_FE(session_start, NULL)
|
||||||
PHP_FE(session_destroy, NULL)
|
PHP_FE(session_destroy, NULL)
|
||||||
|
@ -473,6 +474,32 @@ PHP_FUNCTION(session_unregister)
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
|
||||||
|
/* {{{ proto bool session_is_registered(string varname)
|
||||||
|
checks if a variable is registered in session */
|
||||||
|
PHP_FUNCTION(session_is_registered)
|
||||||
|
{
|
||||||
|
pval *p_name;
|
||||||
|
pval *p_var;
|
||||||
|
int ac = ARG_COUNT(ht);
|
||||||
|
PSLS_FETCH();
|
||||||
|
|
||||||
|
if(ac != 1 || getParameters(ht, ac, &p_name) == FAILURE) {
|
||||||
|
WRONG_PARAM_COUNT;
|
||||||
|
}
|
||||||
|
|
||||||
|
convert_to_string(p_name);
|
||||||
|
|
||||||
|
if (zend_hash_find(&PS(vars), p_name->value.str.val, p_name->value.str.len+1,
|
||||||
|
(void **)&p_var) == SUCCESS) {
|
||||||
|
RETURN_TRUE;
|
||||||
|
} else {
|
||||||
|
RETURN_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* }}} */
|
||||||
|
|
||||||
|
|
||||||
/* {{{ proto string session_encode()
|
/* {{{ proto string session_encode()
|
||||||
serializes the current setup and returns the serialized representation */
|
serializes the current setup and returns the serialized representation */
|
||||||
PHP_FUNCTION(session_encode)
|
PHP_FUNCTION(session_encode)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue