summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2000-04-15 14:20:01 +0000
committerAndi Gutmans <andi@php.net>2000-04-15 14:20:01 +0000
commit1665cba750539a4245cf600bacdff3f74fe7bbfd (patch)
treedafdf6338d70127846edf9f25cb6955777e7b6de /main
parent603d5ff5d8e2ecfff40f47f9a1e1be8739cec0db (diff)
downloadphp-git-1665cba750539a4245cf600bacdff3f74fe7bbfd.tar.gz
- Change PHP_ to V_ (directory & file functions)
Diffstat (limited to 'main')
-rw-r--r--main/fopen_wrappers.c20
-rw-r--r--main/main.c2
-rw-r--r--main/php.h20
-rw-r--r--main/php_realpath.c6
-rw-r--r--main/rfc1867.c2
-rw-r--r--main/safe_mode.c2
6 files changed, 26 insertions, 26 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 8be243993c..bce69d9728 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -210,7 +210,7 @@ PHPAPI FILE *php_fopen_wrapper(char *path, char *mode, int options, int *issock,
if (php_check_open_basedir(path)) {
return NULL;
}
- fp = PHP_FOPEN(path, mode);
+ fp = V_FOPEN(path, mode);
if (fp && opened_path) {
*opened_path = expand_filepath(path);
}
@@ -292,7 +292,7 @@ PHPAPI FILE *php_fopen_primary_script(void)
SG(request_info).path_translated = NULL;
return NULL;
}
- fp = PHP_FOPEN(fn, "r");
+ fp = V_FOPEN(fn, "r");
/* refuse to open anything that is not a regular file */
if (fp && (0 > fstat(fileno(fp), &st) || !S_ISREG(st.st_mode))) {
@@ -308,7 +308,7 @@ PHPAPI FILE *php_fopen_primary_script(void)
temp = estrdup(fn);
php_dirname(temp, strlen(temp));
if (*temp) {
- PHP_CHDIR(temp);
+ V_CHDIR(temp);
}
efree(temp);
SG(request_info).path_translated = fn;
@@ -341,7 +341,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
return NULL;
}
if (php_check_open_basedir(filename)) return NULL;
- fp = PHP_FOPEN(filename, mode);
+ fp = V_FOPEN(filename, mode);
if (fp && opened_path) {
*opened_path = expand_filepath(filename);
}
@@ -363,7 +363,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
return NULL;
}
if (php_check_open_basedir(trypath)) return NULL;
- fp = PHP_FOPEN(trypath, mode);
+ fp = V_FOPEN(trypath, mode);
if (fp && opened_path) {
*opened_path = expand_filepath(trypath);
}
@@ -372,7 +372,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
if (php_check_open_basedir(filename)) {
return NULL;
}
- fp = PHP_FOPEN(filename, mode);
+ fp = V_FOPEN(filename, mode);
if (fp && opened_path) {
*opened_path = expand_filepath(filename);
}
@@ -386,7 +386,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
if (php_check_open_basedir(filename)) {
return NULL;
}
- fp = PHP_FOPEN(filename, mode);
+ fp = V_FOPEN(filename, mode);
if (fp && opened_path) {
*opened_path = strdup(filename);
}
@@ -413,7 +413,7 @@ PHPAPI FILE *php_fopen_with_path(char *filename, char *mode, char *path, char **
return NULL;
}
}
- if ((fp = PHP_FOPEN(trypath, mode)) != NULL) {
+ if ((fp = V_FOPEN(trypath, mode)) != NULL) {
if (php_check_open_basedir(trypath)) {
fclose(fp);
efree(pathbuf);
@@ -916,7 +916,7 @@ static FILE *php_fopen_url_wrapper(const char *path, char *mode, int options, in
if (php_check_open_basedir((char *) path)) {
fp = NULL;
} else {
- fp = PHP_FOPEN(path, mode);
+ fp = V_FOPEN(path, mode);
}
}
}
@@ -1010,7 +1010,7 @@ PHPAPI char *expand_filepath(char *filepath)
if (filepath[0] == '.') {
char *cwd = malloc(MAXPATHLEN + 1);
- if (PHP_GETCWD(cwd, MAXPATHLEN)) {
+ if (V_GETCWD(cwd, MAXPATHLEN)) {
char *cwd_end = cwd + strlen(cwd);
if (filepath[1] == '.') { /* parent directory - .. */
diff --git a/main/main.c b/main/main.c
index 9c0eae11ed..1ec9de91f9 100644
--- a/main/main.c
+++ b/main/main.c
@@ -252,7 +252,7 @@ void php_log_err(char *log_message)
return;
}
#endif
- log_file = PHP_FOPEN(PG(error_log), "a");
+ log_file = V_FOPEN(PG(error_log), "a");
if (log_file != NULL) {
time(&error_time);
strftime(error_time_str, 128, "%d-%b-%Y %H:%M:%S", localtime_r(&error_time, &tmbuf));
diff --git a/main/php.h b/main/php.h
index ab47f02162..89968361f1 100644
--- a/main/php.h
+++ b/main/php.h
@@ -289,17 +289,17 @@ PHPAPI int cfg_get_string(char *varname, char **result);
/* Virtual current directory support */
#ifdef VIRTUAL_DIR
-#define PHP_GETCWD(buff, size) virtual_getcwd(buff,size)
-#define PHP_FOPEN(path, mode) virtual_fopen(path, mode)
-#define PHP_CHDIR(path) virtual_chdir(path)
-#define PHP_CHDIR_FILE(path) virtual_chdir_file(path)
-#define PHP_GETWD(buf)
+#define V_GETCWD(buff, size) virtual_getcwd(buff,size)
+#define V_FOPEN(path, mode) virtual_fopen(path, mode)
+#define V_CHDIR(path) virtual_chdir(path)
+#define V_CHDIR_FILE(path) virtual_chdir_file(path)
+#define V_GETWD(buf)
#else
-#define PHP_GETCWD(buff, size) getcwd(buff,size)
-#define PHP_FOPEN(path, mode) fopen(path, mode)
-#define PHP_CHDIR(path) chdir(path)
-#define PHP_CHDIR_FILE(path) chdir_file(path)
-#define PHP_GETWD(buf) getwd(buf)
+#define V_GETCWD(buff, size) getcwd(buff,size)
+#define V_FOPEN(path, mode) fopen(path, mode)
+#define V_CHDIR(path) chdir(path)
+#define V_CHDIR_FILE(path) chdir_file(path)
+#define V_GETWD(buf) getwd(buf)
#endif
#include "zend_constants.h"
diff --git a/main/php_realpath.c b/main/php_realpath.c
index b134b3fce3..d60efa362c 100644
--- a/main/php_realpath.c
+++ b/main/php_realpath.c
@@ -63,7 +63,7 @@ char *php_realpath(char *path, char resolved_path []) {
if ((*workpos == '\\') || (*workpos == '/')) {
/* We start at the root of the current drive */
/* Get the current directory */
- if (PHP_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
+ if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
/* Unable to get cwd */
resolved_path[0] = 0;
return NULL;
@@ -79,7 +79,7 @@ char *php_realpath(char *path, char resolved_path []) {
workpos++;
} else {
/* Use the current directory */
- if (PHP_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
+ if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
/* Unable to get cwd */
resolved_path[0] = 0;
return NULL;
@@ -94,7 +94,7 @@ char *php_realpath(char *path, char resolved_path []) {
workpos++;
} else {
/* Use the current directory */
- if (PHP_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
+ if (V_GETCWD(path_construction, MAXPATHLEN-1) == NULL) {
/* Unable to get cwd */
resolved_path[0] = 0;
return NULL;
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 5116f42208..b35fa7a90f 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -257,7 +257,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr)
} else if ((loc - ptr - 4) <= 0) {
fn = "none";
} else {
- fp = PHP_FOPEN(fn, "wb");
+ fp = V_FOPEN(fn, "wb");
if (!fp) {
php_error(E_WARNING, "File Upload Error - Unable to open temporary file [%s]", fn);
SAFE_RETURN;
diff --git a/main/safe_mode.c b/main/safe_mode.c
index b072552787..ac33ba88db 100644
--- a/main/safe_mode.c
+++ b/main/safe_mode.c
@@ -88,7 +88,7 @@ PHPAPI int php_checkuid(const char *fn, int mode) {
duid = sb.st_uid;
} else {
s = emalloc(MAXPATHLEN+1);
- if (!PHP_GETCWD(s,MAXPATHLEN)) {
+ if (!V_GETCWD(s,MAXPATHLEN)) {
php_error(E_WARNING, "Unable to access current working directory");
return(0);
}