summaryrefslogtreecommitdiff
path: root/ext/session/mod_user_class.c
diff options
context:
space:
mode:
authorStanley Sufficool <ssufficool@php.net>2014-10-20 21:33:32 -0700
committerStanley Sufficool <ssufficool@php.net>2014-10-20 21:33:32 -0700
commit8defcb855ab01d9c8ab4759cb793d80149b55a8c (patch)
treeed51eb30a2cbc92b102557498fb3e4113da1bb07 /ext/session/mod_user_class.c
parent9c7dbb0487f5991fde03873ea8f5e66d6688415f (diff)
parentbaddb1c73a170ef1d2c31bd54cddbc6e1ab596b9 (diff)
downloadphp-git-8defcb855ab01d9c8ab4759cb793d80149b55a8c.tar.gz
Merge branch 'master' of https://git.php.net/push/php-src
* 'master' of https://git.php.net/push/php-src: (6215 commits) Extra comma Moved proxy object support in ASSIGN_ADD (and family) from VM to slow paths of corresponding operators Simplification zend_get_property_info_quick() cleanup and optimization initialize lineno before calling compile file file in phar Use ADDREF instead of DUP, it must be enough. Removed old irrelevant comment fixed compilation error Fix bug #68262: Broken reference across cloned objects export functions needed for phpdbg Fixed compilation Optimized property access handlers. Removed EG(std_property_info). Fixed bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads) Don't make difference between undefined and unaccessible properies when call __get() and family Don't make useless CSE array_pop/array_shift optimization check for zlib headers as well as lib for mysqlnd a realpath cache key can be int or float, catching this News entry for new curl constants News entry for new curl constants ...
Diffstat (limited to 'ext/session/mod_user_class.c')
-rw-r--r--ext/session/mod_user_class.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c
index ea53af9ebe..7e2960cc32 100644
--- a/ext/session/mod_user_class.c
+++ b/ext/session/mod_user_class.c
@@ -1,8 +1,8 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 5 |
+ | PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2013 The PHP Group |
+ | Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -39,7 +39,7 @@
PHP_METHOD(SessionHandler, open)
{
char *save_path = NULL, *session_name = NULL;
- int save_path_len, session_name_len;
+ size_t save_path_len, session_name_len;
PS_SANITY_CHECK;
@@ -71,23 +71,21 @@ PHP_METHOD(SessionHandler, close)
Wraps the old read handler */
PHP_METHOD(SessionHandler, read)
{
- char *key, *val;
- int key_len, val_len;
+ zend_string *val;
+ zend_string *key;
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
return;
}
- if (PS(default_mod)->s_read(&PS(mod_data), key, &val, &val_len TSRMLS_CC) == FAILURE) {
+ if (PS(default_mod)->s_read(&PS(mod_data), key, &val TSRMLS_CC) == FAILURE) {
RETVAL_FALSE;
return;
}
- RETVAL_STRINGL(val, val_len, 1);
- efree(val);
- return;
+ RETURN_STR(val);
}
/* }}} */
@@ -95,16 +93,15 @@ PHP_METHOD(SessionHandler, read)
Wraps the old write handler */
PHP_METHOD(SessionHandler, write)
{
- char *key, *val;
- int key_len, val_len;
+ zend_string *key, *val;
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &key, &key_len, &val, &val_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS", &key, &val) == FAILURE) {
return;
}
- RETVAL_BOOL(SUCCESS == PS(default_mod)->s_write(&PS(mod_data), key, val, val_len TSRMLS_CC));
+ RETURN_BOOL(SUCCESS == PS(default_mod)->s_write(&PS(mod_data), key, val TSRMLS_CC));
}
/* }}} */
@@ -112,16 +109,15 @@ PHP_METHOD(SessionHandler, write)
Wraps the old destroy handler */
PHP_METHOD(SessionHandler, destroy)
{
- char *key;
- int key_len;
+ zend_string *key;
PS_SANITY_CHECK_IS_OPEN;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &key, &key_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &key) == FAILURE) {
return;
}
- RETVAL_BOOL(SUCCESS == PS(default_mod)->s_destroy(&PS(mod_data), key TSRMLS_CC));
+ RETURN_BOOL(SUCCESS == PS(default_mod)->s_destroy(&PS(mod_data), key TSRMLS_CC));
}
/* }}} */
@@ -129,7 +125,7 @@ PHP_METHOD(SessionHandler, destroy)
Wraps the old gc handler */
PHP_METHOD(SessionHandler, gc)
{
- long maxlifetime;
+ zend_long maxlifetime;
int nrdels;
PS_SANITY_CHECK_IS_OPEN;
@@ -138,7 +134,7 @@ PHP_METHOD(SessionHandler, gc)
return;
}
- RETVAL_BOOL(SUCCESS == PS(default_mod)->s_gc(&PS(mod_data), maxlifetime, &nrdels TSRMLS_CC));
+ RETURN_BOOL(SUCCESS == PS(default_mod)->s_gc(&PS(mod_data), maxlifetime, &nrdels TSRMLS_CC));
}
/* }}} */
@@ -146,14 +142,16 @@ PHP_METHOD(SessionHandler, gc)
Wraps the old create_sid handler */
PHP_METHOD(SessionHandler, create_sid)
{
- char *id;
+ zend_string *id;
+
+ PS_SANITY_CHECK;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
- id = PS(default_mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC);
+ id = PS(default_mod)->s_create_sid(&PS(mod_data) TSRMLS_CC);
- RETURN_STRING(id, 0);
+ RETURN_STR(id);
}
/* }}} */