Skip to content

Commit 1ac15b2

Browse files
committed
Added TSRMLS macros into php_get_current_user()
1 parent 68b1905 commit 1ac15b2

File tree

7 files changed

+9
-8
lines changed

7 files changed

+9
-8
lines changed

UPGRADING.INTERNALS

+4
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,7 @@ Use emalloc, emalloc_rel, efree or efree_rel instead.
9696

9797
. popen_ex (win32)
9898
TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC);
99+
100+
. php_get_current_user
101+
PHPAPI php_get_current_user(TSRMLS_D)
102+
Call: char *user = php_get_current_user(TSRMLS_C);

ext/mysql/php_mysql.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
735735
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information");
736736
}
737737
host_and_port=passwd=NULL;
738-
user=php_get_current_user();
738+
user=php_get_current_user(TSRMLS_C);
739739
hashed_details_length = spprintf(&hashed_details, 0, "mysql__%s_", user);
740740
client_flags = CLIENT_INTERACTIVE;
741741
} else {

ext/mysqlnd/mysqlnd.c

-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
#include "mysqlnd_statistics.h"
2828
#include "mysqlnd_charset.h"
2929
#include "mysqlnd_debug.h"
30-
/* for php_get_current_user() */
31-
#include "ext/standard/basic_functions.h"
3230

3331
/*
3432
TODO :

ext/soap/php_sdl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3192,7 +3192,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC)
31923192
unsigned char digest[16];
31933193
int len = strlen(SOAP_GLOBAL(cache_dir));
31943194
time_t cached;
3195-
char *user = php_get_current_user();
3195+
char *user = php_get_current_user(TSRMLS_C);
31963196
int user_len = user ? strlen(user) + 1 : 0;
31973197

31983198
md5str[0] = '\0';

ext/standard/basic_functions.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4471,7 +4471,7 @@ PHP_FUNCTION(get_current_user)
44714471
return;
44724472
}
44734473

4474-
RETURN_STRING(php_get_current_user(), 1);
4474+
RETURN_STRING(php_get_current_user(TSRMLS_C), 1);
44754475
}
44764476
/* }}} */
44774477

main/main.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -1087,10 +1087,9 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
10871087

10881088
/* {{{ php_get_current_user
10891089
*/
1090-
PHPAPI char *php_get_current_user(void)
1090+
PHPAPI char *php_get_current_user(TSRMLS_D)
10911091
{
10921092
struct stat *pstat;
1093-
TSRMLS_FETCH();
10941093

10951094
if (SG(request_info).current_user) {
10961095
return SG(request_info).current_user;

main/php.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ PHPAPI int php_register_internal_extensions(TSRMLS_D);
329329
PHPAPI int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC);
330330
PHPAPI void php_register_pre_request_shutdown(void (*func)(void *), void *userdata);
331331
PHPAPI void php_com_initialize(TSRMLS_D);
332-
PHPAPI char *php_get_current_user(void);
332+
PHPAPI char *php_get_current_user(TSRMLS_D);
333333
END_EXTERN_C()
334334

335335
/* PHP-named Zend macro wrappers */

0 commit comments

Comments
 (0)