summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-03-23 10:18:00 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-03-26 11:46:00 +0100
commit97cb81ead5b47d9528c48936ed529cd7e8c8f3ef (patch)
tree0362e28a1ac0c5fa9bbbf4dfa887ace18836b426
parent5a09b9fb0f9aa432843673887cde40bfc8737020 (diff)
downloadphp-git-97cb81ead5b47d9528c48936ed529cd7e8c8f3ef.tar.gz
Remove HAVE_REALPATH checks
We do not actually use realpath(), but a custom implementation. Make sure the realpath() function is always available. Closes GH-5290.
-rw-r--r--Zend/zend_virtual_cwd.c4
-rw-r--r--configure.ac1
-rw-r--r--ext/opcache/Optimizer/zend_func_info.c2
-rw-r--r--ext/spl/spl_directory.c4
-rwxr-xr-xext/standard/basic_functions.c2
-rwxr-xr-xext/standard/basic_functions.stub.php2
-rwxr-xr-xext/standard/basic_functions_arginfo.h2
-rw-r--r--ext/standard/file.c2
-rw-r--r--ext/standard/file.h2
-rw-r--r--win32/ioutil.h1
10 files changed, 0 insertions, 22 deletions
diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c
index 2e012237b3..f0cbd971a8 100644
--- a/Zend/zend_virtual_cwd.c
+++ b/Zend/zend_virtual_cwd.c
@@ -65,10 +65,6 @@
# include <winnt.h>
#endif
-#ifndef HAVE_REALPATH
-#define realpath(x,y) strcpy(y,x)
-#endif
-
#define VIRTUAL_CWD_DEBUG 0
#include "TSRM.h"
diff --git a/configure.ac b/configure.ac
index d1d483447f..7e36718342 100644
--- a/configure.ac
+++ b/configure.ac
@@ -582,7 +582,6 @@ nl_langinfo \
poll \
ptsname \
putenv \
-realpath \
rand_r \
scandir \
setitimer \
diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c
index 4fe614be39..7cde2dd34f 100644
--- a/ext/opcache/Optimizer/zend_func_info.c
+++ b/ext/opcache/Optimizer/zend_func_info.c
@@ -321,9 +321,7 @@ static const func_info_t func_infos[] = {
F1("stream_resolve_include_path", MAY_BE_FALSE | MAY_BE_STRING),
F1("get_headers", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
F1("socket_get_status", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_ANY),
-#if HAVE_REALPATH || defined(ZTS)
F1("realpath", MAY_BE_FALSE | MAY_BE_STRING),
-#endif
F1("fsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
FN("pfsockopen", MAY_BE_FALSE | MAY_BE_RESOURCE),
F1("pack", MAY_BE_FALSE | MAY_BE_STRING),
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 05672a14bf..ef7584ac58 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -1284,7 +1284,6 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
}
/* }}} */
-#if HAVE_REALPATH || defined(ZTS)
/* {{{ proto string SplFileInfo::getRealPath()
Return the resolved path */
SPL_METHOD(SplFileInfo, getRealPath)
@@ -1325,7 +1324,6 @@ SPL_METHOD(SplFileInfo, getRealPath)
zend_restore_error_handling(&error_handling);
}
/* }}} */
-#endif
/* {{{ proto SplFileObject SplFileInfo::openFile([string mode = 'r' [, bool use_include_path [, resource context]]])
Open the current file */
@@ -1900,9 +1898,7 @@ static const zend_function_entry spl_SplFileInfo_functions[] = {
SPL_ME(SplFileInfo, isDir, arginfo_class_SplFileInfo_isDir, ZEND_ACC_PUBLIC)
SPL_ME(SplFileInfo, isLink, arginfo_class_SplFileInfo_isLink, ZEND_ACC_PUBLIC)
SPL_ME(SplFileInfo, getLinkTarget, arginfo_class_SplFileInfo_getLinkTarget, ZEND_ACC_PUBLIC)
-#if HAVE_REALPATH || defined(ZTS)
SPL_ME(SplFileInfo, getRealPath, arginfo_class_SplFileInfo_getRealPath, ZEND_ACC_PUBLIC)
-#endif
SPL_ME(SplFileInfo, getFileInfo, arginfo_class_SplFileInfo_getFileInfo, ZEND_ACC_PUBLIC)
SPL_ME(SplFileInfo, getPathInfo, arginfo_class_SplFileInfo_getPathInfo, ZEND_ACC_PUBLIC)
SPL_ME(SplFileInfo, openFile, arginfo_class_SplFileInfo_openFile, ZEND_ACC_PUBLIC)
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 88a7af1c24..d47b9dc740 100755
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -597,9 +597,7 @@ static const zend_function_entry basic_functions[] = { /* {{{ */
PHP_FALIAS(socket_get_status, stream_get_meta_data, arginfo_socket_get_status)
-#if HAVE_REALPATH || defined(ZTS)
PHP_FE(realpath, arginfo_realpath)
-#endif
#ifdef HAVE_FNMATCH
PHP_FE(fnmatch, arginfo_fnmatch)
diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php
index c153b752e6..1186d28f0f 100755
--- a/ext/standard/basic_functions.stub.php
+++ b/ext/standard/basic_functions.stub.php
@@ -877,9 +877,7 @@ function fputcsv($handle, array $fields, string $delimiter = ",", string $enclos
/** @param resource $handle */
function fgetcsv($handle, $length = UNKNOWN, string $delimiter = ",", string $enclosure = '"', string $escape = "\\"): array|false {}
-#if HAVE_REALPATH || defined(ZTS)
function realpath(string $path): string|false {}
-#endif
#ifdef HAVE_FNMATCH
function fnmatch(string $pattern, string $filename, int $flags = 0): bool {}
diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h
index fa5e762c2e..d6fd7acf02 100755
--- a/ext/standard/basic_functions_arginfo.h
+++ b/ext/standard/basic_functions_arginfo.h
@@ -1358,11 +1358,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_fgetcsv, 0, 1, MAY_BE_ARRAY|MAY_
ZEND_ARG_TYPE_INFO(0, escape, IS_STRING, 0)
ZEND_END_ARG_INFO()
-#if HAVE_REALPATH || defined(ZTS)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_realpath, 0, 1, MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, path, IS_STRING, 0)
ZEND_END_ARG_INFO()
-#endif
#if defined(HAVE_FNMATCH)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_fnmatch, 0, 2, _IS_BOOL, 0)
diff --git a/ext/standard/file.c b/ext/standard/file.c
index bf18f0ca30..6c97a00f57 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -2293,7 +2293,6 @@ out:
}
/* }}} */
-#if HAVE_REALPATH || defined(ZTS)
/* {{{ proto string|false realpath(string path)
Return the resolved path */
PHP_FUNCTION(realpath)
@@ -2322,7 +2321,6 @@ PHP_FUNCTION(realpath)
}
}
/* }}} */
-#endif
/* See http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2 */
#define PHP_META_HTML401_CHARS "-_.:"
diff --git a/ext/standard/file.h b/ext/standard/file.h
index bcca86f9a3..dbbaae0f39 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -55,9 +55,7 @@ PHP_FUNCTION(get_meta_tags);
PHP_FUNCTION(flock);
PHP_FUNCTION(fd_set);
PHP_FUNCTION(fd_isset);
-#if HAVE_REALPATH || defined(ZTS)
PHP_FUNCTION(realpath);
-#endif
#ifdef HAVE_FNMATCH
PHP_FUNCTION(fnmatch);
#endif
diff --git a/win32/ioutil.h b/win32/ioutil.h
index 1c2f1a213e..8a522fe2f3 100644
--- a/win32/ioutil.h
+++ b/win32/ioutil.h
@@ -630,7 +630,6 @@ __forceinline static int php_win32_ioutil_link(const char *target, const char *l
return ret;
}/*}}}*/
-#define HAVE_REALPATH 1
PW32IO char *realpath(const char *path, char *resolved);
__forceinline static char *php_win32_ioutil_realpath_ex0(const char *path, char *resolved, PBY_HANDLE_FILE_INFORMATION info)