]> granicus.if.org Git - php/commitdiff
Fixed opendir() thoroughly
authorZeev Suraski <zeev@php.net>
Thu, 29 Jun 2000 21:51:40 +0000 (21:51 +0000)
committerZeev Suraski <zeev@php.net>
Thu, 29 Jun 2000 21:51:40 +0000 (21:51 +0000)
NEWS
ext/standard/basic_functions.c
ext/standard/dir.c
ext/standard/php_dir.h

diff --git a/NEWS b/NEWS
index 53a738874cc234b58d808417ff82dfe01788731b..49f3604545e383c7ee9fb267b3430db54e1126c2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ PHP 4.0                                                                    NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ?? ??? 2000, Version 4.0.2
+- Fixed opendir() again.  It should actually work well continuously now (Zeev)
+- Added three additional arguments to be sent to a user-defined error handler -
+  the filename and line number in which the error occured, and the context
+  (the local variables) of the error (Zeev, Zend Engine)
+- Improved the error handling code to handle an error in a user-defined error
+  handling function (Zeev, Zend Engine)
 - Added an optional parameter to preg_replace() that can be used to
   specify how many replacements to make. (Andrei)
 
index 91ce4a2de38c8a0b00806544a6eb0cf5ce9790db..d332e4b64edf9954d16a147abfc3238a96caa9a6 100644 (file)
@@ -725,6 +725,7 @@ PHP_RINIT_FUNCTION(basic)
        PHP_RINIT(filestat)(INIT_FUNC_ARGS_PASSTHRU);
        PHP_RINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU);
        PHP_RINIT(assert)(INIT_FUNC_ARGS_PASSTHRU);
+       PHP_RINIT(dir)(INIT_FUNC_ARGS_PASSTHRU);
 
        return SUCCESS;
 }
index c2e9a988226769134f0820318e7b9fe5d5d46a09..32674b696feed4a6772dd0d4b1b8c9e1fae5a17f 100644 (file)
@@ -113,9 +113,12 @@ static void _dir_dtor(php_dir *dirp)
        efree(dirp);
 }
 
-static void php_dir_init_globals(DIRLS_D)
+PHP_RINIT_FUNCTION(dir)
 {
+       DIRLS_FETCH();
+
        DIRG(default_dir) = -1;
+       return SUCCESS;
 }
 
 PHP_MINIT_FUNCTION(dir)
@@ -128,9 +131,7 @@ PHP_MINIT_FUNCTION(dir)
        dir_class_entry_ptr = zend_register_internal_class(&dir_class_entry);
 
 #ifdef ZTS
-       dir_globals_id = ts_allocate_id(sizeof(php_dir_globals), (ts_allocate_ctor) php_dir_init_globals, NULL);
-#else
-       php_dir_init_globals(DIRLS_C);
+       dir_globals_id = ts_allocate_id(sizeof(php_dir_globals), NULL, NULL);
 #endif
 
        return SUCCESS;
index 5d636edc1ed1faa181ceec73665df150de786a7d..566a97c713718506608aa6835eb982654d2f5d55 100644 (file)
@@ -23,7 +23,8 @@
 #define _PHP_DIR_H
 
 /* directory functions */
-extern PHP_MINIT_FUNCTION(dir);
+PHP_MINIT_FUNCTION(dir);
+PHP_RINIT_FUNCTION(dir);
 PHP_FUNCTION(opendir);
 PHP_FUNCTION(closedir);
 PHP_FUNCTION(chdir);