[PHP-CVS] cvs: php-src /ext/standard filestat.c php_filestat.h /ext/standard/tests/file 005_basic.phpt 005_error.phpt bug43137.phpt /main/streams plain_wrapper.c

2007-10-31 Thread Jani Taskinen
janiWed Oct 31 13:22:18 2007 UTC

  Added files: 
/php-src/ext/standard/tests/filebug43137.phpt 

  Modified files:  
/php-src/ext/standard   filestat.c php_filestat.h 
/php-src/ext/standard/tests/file005_basic.phpt 005_error.phpt 
/php-src/main/streams   plain_wrapper.c 
  Log:
  - Fixed bug #43137 (rmdir() and rename() do not clear statcache)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filestat.c?r1=1.164r2=1.165diff_format=u
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.164 
php-src/ext/standard/filestat.c:1.165
--- php-src/ext/standard/filestat.c:1.164   Fri Sep 21 14:05:01 2007
+++ php-src/ext/standard/filestat.c Wed Oct 31 13:22:18 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: filestat.c,v 1.164 2007/09/21 14:05:01 tony2001 Exp $ */
+/* $Id: filestat.c,v 1.165 2007/10/31 13:22:18 jani Exp $ */
 
 #include php.h
 #include fopen_wrappers.h
@@ -751,14 +751,10 @@
 /* }}} */
 #endif
 
-/* {{{ proto void clearstatcache(void) U
-   Clear file stat cache */
-PHP_FUNCTION(clearstatcache)
+/* {{{ php_clear_stat_cache()
+*/
+PHPAPI void php_clear_stat_cache(TSRMLS_D)
 {
-   if (ZEND_NUM_ARGS()) {
-   WRONG_PARAM_COUNT;
-   }
-
if (BG(CurrentStatFile)) {
efree(BG(CurrentStatFile));
BG(CurrentStatFile) = NULL;
@@ -771,6 +767,17 @@
 }
 /* }}} */
 
+/* {{{ proto void clearstatcache(void)
+   Clear file stat cache */
+PHP_FUNCTION(clearstatcache)
+{
+   if (ZEND_NUM_ARGS()) {
+   WRONG_PARAM_COUNT;
+   }
+   php_clear_stat_cache(TSRMLS_C);
+}
+/* }}} */
+
 #define IS_LINK_OPERATION(__t) ((__t) == FS_TYPE || (__t) == FS_IS_LINK || 
(__t) == FS_LSTAT)
 #define IS_EXISTS_CHECK(__t) ((__t) == FS_EXISTS  || (__t) == FS_IS_W || (__t) 
== FS_IS_R || (__t) == FS_IS_X || (__t) == FS_IS_FILE || (__t) == FS_IS_DIR || 
(__t) == FS_IS_LINK)
 #define IS_ABLE_CHECK(__t) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == 
FS_IS_X)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_filestat.h?r1=1.31r2=1.32diff_format=u
Index: php-src/ext/standard/php_filestat.h
diff -u php-src/ext/standard/php_filestat.h:1.31 
php-src/ext/standard/php_filestat.h:1.32
--- php-src/ext/standard/php_filestat.h:1.31Sun Oct  7 05:15:06 2007
+++ php-src/ext/standard/php_filestat.h Wed Oct 31 13:22:18 2007
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_filestat.h,v 1.31 2007/10/07 05:15:06 davidw Exp $ */
+/* $Id: php_filestat.h,v 1.32 2007/10/31 13:22:18 jani Exp $ */
 
 #ifndef PHP_FILESTAT_H
 #define PHP_FILESTAT_H
@@ -87,6 +87,7 @@
 typedef int php_stat_len;
 #endif
 
+PHPAPI void php_clear_stat_cache(TSRMLS_D);
 PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int 
type, zval *return_value TSRMLS_DC);
 PHPAPI void php_u_stat(zend_uchar filename_type, const zstr filename, 
php_stat_len filename_length, int type, php_stream_context *context, zval 
*return_value TSRMLS_DC);
 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/005_basic.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/file/005_basic.phpt
diff -u php-src/ext/standard/tests/file/005_basic.phpt:1.2 
php-src/ext/standard/tests/file/005_basic.phpt:1.3
--- php-src/ext/standard/tests/file/005_basic.phpt:1.2  Mon Jun 11 16:40:27 2007
+++ php-src/ext/standard/tests/file/005_basic.phpt  Wed Oct 31 13:22:18 2007
@@ -1,5 +1,5 @@
 --TEST--
