diff --git a/ext/soap/php_sdl.c b/ext/soap/php_sdl.c index 0ac4c2ed7a9bf..41dd43121b815 100644 --- a/ext/soap/php_sdl.c +++ b/ext/soap/php_sdl.c @@ -29,6 +29,11 @@ #include #include #include +#include + +#ifdef HAVE_UNISTD_H +#include +#endif #ifndef O_BINARY # define O_BINARY 0 @@ -3228,7 +3233,12 @@ 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(TSRMLS_C); +#ifdef HAVE_UNISTD_H + char user[10]; /* storage for a 32-bit UID */ + snprintf(user, 10, "%d", getuid()); +#else + char *user = getenv("USERNAME"); +#endif int user_len = user ? strlen(user) + 1 : 0; md5str[0] = '\0';