cvs: /php4 php.h /php4/ext/com COM.c /php4/ext/db db.c /php4/ext/filepro filepro.c /php4/ext/ftp php_ftp.c /php4/ext/gd gd.c /php4/ext/posix posix.c
/php4/ext/standard dir.c filestat.c image.c iptc.c /php4/sapi/isapi php4isapi.c /php4/sapi/servlet servlet.c

From: Date: Thu, 30 Mar 2000 22:57:04 +0000
Subject: cvs: /php4 php.h /php4/ext/com COM.c /php4/ext/db db.c /php4/ext/filepro filepro.c /php4/ext/ftp php_ftp.c /php4/ext/gd gd.c /php4/ext/posix posix.c
/php4/ext/standard dir.c filestat.c image.c iptc.c /php4/sapi/isapi php4isapi.c /php4/sapi/servlet servlet.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-12918@lists.php.net to get a copy of this message
andi Thu Mar 30 14:57:04 2000 EDT Modified files: /php4 php.h /php4/ext/com COM.c /php4/ext/db db.c /php4/ext/filepro filepro.c /php4/ext/ftp php_ftp.c /php4/ext/gd gd.c /php4/ext/posix posix.c /php4/ext/standard dir.c filestat.c image.c iptc.c /php4/sapi/isapi php4isapi.c /php4/sapi/servlet servlet.c Log: - Hopefully got most of them. We also need a chdir_file function like for Apache. Index: php4/php.h diff -u php4/php.h:1.73 php4/php.h:1.74 --- php4/php.h:1.73 Thu Mar 30 14:38:49 2000 +++ php4/php.h Thu Mar 30 14:56:30 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php.h,v 1.73 2000/03/30 22:38:49 andi Exp $ */ +/* $Id: php.h,v 1.74 2000/03/30 22:56:30 andi Exp $ */ #ifndef _PHP_H #define _PHP_H @@ -289,10 +289,12 @@ #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_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_GETWD(buf) getwd(buf) #endif #include "zend_constants.h" Index: php4/ext/com/COM.c diff -u php4/ext/com/COM.c:1.24 php4/ext/com/COM.c:1.25 --- php4/ext/com/COM.c:1.24 Mon Mar 6 10:41:04 2000 +++ php4/ext/com/COM.c Thu Mar 30 14:56:31 2000 @@ -161,7 +161,7 @@ #endif - if (!new_value || (typelib_file=fopen(new_value, "r"))==NULL) { + if (!new_value || (typelib_file=PHP_FOPEN(new_value, "r"))==NULL) { return FAILURE; } Index: php4/ext/db/db.c diff -u php4/ext/db/db.c:1.26 php4/ext/db/db.c:1.27 --- php4/ext/db/db.c:1.26 Sat Mar 11 12:48:44 2000 +++ php4/ext/db/db.c Thu Mar 30 14:56:31 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: db.c,v 1.26 2000/03/11 20:48:44 andi Exp $ */ +/* $Id: db.c,v 1.27 2000/03/30 22:56:31 andi Exp $ */ #define IS_EXT_MODULE #if COMPILE_DL # include "dl/phpdl.h" @@ -122,7 +122,7 @@ #define DBM_CREATE_MODE "a+b" #define DBM_NEW_MODE "w+b" #define DBM_DEFAULT_MODE "r" -#define DBM_OPEN(filename, mode) fopen(filename, mode) +#define DBM_OPEN(filename, mode) PHP_FOPEN(filename, mode) #define DBM_CLOSE(dbf) fclose(dbf) #define DBM_STORE(dbf, key, value, mode) flatfile_store(dbf, key, value, mode) #define DBM_FETCH(dbf, key) flatfile_fetch(dbf, key) Index: php4/ext/filepro/filepro.c diff -u php4/ext/filepro/filepro.c:1.15 php4/ext/filepro/filepro.c:1.16 --- php4/ext/filepro/filepro.c:1.15 Mon Mar 6 10:41:06 2000 +++ php4/ext/filepro/filepro.c Thu Mar 30 14:56:31 2000 @@ -210,7 +210,7 @@ RETURN_FALSE; } - if (!(fp = fopen(workbuf, "r"))) { + if (!(fp = PHP_FOPEN(workbuf, "r"))) { php_error(E_WARNING, "filePro: cannot open map: [%d] %s", errno, strerror(errno)); RETURN_FALSE; @@ -306,7 +306,7 @@ RETURN_FALSE; } - if (!(fp = fopen(workbuf, "r"))) { + if (!(fp = PHP_FOPEN(workbuf, "r"))) { php_error(E_WARNING, "filePro: cannot open key: [%d] %s", errno, strerror(errno)); RETURN_FALSE; @@ -516,7 +516,7 @@ RETURN_FALSE; } - if (!(fp = fopen(workbuf, "r"))) { + if (!(fp = PHP_FOPEN(workbuf, "r"))) { php_error(E_WARNING, "filePro: cannot open key: [%d] %s", errno, strerror(errno)); fclose(fp); Index: php4/ext/ftp/php_ftp.c diff -u php4/ext/ftp/php_ftp.c:1.15 php4/ext/ftp/php_ftp.c:1.16 --- php4/ext/ftp/php_ftp.c:1.15 Mon Mar 6 10:41:07 2000 +++ php4/ext/ftp/php_ftp.c Thu Mar 30 14:56:32 2000 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_ftp.c,v 1.15 2000/03/06 18:41:07 ssb Exp $ */ +/* $Id: php_ftp.c,v 1.16 2000/03/30 22:56:32 andi Exp $ */ #include "php.h" @@ -550,7 +550,7 @@ RETURN_FALSE; } - if ((outfp = fopen(arg2->value.str.val, "w")) == NULL) { + if ((outfp = PHP_FOPEN(arg2->value.str.val, "w")) == NULL) { fclose(tmpfp); php_error(E_WARNING, "error opening %s", arg2->value.str.val); RETURN_FALSE; @@ -634,7 +634,7 @@ convert_to_string(arg3); XTYPE(xtype, arg4); - if ((infp = fopen(arg3->value.str.val, "r")) == NULL) { + if ((infp = PHP_FOPEN(arg3->value.str.val, "r")) == NULL) { php_error(E_WARNING, "error opening %s", arg3->value.str.val); RETURN_FALSE; } Index: php4/ext/gd/gd.c diff -u php4/ext/gd/gd.c:1.46 php4/ext/gd/gd.c:1.47 --- php4/ext/gd/gd.c:1.46 Mon Mar 13 12:36:59 2000 +++ php4/ext/gd/gd.c Thu Mar 30 14:56:32 2000 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: gd.c,v 1.46 2000/03/13 20:36:59 eschmid Exp $ */ +/* $Id: gd.c,v 1.47 2000/03/30 22:56:32 andi Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ @@ -331,8 +331,8 @@ convert_to_string_ex(file); -#if WIN32|WINNT - fp = fopen((*file)->value.str.val, "rb"); +#ifdef PHP_WIN32 + fp = PHP_FOPEN((*file)->value.str.val, "rb"); #else fp = php_fopen_wrapper((*file)->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif @@ -434,8 +434,8 @@ } convert_to_string_ex(file); fn = (*file)->value.str.val; -#if WIN32|WINNT - fp = fopen((*file)->value.str.val, "rb"); +#ifdef PHP_WIN32 + fp = PHP_FOPEN((*file)->value.str.val, "rb"); #else fp = php_fopen_wrapper((*file)->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif @@ -481,7 +481,7 @@ } if (argc == 2) { - fp = fopen(fn, "wb"); + fp = PHP_FOPEN(fn, "wb"); if (!fp) { php_error(E_WARNING, "ImagePng: unable to open %s for writing", fn); RETURN_FALSE; @@ -542,8 +542,8 @@ fn = (*file)->value.str.val; -#if WIN32|WINNT - fp = fopen((*file)->value.str.val, "rb"); +#ifdef PHP_WIN32 + fp = PHP_FOPEN((*file)->value.str.val, "rb"); #else fp = php_fopen_wrapper((*file)->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif @@ -592,7 +592,7 @@ } if (argc == 2) { - fp = fopen(fn, "wb"); + fp = PHP_FOPEN(fn, "wb"); if (!fp) { php_error(E_WARNING, "ImageGif: unable to open %s for writing", fn); RETURN_FALSE; @@ -657,8 +657,8 @@ } convert_to_string_ex(file); fn = (*file)->value.str.val; -#if WIN32|WINNT - fp = fopen((*file)->value.str.val, "rb"); +#ifdef PHP_WIN32 + fp = PHP_FOPEN((*file)->value.str.val, "rb"); #else fp = php_fopen_wrapper((*file)->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL); #endif @@ -709,7 +709,7 @@ } if (argc > 1 && fn && strlen(fn)) { - fp = fopen(fn, "wb"); + fp = PHP_FOPEN(fn, "wb"); if (!fp) { php_error(E_WARNING, "ImageJpeg: unable to open %s for writing", fn); RETURN_FALSE; Index: php4/ext/posix/posix.c diff -u php4/ext/posix/posix.c:1.8 php4/ext/posix/posix.c:1.9 --- php4/ext/posix/posix.c:1.8 Mon Mar 6 10:41:15 2000 +++ php4/ext/posix/posix.c Thu Mar 30 14:56:32 2000 @@ -27,7 +27,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: posix.c,v 1.8 2000/03/06 18:41:15 ssb Exp $ */ +/* $Id: posix.c,v 1.9 2000/03/30 22:56:32 andi Exp $ */ #include "php.h" @@ -134,7 +134,7 @@ static PHP_MINFO_FUNCTION(posix) { - PUTS("$Revision: 1.8 $\n"); + PUTS("$Revision: 1.9 $\n"); } /* {{{ proto int posix_kill(int pid, int sig) @@ -568,7 +568,7 @@ char buffer[MAXPATHLEN]; char *p; - p = getcwd(buffer, MAXPATHLEN); + p = PHP_GETCWD(buffer, MAXPATHLEN); if (!p) { php_error(E_WARNING, "posix_getcwd() failed with '%s'", strerror(errno)); Index: php4/ext/standard/dir.c diff -u php4/ext/standard/dir.c:1.30 php4/ext/standard/dir.c:1.31 --- php4/ext/standard/dir.c:1.30 Mon Mar 6 12:37:11 2000 +++ php4/ext/standard/dir.c Thu Mar 30 14:56:33 2000 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: dir.c,v 1.30 2000/03/06 20:37:11 ssb Exp $ */ +/* $Id: dir.c,v 1.31 2000/03/30 22:56:33 andi Exp $ */ /* {{{ includes/startup/misc */ @@ -210,7 +210,7 @@ } convert_to_string_ex(arg); - ret = chdir((*arg)->value.str.val); + ret = PHP_CHDIR((*arg)->value.str.val); if (ret < 0) { php_error(E_WARNING, "ChDir: %s (errno %d)", strerror(errno), errno); @@ -234,9 +234,9 @@ } #if HAVE_GETCWD - ret = getcwd(path,MAXPATHLEN-1); + ret = PHP_GETCWD(path,MAXPATHLEN-1); #elif HAVE_GETWD - ret = getwd(path); + ret = PHP_GETWD(path); /* * #warning is not ANSI C * #else Index: php4/ext/standard/filestat.c diff -u php4/ext/standard/filestat.c:1.29 php4/ext/standard/filestat.c:1.30 --- php4/ext/standard/filestat.c:1.29 Fri Mar 17 04:41:55 2000 +++ php4/ext/standard/filestat.c Thu Mar 30 14:56:33 2000 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: filestat.c,v 1.29 2000/03/17 12:41:55 hholzgra Exp $ */ +/* $Id: filestat.c,v 1.30 2000/03/30 22:56:33 andi Exp $ */ #include "php.h" #include "safe_mode.h" @@ -387,7 +387,7 @@ /* create the file if it doesn't exist already */ ret = stat((*filename)->value.str.val, &sb); if (ret == -1) { - file = fopen((*filename)->value.str.val, "w"); + file = PHP_FOPEN((*filename)->value.str.val, "w"); if (file == NULL) { php_error(E_WARNING, "unable to create file %s because %s", (*filename)->value.str.val, strerror(errno)); if (newtime) efree(newtime); Index: php4/ext/standard/image.c diff -u php4/ext/standard/image.c:1.13 php4/ext/standard/image.c:1.14 --- php4/ext/standard/image.c:1.13 Sat Feb 19 15:41:21 2000 +++ php4/ext/standard/image.c Thu Mar 30 14:56:33 2000 @@ -15,7 +15,7 @@ | Authors: Rasmus Lerdorf | +----------------------------------------------------------------------+ */ -/* $Id: image.c,v 1.13 2000/02/19 23:41:21 zeev Exp $ */ +/* $Id: image.c,v 1.14 2000/03/30 22:56:33 andi Exp $ */ /* * Based on Daniel Schmitt's imageinfo.c which carried the following * Copyright notice. @@ -338,7 +338,7 @@ /* Check open_basedir */ if (php_check_open_basedir((*arg1)->value.str.val)) return; - if ((fp = fopen((*arg1)->value.str.val,"rb")) == 0) { + if ((fp = PHP_FOPEN((*arg1)->value.str.val,"rb")) == 0) { php_error(E_WARNING, "Unable to open %s", (*arg1)->value.str.val); return; } Index: php4/ext/standard/iptc.c diff -u php4/ext/standard/iptc.c:1.19 php4/ext/standard/iptc.c:1.20 --- php4/ext/standard/iptc.c:1.19 Thu Feb 24 00:39:02 2000 +++ php4/ext/standard/iptc.c Thu Mar 30 14:56:33 2000 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: iptc.c,v 1.19 2000/02/24 08:39:02 eschmid Exp $ */ +/* $Id: iptc.c,v 1.20 2000/03/30 22:56:33 andi Exp $ */ /* * Functions to parse & compse IPTC data. @@ -198,7 +198,7 @@ if (php_check_open_basedir((*jpeg_file)->value.str.val)) RETURN_FALSE; - if ((fp = fopen((*jpeg_file)->value.str.val,"rb")) == 0) { + if ((fp = PHP_FOPEN((*jpeg_file)->value.str.val,"rb")) == 0) { php_error(E_WARNING, "Unable to open %s", (*jpeg_file)->value.str.val); RETURN_FALSE; } Index: php4/sapi/isapi/php4isapi.c diff -u php4/sapi/isapi/php4isapi.c:1.33 php4/sapi/isapi/php4isapi.c:1.34 --- php4/sapi/isapi/php4isapi.c:1.33 Sun Mar 19 10:24:09 2000 +++ php4/sapi/isapi/php4isapi.c Thu Mar 30 14:56:33 2000 @@ -456,7 +456,7 @@ if (path_end) { *path_end = 0; - chdir(SG(request_info).path_translated); + PHP_CHDIR(SG(request_info).path_translated); *path_end = '\\'; } } Index: php4/sapi/servlet/servlet.c diff -u php4/sapi/servlet/servlet.c:1.24 php4/sapi/servlet/servlet.c:1.25 --- php4/sapi/servlet/servlet.c:1.24 Sun Mar 12 07:47:34 2000 +++ php4/sapi/servlet/servlet.c Thu Mar 30 14:56:34 2000 @@ -26,7 +26,7 @@ #include <stdio.h> #include "php.h" -#if WIN32|WINNT +#ifdef PHP_WIN32 #include "win32/time.h" #include "win32/signal.h" #include <process.h> @@ -52,7 +52,7 @@ #include "fopen-wrappers.h" #include "ext/standard/php_standard.h" #include "ext/standard/php_dir.h" -#if WIN32|WINNT +#ifdef PHP_WIN32 #include <io.h> #include <fcntl.h> #include "win32/syslog.h"

« previous php.version4 (#12918) next »