summaryrefslogtreecommitdiff
path: root/main/streams/plain_wrapper.c
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2007-10-31 13:22:45 +0000
committerJani Taskinen <jani@php.net>2007-10-31 13:22:45 +0000
commitf552f9161877e50ced7349a6b4ed2d8caf5b0cef (patch)
tree496017d8b8e07d73e2d38b418210fe6f6c61f951 /main/streams/plain_wrapper.c
parent548c25ef1c4befddb59382a118c12a84aa8faabe (diff)
downloadphp-git-f552f9161877e50ced7349a6b4ed2d8caf5b0cef.tar.gz
MFH: - Fixed bug #43137 (rmdir() and rename() do not clear statcache)
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r--main/streams/plain_wrapper.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 74c1841950..438ba3aabd 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -24,6 +24,7 @@
#include "php_open_temporary_file.h"
#include "ext/standard/file.h"
#include "ext/standard/flock_compat.h"
+#include "ext/standard/php_filestat.h"
#include <stddef.h>
#include <fcntl.h>
#if HAVE_SYS_WAIT_H
@@ -1032,12 +1033,10 @@ static int php_plain_files_unlink(php_stream_wrapper *wrapper, char *url, int op
}
return 0;
}
+
/* Clear stat cache */
- ZVAL_STRINGL(&funcname, "clearstatcache", sizeof("clearstatcache")-1, 0);
- call_user_function_ex(CG(function_table), NULL, &funcname, &retval, 0, NULL, 0, NULL TSRMLS_CC);
- if (retval) {
- zval_ptr_dtor(&retval);
- }
+ php_clear_stat_cache(TSRMLS_C);
+
return 1;
}
@@ -1107,6 +1106,9 @@ static int php_plain_files_rename(php_stream_wrapper *wrapper, char *url_from, c
return 0;
}
+ /* Clear stat cache */
+ php_clear_stat_cache(TSRMLS_C);
+
return 1;
}
@@ -1151,7 +1153,7 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, char *dir, int mod
}
else {
/* find a top level directory we need to create */
- while ( (p = strrchr(buf + offset, DEFAULT_SLASH)) || ( offset !=1 && (p = strrchr(buf, DEFAULT_SLASH))) ) {
+ while ( (p = strrchr(buf + offset, DEFAULT_SLASH)) || (offset != 1 && (p = strrchr(buf, DEFAULT_SLASH))) ) {
int n = 0;
*p = '\0';
@@ -1218,6 +1220,9 @@ static int php_plain_files_rmdir(php_stream_wrapper *wrapper, char *url, int opt
return 0;
}
+ /* Clear stat cache */
+ php_clear_stat_cache(TSRMLS_C);
+
return 1;
}
@@ -1412,9 +1417,6 @@ stream_skip:
}
/* }}} */
-
-
-
/*
* Local variables:
* tab-width: 4