PHP 4 NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? May 2003, Version 4.3.2
-- Improved the engine to use POSIX/socket IO where feasible. (Sascha)
- Syncronized bundled GD library with GD 2.0.12. (Ilia)
- Removed support for GDLIB version 1.x.x (php_gd.dll) on Windows. (Edin)
- Enabled read-only GIF support in the bundled GDLIB (php_gd2.dll) on Windows.
PHP_FUNCTION(parse_ini_file)
{
zval **filename, **process_sections;
- zend_file_handle fh = {0};
+ zend_file_handle fh;
zend_ini_parser_cb_t ini_parser_cb;
switch (ARG_COUNT(ht)) {
char *browscap = INI_STR("browscap");
if (browscap) {
- zend_file_handle fh = {0};
+ zend_file_handle fh;
if (zend_hash_init(&browser_hash, 0, NULL, (dtor_func_t) browscap_entry_dtor, 1)==FAILURE) {
return FAILURE;
}
/* }}} */
-
-/* {{{ php_open_wrapper_for_zend
- */
-static zend_bool php_open_wrapper_for_zend(const char *filename, struct _zend_file_handle *fh)
-{
- TSRMLS_FETCH();
-
- return php_stream_open_wrapper_as_file_handle((char *)filename, "rb", ENFORCE_SAFE_MODE|USE_PATH|IGNORE_URL_WIN|REPORT_ERRORS|STREAM_OPEN_FOR_INCLUDE, fh);
-}
-/* }}} */
-
/* {{{ php_get_configuration_directive_for_zend
*/
static int php_get_configuration_directive_for_zend(char *name, uint name_length, zval *contents)
zuf.printf_function = php_printf;
zuf.write_function = php_body_write_wrapper;
zuf.fopen_function = php_fopen_wrapper_for_zend;
- zuf.open_function = php_open_wrapper_for_zend;
zuf.message_handler = php_message_handler_for_zend;
zuf.block_interruptions = sapi_module.block_interruptions;
zuf.unblock_interruptions = sapi_module.unblock_interruptions;
PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
{
zend_file_handle *prepend_file_p, *append_file_p;
- zend_file_handle prepend_file = {0}, append_file = {0};
+ zend_file_handle prepend_file, append_file;
#if HAVE_BROKEN_GETCWD
int old_cwd_fd = -1;
#else
int safe_mode_state;
char *open_basedir;
int free_ini_search_path=0;
- zend_file_handle fh = {0};
+ zend_file_handle fh;
struct stat sb;
char ini_file[MAXPATHLEN];
char *p;
PG(safe_mode) = 0;
PG(open_basedir) = NULL;
+ memset(&fh, 0, sizeof(fh));
/* Check if php_ini_path_override is a file */
if (!sapi_module.php_ini_ignore) {
if (sapi_module.php_ini_path_override && sapi_module.php_ini_path_override[0]) {
static int
php_ns_module_main(TSRMLS_D)
{
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
TSRMLS_FETCH();
if (AP(in_request)) {
- zend_file_handle fh = {0};
+ zend_file_handle fh;
fh.filename = r->filename;
fh.opened_path = NULL;
int apache_php_module_main(request_rec *r, int display_source_mode TSRMLS_DC)
{
int retval = OK;
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
if (php_request_startup(TSRMLS_C) == FAILURE) {
return FAILURE;
}
for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b)) {
- zend_file_handle zfd = {0};
+ zend_file_handle zfd;
if (!ctx->request_processed && APR_BUCKET_IS_FILE(b)) {
const char *path;
php_get_highlight_struct(&syntax_highlighter_ini);
highlight_file((char *)r->filename, &syntax_highlighter_ini TSRMLS_CC);
} else {
- zend_file_handle zfd = {0};
+ zend_file_handle zfd;
zfd.type = ZEND_HANDLE_FILENAME;
zfd.filename = (char *) r->filename;
static void php_caudium_module_main(php_caudium_request *ureq)
{
int res;
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
#ifndef USE_PIKE_LEVEL_THREADS
struct thread_state *state;
extern struct program *thread_id_prog;
{
int exit_status = SUCCESS;
int cgi = 0, c, i, len;
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
int retval = FAILURE;
char *s;
/* temporary locals */
{
int exit_status = SUCCESS;
int c;
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
/* temporary locals */
int behavior=PHP_MODE_STANDARD;
int no_headers=1;
ap_php_optind++;
}
if (script_file) {
- if (!(file_handle.handle.fd = VCWD_OPEN(script_file, O_RDONLY | O_BINARY))) {
+ if (!(file_handle.handle.fp = VCWD_FOPEN(script_file, "rb"))) {
SG(headers_sent) = 1;
SG(request_info).no_headers = 1;
php_printf("Could not open input file: %s.\n", script_file);
file_handle.filename = script_file;
script_filename = script_file;
/* #!php support */
- c = 0;
- read(file_handle.handle.fd, &c, 1);
+ c = fgetc(file_handle.handle.fp);
if (c == '#') {
while (c != 10 && c != 13) {
- /* skip to end of line */
- if (read(file_handle.handle.fd, &c, 1) != 1)
- break;
+ c = fgetc(file_handle.handle.fp); /* skip to end of line */
}
/* handle situations where line is terminated by \r\n */
if (c == 13) {
- if (read(file_handle.handle.fd, &c, 1) == 1 && c != 10) {
+ if (fgetc(file_handle.handle.fp) != 10) {
long pos = ftell(file_handle.handle.fp);
fseek(file_handle.handle.fp, pos - 1, SEEK_SET);
}
}
is_hashbang = 1;
} else {
- lseek(file_handle.handle.fd, 0, SEEK_SET);
+ rewind(file_handle.handle.fp);
}
} else {
file_handle.filename = "-";
- file_handle.handle.fd = STDIN_FILENO;
+ file_handle.handle.fp = stdin;
}
- file_handle.type = ZEND_HANDLE_FD;
+ file_handle.type = ZEND_HANDLE_FP
file_handle.opened_path = NULL;
file_handle.free_filename = 0;
php_self = file_handle.filename;
if (php_request_startup(TSRMLS_C)==FAILURE) {
*arg_excp = arg_free;
- zend_file_handle_dtor(&file_handle);
+ fclose(file_handle.handle.fp);
SG(headers_sent) = 1;
SG(request_info).no_headers = 1;
php_request_shutdown((void *) 0);
case PHP_MODE_STRIP:
if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) {
zend_strip(TSRMLS_C);
- zend_file_handle_dtor(&file_handle);
+ fclose(file_handle.handle.fp);
}
goto out;
break;
if (open_file_for_scanning(&file_handle TSRMLS_CC)==SUCCESS) {
php_get_highlight_struct(&syntax_highlighter_ini);
zend_highlight(&syntax_highlighter_ini TSRMLS_CC);
- zend_file_handle_dtor(&file_handle);
+ fclose(file_handle.handle.fp);
}
goto out;
}
case PHP_MODE_INDENT:
open_file_for_scanning(&file_handle TSRMLS_CC);
zend_indent();
- zend_file_handle_dtor(&file_handle);
+ fclose(file_handle.handle.fp);
goto out;
break;
#endif
DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB)
{
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
zend_bool stack_overflown=0;
#ifdef PHP_ENABLE_SEH
LPEXCEPTION_POINTERS e;
int nsapi_module_main(NSLS_D TSRMLS_DC)
{
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
if (php_request_startup(TSRMLS_C) == FAILURE) {
return FAILURE;
int php_doit(TSRMLS_D TSRMLS_DC)
{
struct stat sb;
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
struct httpinfo *hip = PHG(cip)->hip;
TSRMLS_FETCH();
DWORD PHP4_wrapper(LPCONTROL_BLOCK lpCB)
{
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
int iRet = PIAPI_COMPLETED;
TSRMLS_FETCH();
{
int res, len;
char *dir;
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
#ifdef ROXEN_USE_ZTS
GET_THIS();
#endif
jstring contentType, jint contentLength,
jstring authUser, jboolean display_source_mode)
{
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
int retval;
#ifndef VIRTUAL_DIR
char cwd[MAXPATHLEN];
static void thttpd_module_main(int show_source TSRMLS_DC)
{
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
if (php_request_startup(TSRMLS_C) == FAILURE) {
return;
static void tux_module_main(TSRMLS_D)
{
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
file_handle.type = ZEND_HANDLE_FILENAME;
file_handle.filename = SG(request_info).path_translated;
static void webjames_module_main(TSRMLS_D)
{
- zend_file_handle file_handle = {0};
+ zend_file_handle file_handle;
FILE *fp=NULL;
char *path;