cvs: php4 /main fopen_wrappers.c network.c php_variables.c safe_mode.c user_streams.c

From: Date: Sun, 25 Aug 2002 18:45:02 +0000
Subject: cvs: php4 /main fopen_wrappers.c network.c php_variables.c safe_mode.c user_streams.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-13668@lists.php.net to get a copy of this message
helly Sun Aug 25 14:45:02 2002 EDT Modified files: /php4/main fopen_wrappers.c network.c php_variables.c safe_mode.c user_streams.c Log: use php_error_docref()

Index: php4/main/fopen_wrappers.c diff -u php4/main/fopen_wrappers.c:1.145 php4/main/fopen_wrappers.c:1.146 --- php4/main/fopen_wrappers.c:1.145 Mon Aug 19 16:47:55 2002 +++ php4/main/fopen_wrappers.c Sun Aug 25 14:45:02 2002 @@ -16,7 +16,7 @@ | Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen_wrappers.c,v 1.145 2002/08/19 20:47:55 zeev Exp $ */ +/* $Id: fopen_wrappers.c,v 1.146 2002/08/25 18:45:02 helly Exp $ */ /* {{{ includes */ @@ -161,7 +161,7 @@ ptr = end; } - php_error(E_WARNING, "open_basedir restriction in effect. File is in wrong directory"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "open_basedir restriction in effect. File is in wrong directory"); efree(pathbuf); errno = EPERM; /* we deny permission to open it */ return -1; @@ -317,7 +317,7 @@ fp = NULL; } if (!fp) { - php_error(E_ERROR, "Unable to open %s", filename); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to open %s", filename); STR_FREE(SG(request_info).path_translated); /* for same reason as above */ return FAILURE; } Index: php4/main/network.c diff -u php4/main/network.c:1.61 php4/main/network.c:1.62 --- php4/main/network.c:1.61 Mon Aug 19 18:59:10 2002 +++ php4/main/network.c Sun Aug 25 14:45:02 2002 @@ -16,7 +16,7 @@ | Streams work by Wez Furlong <wez@thebrainroom.com> | +----------------------------------------------------------------------+ */ -/* $Id: network.c,v 1.61 2002/08/19 22:59:10 wez Exp $ */ +/* $Id: network.c,v 1.62 2002/08/25 18:45:02 helly Exp $ */ /*#define DEBUG_MAIN_NETWORK 1*/ #define MAX_CHUNKS_PER_READ 10 @@ -164,10 +164,10 @@ hints.ai_family = AF_INET; # endif if ((n = getaddrinfo(host, NULL, &hints, &res))) { - php_error(E_WARNING, "php_network_getaddresses: getaddrinfo failed: %s", PHP_GAI_STRERROR(n)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: getaddrinfo failed: %s", PHP_GAI_STRERROR(n)); return 0; } else if (res == NULL) { - php_error(E_WARNING, "php_network_getaddresses: getaddrinfo failed (null result pointer)"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: getaddrinfo failed (null result pointer)"); return 0; } @@ -203,7 +203,7 @@ /* XXX NOT THREAD SAFE */ host_info = gethostbyname(host); if (host_info == NULL) { - php_error(E_WARNING, "php_network_getaddresses: gethostbyname failed"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_network_getaddresses: gethostbyname failed"); return 0; } in = *((struct in_addr *) host_info->h_addr); @@ -447,7 +447,7 @@ sal++; } php_network_freeaddresses(psal); - php_error(E_WARNING, "php_hostconnect: connect failed"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_hostconnect: connect failed"); #ifdef PHP_WIN32 /* Restore the last error */ @@ -649,7 +649,7 @@ /* with ioctlsocket, a non-zero sets nonblocking, a zero sets blocking */ flags = !block; if (ioctlsocket(socketd, FIONBIO, &flags)==SOCKET_ERROR){ - php_error(E_WARNING, "%s", WSAGetLastError()); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", WSAGetLastError()); ret = FALSE; } #else @@ -979,7 +979,7 @@ if (ret) { /* DANGER!: data buffered in stream->readbuf will be forgotten! */ if (TOREAD(sock) > 0) - zend_error(E_WARNING, "%s(): %d bytes of buffered data lost during conversion to FILE*!", get_active_function_name(TSRMLS_C), TOREAD(sock)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d bytes of buffered data lost during conversion to FILE*!", TOREAD(sock)); *ret = fdopen(sock->socket, stream->mode); if (*ret) return SUCCESS; Index: php4/main/php_variables.c diff -u php4/main/php_variables.c:1.41 php4/main/php_variables.c:1.42 --- php4/main/php_variables.c:1.41 Wed Aug 7 23:08:54 2002 +++ php4/main/php_variables.c Sun Aug 25 14:45:02 2002 @@ -16,7 +16,7 @@ | Zeev Suraski <zeev@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: php_variables.c,v 1.41 2002/08/08 03:08:54 yohgaki Exp $ */ +/* $Id: php_variables.c,v 1.42 2002/08/25 18:45:02 helly Exp $ */ #include <stdio.h> #include "php.h" @@ -155,7 +155,7 @@ } else { ip = strchr(ip, ']'); if (!ip) { - php_error(E_WARNING, "Missing ] in %s variable", var); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing ] in %s variable", var); return; } *ip = 0; Index: php4/main/safe_mode.c diff -u php4/main/safe_mode.c:1.48 php4/main/safe_mode.c:1.49 --- php4/main/safe_mode.c:1.48 Fri Aug 16 05:50:24 2002 +++ php4/main/safe_mode.c Sun Aug 25 14:45:02 2002 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> | +----------------------------------------------------------------------+ */ -/* $Id: safe_mode.c,v 1.48 2002/08/16 09:50:24 wez Exp $ */ +/* $Id: safe_mode.c,v 1.49 2002/08/25 18:45:02 helly Exp $ */ #include "php.h" @@ -86,10 +86,10 @@ ret = VCWD_STAT(path, &sb); if (ret < 0) { if (mode == CHECKUID_DISALLOW_FILE_NOT_EXISTS) { - php_error(E_WARNING, "Unable to access %s", filename); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to access %s", filename); return 0; } else if (mode == CHECKUID_ALLOW_FILE_NOT_EXISTS) { - php_error(E_WARNING, "Unable to access %s", filename); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to access %s", filename); return 1; } nofile = 1; @@ -130,7 +130,7 @@ /* check directory */ ret = VCWD_STAT(path, &sb); if (ret < 0) { - php_error(E_WARNING, "Unable to access %s", filename); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to access %s", filename); return 0; } duid = sb.st_uid; @@ -165,9 +165,9 @@ } if (PG(safe_mode_gid)) { - php_error(E_WARNING, "SAFE MODE Restriction in effect. The script whose uid/gid is %ld/%ld is not allowed to access %s owned by uid/gid %ld/%ld", php_getuid(), php_getgid(), filename, uid, gid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect. The script whose uid/gid is %ld/%ld is not allowed to access %s owned by uid/gid %ld/%ld", php_getuid(), php_getgid(), filename, uid, gid); } else { - php_error(E_WARNING, "SAFE MODE Restriction in effect. The script whose uid is %ld is not allowed to access %s owned by uid %ld", php_getuid(), filename, uid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect. The script whose uid is %ld is not allowed to access %s owned by uid %ld", php_getuid(), filename, uid); } return 0; } Index: php4/main/user_streams.c diff -u php4/main/user_streams.c:1.16 php4/main/user_streams.c:1.17 --- php4/main/user_streams.c:1.16 Sat May 4 13:42:58 2002 +++ php4/main/user_streams.c Sun Aug 25 14:45:02 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: user_streams.c,v 1.16 2002/05/04 17:42:58 sas Exp $ */ +/* $Id: user_streams.c,v 1.17 2002/08/25 18:45:02 helly Exp $ */ #include "php.h" #include "php_globals.h" @@ -209,7 +209,7 @@ } if (!PG(allow_url_fopen)) { - zend_error(E_WARNING, "%s(): fopen wrappers have been disabled", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "fopen wrappers have been disabled"); RETURN_FALSE; } @@ -230,7 +230,7 @@ RETURN_TRUE; } } else { - zend_error(E_WARNING, "%s(): class '%s' is undefined", get_active_function_name(TSRMLS_C), + php_error_docref(NULL TSRMLS_CC, E_WARNING, "class '%s' is undefined", classname); } @@ -272,7 +272,7 @@ /* don't allow strange buffer overruns due to bogus return */ if (didwrite > count) { - zend_error(E_WARNING, "%s::" USERSTREAM_WRITE " - wrote %d bytes more data than requested (%d written, %d max)", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_WRITE " - wrote %d bytes more data than requested (%d written, %d max)", us->wrapper->classname, didwrite - count, didwrite, count); didwrite = count; @@ -328,7 +328,7 @@ if (retval && Z_TYPE_P(retval) == IS_STRING) { didread = Z_STRLEN_P(retval); if (didread > count) { - zend_error(E_WARNING, "%s::" USERSTREAM_READ " - read %d bytes more data than requested (%d read, %d max) - excess data will be lost", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_READ " - read %d bytes more data than requested (%d read, %d max) - excess data will be lost", us->wrapper->classname, didread - count, didread, count); didread = count; } @@ -484,7 +484,7 @@ if (retval && Z_TYPE_P(retval) == IS_STRING) { didread = Z_STRLEN_P(retval); if (didread > size) { - zend_error(E_WARNING, "%s::" USERSTREAM_GETS " - read more data than requested; some data will be lost", + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_GETS " - read more data than requested; some data will be lost", us->wrapper->classname); didread = size; }
« previous php.cvs (#13668) next »