]> granicus.if.org Git - php/commitdiff
- Add php_u_stat()
authorMarcus Boerger <helly@php.net>
Tue, 16 Jan 2007 22:10:25 +0000 (22:10 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 16 Jan 2007 22:10:25 +0000 (22:10 +0000)
ext/standard/filestat.c
ext/standard/php_filestat.h

index 9e5a7104124b58e7f108c94e5028fc4bb99aa9c8..412e1f122fcad1bd4d038327b6e6d8fdc897ace8 100644 (file)
@@ -752,6 +752,22 @@ PHP_FUNCTION(clearstatcache)
 #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)
index b0aae0a76c84ee06d1524769fdae024628b64f96..1062fc746066c0acf6613761e58554fdf0317375 100644 (file)
@@ -88,6 +88,7 @@ typedef int php_stat_len;
 #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_PERMS    0