|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
28 Jun 2000, Version 4.0.1
-- Make --enable-discard-path work again. (Andi)
+- Fixed a bug in opendir(), which prevented readdir() from working properly if
+ the $dir argument wasn't explicitly specified (Zeev)
+- Made --enable-discard-path work again. (Andi)
- Removed 8KB limit on line length of the file() function (Zeev)
- Disabled dl() when PHP is being used as a module inside a multithreaded web
server - it didn't work before, and caused weird results (Zeev)
- Clean up constants in flock() function and add optional 3rd arg which
is set to true on EWOULDBLOCK (Rasmus)
- Added functions pg_loimport(), pg_loexport(). (Jouni)
-- Add SWF support to getimagesize() function (Derick Rethans)
-- Add support for both indexed and non-indexed arrays of file uploads
+- Added SWF support to getimagesize() function (Derick Rethans)
+- Added support for both indexed and non-indexed arrays of file uploads
eg. name="file[]" type="file" (Rasmus)
- Added create_function(), which gives the ability to create functions
on-the-fly (Zeev, Zend Engine)
jpeg images it generates. (Rasmus)
- Fixed basename() bug where "file.ext///" would not return the same
as "/path/file.ext///" (Rasmus)
-- Add the swf_ortho function. (Sterling)
+- Added the swf_ortho function. (Sterling)
- Moved to virtual current working directory support. This highly improves the
functionality and stability of multi-threaded versions of PHP (Andi, Sascha)
} php_dir_globals;
#ifdef ZTS
-#define DIR(v) (dir_globals->v)
+#define DIRG(v) (dir_globals->v)
#define DIRLS_FETCH() php_dir_globals *dir_globals = ts_resource(dir_globals_id)
+#define DIRLS_D php_dir_globals *dir_globals
+#define DIRLS_DC , DIRLS_D
+#define DIRLS_C dir_globals
+#define DIRLS_CC , DIRLS_C
int dir_globals_id;
#else
-#define DIR(v) (dir_globals.v)
+#define DIRG(v) (dir_globals.v)
#define DIRLS_FETCH()
+#define DIRLS_D
+#define DIRLS_DC
+#define DIRLS_C
+#define DIRLS_CC
php_dir_globals dir_globals;
#endif
} \
ZEND_FETCH_RESOURCE(dirp,php_dir *,tmp,-1, "Directory", le_dirp); \
} else { \
- ZEND_FETCH_RESOURCE(dirp,php_dir *,0,DIR(default_dir), "Directory", le_dirp); \
+ ZEND_FETCH_RESOURCE(dirp,php_dir *,0,DIRG(default_dir), "Directory", le_dirp); \
} \
} else if ((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1, &id) == FAILURE) { \
WRONG_PARAM_COUNT; \
};
+static void php_set_default_dir(int id DIRLS_DC)
+{
+ if (DIRG(default_dir)!=-1) {
+ zend_list_delete(DIRG(default_dir));
+ }
+ DIRG(default_dir) = id;
+ zend_list_addref(id);
+}
+
+
static void _dir_dtor(php_dir *dirp)
{
closedir(dirp->dir);
efree(dirp);
}
-#ifdef ZTS
-static void php_dir_init_globals(php_dir_globals *dir_globals)
+static void php_dir_init_globals(DIRLS_D)
{
- DIR(default_dir) = 0;
+ DIRG(default_dir) = -1;
}
-#endif
PHP_MINIT_FUNCTION(dir)
{
#ifdef ZTS
dir_globals_id = ts_allocate_id(sizeof(php_dir_globals), (ts_allocate_ctor) php_dir_init_globals, NULL);
#else
- DIR(default_dir) = 0;
+ php_dir_init_globals(DIRLS_C);
#endif
return SUCCESS;
dirp->id = zend_list_insert(dirp,le_dirp);
- DIR(default_dir) = dirp->id;
+ php_set_default_dir(dirp->id DIRLS_CC);
if (createobject) {
object_init_ex(return_value, dir_class_entry_ptr);