]> granicus.if.org Git - php/commitdiff
Added TSRMLS macros into php_get_current_user()
authorKalle Sommer Nielsen <kalle@php.net>
Thu, 23 Sep 2010 04:13:36 +0000 (04:13 +0000)
committerKalle Sommer Nielsen <kalle@php.net>
Thu, 23 Sep 2010 04:13:36 +0000 (04:13 +0000)
UPGRADING.INTERNALS
ext/mysql/php_mysql.c
ext/mysqlnd/mysqlnd.c
ext/soap/php_sdl.c
ext/standard/basic_functions.c
main/main.c
main/php.h

index 18aa31c1e404ac74f9ee02966b3d2704bfa774e9..bfbfa533e004c465d058eba1adb127a2bf0ce949 100644 (file)
@@ -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
index ab6c2bb62cd4ce9a5c8dfbfd78559e014c65d4a4..bd0a6e7f07df555b5d49540fbb9cf1eca8c2edd6 100644 (file)
@@ -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 {
index 36e6bcb028335de7dd8d298d741e2d85f53f0c67..ef181961a9bff92c25e764f27598cffabb19aac7 100644 (file)
@@ -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 :
index 9d7661aee01c74097db4457a42e1a292d6636abe..da7dff8b62403e1b8e0e5d1e0b9ae91eecb111b3 100644 (file)
@@ -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';
index 55194145c17b719ba0c5420895ac7599aaa06da4..0475cfca290125162e5a09f752408833b5ded729 100644 (file)
@@ -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);
 }
 /* }}} */
 
index c03bf73024e83e13816038975c84c11042f1fa72..56bc3a3b2cc69883e29d3f79624971a90027b2ae 100644 (file)
@@ -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;
index af5c91062131c9805079d779f182e06463c5acf7..2db910eb5631c8254637ed4620cdda31bdd9a7b8 100644 (file)
@@ -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 */