-Test fileatime(), filemtime(), filectime()  touch() functions: basic 
functionality
+Test fileatime(), filemtime(), filectime()  touch() functions : basic 
functionality
 --FILE--
 ?php
 /* 
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/005_error.phpt?r1=1.2r2=1.3diff_format=u
Index: php-src/ext/standard/tests/file/005_error.phpt
diff -u php-src/ext/standard/tests/file/005_error.phpt:1.2 
php-src/ext/standard/tests/file/005_error.phpt:1.3
--- php-src/ext/standard/tests/file/005_error.phpt:1.2  Mon Jun 11 16:40:27 2007
+++ php-src/ext/standard/tests/file/005_error.phpt  Wed Oct 31 13:22:18 2007
@@ -1,5 +1,5 @@
 --TEST--
-Test fileatime(), filemtime(), filectime()  touch() functions: error 
conditions 
+Test fileatime(), filemtime(), filectime()  touch() functions : error 
conditions 
 --FILE--
 ?php
 /*
http://cvs.php.net/viewvc.cgi/php-src/main/streams/plain_wrapper.c?r1=1.90r2=1.91diff_format=u
Index: php-src/main/streams/plain_wrapper.c
diff -u php-src/main/streams/plain_wrapper.c:1.90 
php-src/main/streams/plain_wrapper.c:1.91
--- php-src/main/streams/plain_wrapper.c:1.90   Wed Jul 25 16:34:27 2007
+++ php-src/main/streams/plain_wrapper.cWed Oct 31 13:22:18 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: plain_wrapper.c,v 1.90 2007/07/25 16:34:27 dmitry Exp $ */

[PHP-CVS] cvs: php-src /ext/standard filestat.c php_filestat.h

2007-01-16 Thread Marcus Boerger
helly   Tue Jan 16 22:10:25 2007 UTC

  Modified files:  
/php-src/ext/standard   filestat.c php_filestat.h 
  Log:
  - Add php_u_stat()
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filestat.c?r1=1.155r2=1.156diff_format=u
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.155 
php-src/ext/standard/filestat.c:1.156
--- php-src/ext/standard/filestat.c:1.155   Thu Jan 11 01:52:24 2007
+++ php-src/ext/standard/filestat.c Tue Jan 16 22:10:25 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: filestat.c,v 1.155 2007/01/11 01:52:24 pollita Exp $ */
+/* $Id: filestat.c,v 1.156 2007/01/16 22:10:25 helly Exp $ */
 
 #include php.h
 #include fopen_wrappers.h
@@ -752,6 +752,22 @@
 #define IS_ABLE_CHECK(__t) ((__t) == FS_IS_R || (__t) == FS_IS_W || (__t) == 
FS_IS_X)
 #define IS_ACCESS_CHECK(__t) (IS_ABLE_CHECK(type) || (__t) == FS_EXISTS)
 
+PHPAPI void php_u_stat(zend_uchar filename_type, const zstr filename, 
php_stat_len filename_length, int type, php_stream_context *context, zval 
*return_value TSRMLS_DC) /* {{{ */
+{
+   char *fn;
+
+   if (filename_type == IS_STRING) {
+   php_stat(filename.s, filename_length, type, return_value 
TSRMLS_CC);
+   } else {
+   if (FAILURE == php_stream_path_encode(NULL, fn, 
filename_length, filename.u, filename_length, REPORT_ERRORS, context)) {
+   RETURN_FALSE;
+   }
+   php_stat(filename.s, filename_length, type, return_value 
TSRMLS_CC);
+   efree(fn);
+   }
+}
+/* }}} */
+
 /* {{{ php_stat
  */
 PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int 
type, zval *return_value TSRMLS_DC)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_filestat.h?r1=1.29r2=1.30diff_format=u
Index: php-src/ext/standard/php_filestat.h
diff -u php-src/ext/standard/php_filestat.h:1.29 
php-src/ext/standard/php_filestat.h:1.30
--- php-src/ext/standard/php_filestat.h:1.29Mon Jan  1 09:29:32 2007
+++ php-src/ext/standard/php_filestat.h Tue Jan 16 22:10:25 2007
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_filestat.h,v 1.29 2007/01/01 09:29:32 sebastian Exp $ */
+/* $Id: php_filestat.h,v 1.30 2007/01/16 22:10:25 helly Exp $ */
 
 #ifndef PHP_FILESTAT_H
 #define PHP_FILESTAT_H
@@ -88,6 +88,7 @@
 #endif
 
 PHPAPI void php_stat(const char *filename, php_stat_len filename_length, int 
type, zval *return_value TSRMLS_DC);
+PHPAPI void php_u_stat(zend_uchar filename_type, const zstr filename, 
php_stat_len filename_length, int type, php_stream_context *context, zval 
*return_value TSRMLS_DC);
 
 /* Switches for various filestat functions: */
 #define FS_PERMS0

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] cvs: php-src /ext/standard filestat.c php_filestat.h

2003-11-07 Thread Sascha Schumann
On Fri, 7 Nov 2003, Derick Rethans wrote:

 On Fri, 7 Nov 2003, Marcus Boerger wrote:

  helly   Fri Nov  7 04:16:17 2003 EDT
 
Modified files:
  /php-src/ext/standard   filestat.c php_filestat.h
Log:
Make php_stat() available for extensions.

 This requires bumping up the API number

Binary compatibility did not change, no bumb.

- Sascha

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php