diff options
author | Kalle Sommer Nielsen <kalle@php.net> | 2010-09-23 04:13:36 +0000 |
---|---|---|
committer | Kalle Sommer Nielsen <kalle@php.net> | 2010-09-23 04:13:36 +0000 |
commit | 1ac15b2f8efa9b40703375fd331ccd5842d5040e (patch) | |
tree | b8b7f7a5997626743965e2e41d50e3fc466ec355 | |
parent | 68b1905702cf060ee1585ee5e626b82b57a9c532 (diff) | |
download | php-git-1ac15b2f8efa9b40703375fd331ccd5842d5040e.tar.gz |
Added TSRMLS macros into php_get_current_user()
-rw-r--r-- | UPGRADING.INTERNALS | 4 | ||||
-rw-r--r-- | ext/mysql/php_mysql.c | 2 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd.c | 2 | ||||
-rw-r--r-- | ext/soap/php_sdl.c | 2 | ||||
-rw-r--r-- | ext/standard/basic_functions.c | 2 | ||||
-rw-r--r-- | main/main.c | 3 | ||||
-rw-r--r-- | main/php.h | 2 |
7 files changed, 9 insertions, 8 deletions
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 18aa31c1e4..bfbfa533e0 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -96,3 +96,7 @@ Use emalloc, emalloc_rel, efree or efree_rel instead. . popen_ex (win32) TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env TSRMLS_DC); + +. php_get_current_user + PHPAPI php_get_current_user(TSRMLS_D) + Call: char *user = php_get_current_user(TSRMLS_C);
\ No newline at end of file diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index ab6c2bb62c..bd0a6e7f07 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -735,7 +735,7 @@ static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) php_error_docref(NULL TSRMLS_CC, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information"); } host_and_port=passwd=NULL; - user=php_get_current_user(); + user=php_get_current_user(TSRMLS_C); hashed_details_length = spprintf(&hashed_details, 0, "mysql__%s_", user); client_flags = CLIENT_INTERACTIVE; } else { diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 36e6bcb028..ef181961a9 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -27,8 +27,6 @@ #include "mysqlnd_statistics.h" #include "mysqlnd_charset.h" #include "mysqlnd_debug.h" -/* for php_get_current_user() */ -#include "ext/standard/basic_functions.h" /* TODO : diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 9d7661aee0..da7dff8b62 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -3192,7 +3192,7 @@ sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC) unsigned char digest[16]; int len = strlen(SOAP_GLOBAL(cache_dir)); time_t cached; - char *user = php_get_current_user(); + char *user = php_get_current_user(TSRMLS_C); int user_len = user ? strlen(user) + 1 : 0; md5str[0] = '\0'; diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 55194145c1..0475cfca29 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4471,7 +4471,7 @@ PHP_FUNCTION(get_current_user) return; } - RETURN_STRING(php_get_current_user(), 1); + RETURN_STRING(php_get_current_user(TSRMLS_C), 1); } /* }}} */ diff --git a/main/main.c b/main/main.c index c03bf73024..56bc3a3b2c 100644 --- a/main/main.c +++ b/main/main.c @@ -1087,10 +1087,9 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ /* {{{ php_get_current_user */ -PHPAPI char *php_get_current_user(void) +PHPAPI char *php_get_current_user(TSRMLS_D) { struct stat *pstat; - TSRMLS_FETCH(); if (SG(request_info).current_user) { return SG(request_info).current_user; diff --git a/main/php.h b/main/php.h index af5c910621..2db910eb56 100644 --- a/main/php.h +++ b/main/php.h @@ -329,7 +329,7 @@ PHPAPI int php_register_internal_extensions(TSRMLS_D); PHPAPI int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC); PHPAPI void php_register_pre_request_shutdown(void (*func)(void *), void *userdata); PHPAPI void php_com_initialize(TSRMLS_D); -PHPAPI char *php_get_current_user(void); +PHPAPI char *php_get_current_user(TSRMLS_D); END_EXTERN_C() /* PHP-named Zend macro wrappers */ |