always properly set, it's a TODO for all of us). This enables us to implement
true 'use' support.
@- Added support for the 'use' keyword - behaves like 'require', but will not
@ use the same file more than once (Andi & Zeev, Zend library)
#if WIN32|WINNT
fp = fopen(file->value.str.val, "rb");
#else
- fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd);
+ fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL);
#endif
if (fp == NULL) {
php_error(E_WARNING, "ImageFontLoad: unable to open file");
#if WIN32|WINNT
fp = fopen(file->value.str.val, "rb");
#else
- fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd);
+ fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL);
#endif
if (!fp) {
php3_strip_url_passwd(fn);
#if WIN32|WINNT
fp = fopen(file->value.str.val, "rb");
#else
- fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd);
+ fp = php3_fopen_wrapper(file->value.str.val, "r", IGNORE_PATH|IGNORE_URL_WIN, &issock, &socketd, NULL);
#endif
if (!fp) {
php3_strip_url_passwd(fn);
case 1: /*send an email*/
{
#if HAVE_SENDMAIL
- if (!_php3_mail(opt,"PHP3 error_log message",message,headers)){
+ if (!_php3_mail(opt,"PHP error_log message",message,headers)){
return FAILURE;
}
#else
return FAILURE;
break;
case 3: /*save to a file*/
- logfile=php3_fopen_wrapper(opt,"a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd);
+ logfile=php3_fopen_wrapper(opt,"a", (IGNORE_URL|ENFORCE_SAFE_MODE), &issock, &socketd, NULL);
if(!logfile) {
php_error(E_WARNING,"error_log: Unable to write to %s",opt);
return FAILURE;
}
convert_to_string_ex(filename);
- fp = php3_fopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd);
+ fp = php3_fopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
if (!fp && !socketd) {
if (issock != BAD_URL) {
char *tmp = estrdup((*filename)->value.str.val);
}
convert_to_string_ex(filename);
- fp = php3_fopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd);
+ fp = php3_fopen_wrapper((*filename)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
if (!fp && !socketd) {
if (issock != BAD_URL) {
char *tmp = estrdup((*filename)->value.str.val);
* We need a better way of returning error messages from
* php3_fopen__wrapper().
*/
- fp = php3_fopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd);
+ fp = php3_fopen_wrapper((*arg1)->value.str.val, p, use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
if (!fp && !socketd) {
if (issock != BAD_URL) {
char *tmp = estrdup((*arg1)->value.str.val);
* We need a better way of returning error messages from
* php3_fopen_wrapper().
*/
- fp = php3_fopen_wrapper((*arg1)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd);
+ fp = php3_fopen_wrapper((*arg1)->value.str.val,"r", use_include_path|ENFORCE_SAFE_MODE, &issock, &socketd, NULL);
if (!fp && !socketd){
if (issock != BAD_URL) {
char *tmp = estrdup((*arg1)->value.str.val);
#include <sys/un.h>
#endif
-static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd);
+static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path);
int _php3_getftpresult(int socketd);
return 0;
}
-PHPAPI FILE *php3_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd)
+PHPAPI FILE *php3_fopen_wrapper(char *path, char *mode, int options, int *issock, int *socketd, char **opened_path)
{
int cm=2; /* checkuid mode: 2 = if file does not exist, check directory */
PLS_FETCH();
be runtime enabled, NOT compile time. */
#if PHP3_URL_FOPEN
if (!(options & IGNORE_URL)) {
- return php3_fopen_url_wrapper(path, mode, options, issock, socketd);
+ return php3_fopen_url_wrapper(path, mode, options, issock, socketd, opened_path);
}
#endif
if (options & USE_PATH && PG(include_path) != NULL) {
- return php3_fopen_with_path(path, mode, PG(include_path), NULL);
+ return php3_fopen_with_path(path, mode, PG(include_path), opened_path);
} else {
if(!strcmp(mode,"r") || !strcmp(mode,"r+")) cm=0;
if (options & ENFORCE_SAFE_MODE && PG(safe_mode) && (!_php3_checkuid(path, cm))) {
* Otherwise, fopen is called as usual and the file pointer is returned.
*/
-static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd)
+static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, int *issock, int *socketd, char **opened_path)
{
url *resource;
int result;
*socketd = 0;
free_url(resource);
if (location[0] != '\0') {
- return php3_fopen_url_wrapper(location, mode, options, issock, socketd);
+ return php3_fopen_url_wrapper(location, mode, options, issock, socketd, opened_path);
} else {
return NULL;
}
free_url(resource);
*issock = 1;
return (fp);
-
} else {
PLS_FETCH();
if (options & USE_PATH) {
- fp = php3_fopen_with_path((char *) path, mode, PG(include_path), NULL);
+ fp = php3_fopen_with_path((char *) path, mode, PG(include_path), opened_path);
} else {
int cm=2;
if(!strcmp(mode,"r") || !strcmp(mode,"r+")) cm=0;
#define IS_SOCKET 1
#define BAD_URL 2
-extern PHPAPI FILE *php3_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd);
+extern PHPAPI FILE *php3_fopen_wrapper(char *filename, char *mode, int options, int *issock, int *socketd, char **opened_path);
PHPAPI FILE *php3_fopen_for_parser(void);
}
-static FILE *php_fopen_wrapper_for_zend(const char *filename)
+static FILE *php_fopen_wrapper_for_zend(const char *filename, char **opened_path)
{
int issock=0, socketd=0;
int old_chunk_size;
FILE *retval;
old_chunk_size = _php3_sock_set_def_chunk_size(1);
- retval=php3_fopen_wrapper((char *) filename, "r", USE_PATH|IGNORE_URL_WIN, &issock, &socketd);
+ retval=php3_fopen_wrapper((char *) filename, "r", USE_PATH|IGNORE_URL_WIN, &issock, &socketd, opened_path);
_php3_sock_set_def_chunk_size(old_chunk_size);
if (issock) {
\r
SOURCE=".\php.ini-dist"\r
# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=".\README.CVS-RULES"\r
+# End Source File\r
# End Group\r
# End Target\r
# End Project\r