|
|
| version 1.1.1.3, 2013/07/22 01:32:11 | version 1.1.1.5, 2014/06/15 20:04:01 |
|---|---|
| Line 2 | Line 2 |
| +----------------------------------------------------------------------+ | +----------------------------------------------------------------------+ |
| | PHP Version 5 | | | PHP Version 5 | |
| +----------------------------------------------------------------------+ | +----------------------------------------------------------------------+ |
| | 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, | | | 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 | | | that is bundled with this package in the file LICENSE, and is | |
| Line 115 | Line 115 |
| #endif | #endif |
| /* }}} */ | /* }}} */ |
| #ifndef S_ISREG | |
| #define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG) | |
| #endif | |
| PHPAPI int (*php_register_internal_extensions_func)(TSRMLS_D) = php_register_internal_extensions; | PHPAPI int (*php_register_internal_extensions_func)(TSRMLS_D) = php_register_internal_extensions; |
| #ifndef ZTS | #ifndef ZTS |
| Line 276 static void php_binary_init(TSRMLS_D) | Line 280 static void php_binary_init(TSRMLS_D) |
| if ((envpath = getenv("PATH")) != NULL) { | if ((envpath = getenv("PATH")) != NULL) { |
| char *search_dir, search_path[MAXPATHLEN]; | char *search_dir, search_path[MAXPATHLEN]; |
| char *last = NULL; | char *last = NULL; |
| struct stat s; | |
| path = estrdup(envpath); | path = estrdup(envpath); |
| search_dir = php_strtok_r(path, ":", &last); | search_dir = php_strtok_r(path, ":", &last); |
| while (search_dir) { | while (search_dir) { |
| snprintf(search_path, MAXPATHLEN, "%s/%s", search_dir, sapi_module.executable_location); | snprintf(search_path, MAXPATHLEN, "%s/%s", search_dir, sapi_module.executable_location); |
| if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location, X_OK)) { | if (VCWD_REALPATH(search_path, binary_location) && !VCWD_ACCESS(binary_location, X_OK) && VCWD_STAT(binary_location, &s) == 0 && S_ISREG(s.st_mode)) { |
| found = 1; | found = 1; |
| break; | break; |
| } | } |
| Line 784 PHPAPI void php_verror(const char *docref, const char | Line 789 PHPAPI void php_verror(const char *docref, const char |
| /* no docref given but function is known (the default) */ | /* no docref given but function is known (the default) */ |
| if (!docref && is_function) { | if (!docref && is_function) { |
| int doclen; | int doclen; |
| while (*function == '_') { | |
| function++; | |
| } | |
| if (space[0] == '\0') { | if (space[0] == '\0') { |
| doclen = spprintf(&docref_buf, 0, "function.%s", function); | doclen = spprintf(&docref_buf, 0, "function.%s", function); |
| } else { | } else { |
| Line 1523 int php_request_startup(TSRMLS_D) | Line 1531 int php_request_startup(TSRMLS_D) |
| int retval = SUCCESS; | int retval = SUCCESS; |
| #ifdef HAVE_DTRACE | #ifdef HAVE_DTRACE |
| DTRACE_REQUEST_STARTUP(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), SAFE_FILENAME(SG(request_info).request_method)); | DTRACE_REQUEST_STARTUP(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), (char *)SAFE_FILENAME(SG(request_info).request_method)); |
| #endif /* HAVE_DTRACE */ | #endif /* HAVE_DTRACE */ |
| #ifdef PHP_WIN32 | #ifdef PHP_WIN32 |
| Line 1833 void php_request_shutdown(void *dummy) | Line 1841 void php_request_shutdown(void *dummy) |
| #endif | #endif |
| #ifdef HAVE_DTRACE | #ifdef HAVE_DTRACE |
| DTRACE_REQUEST_SHUTDOWN(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), SAFE_FILENAME(SG(request_info).request_method)); | DTRACE_REQUEST_SHUTDOWN(SAFE_FILENAME(SG(request_info).path_translated), SAFE_FILENAME(SG(request_info).request_uri), (char *)SAFE_FILENAME(SG(request_info).request_method)); |
| #endif /* HAVE_DTRACE */ | #endif /* HAVE_DTRACE */ |
| } | } |
| /* }}} */ | /* }}} */ |