From: Marcus Boerger Date: Tue, 16 Jan 2007 22:10:25 +0000 (+0000) Subject: - Add php_u_stat() X-Git-Tag: RELEASE_1_0_0RC1~248 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=207dd9cefdb5a607b3331c64fed68570fed964de;p=php - Add php_u_stat() --- diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 9e5a710412..412e1f122f 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -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) diff --git a/ext/standard/php_filestat.h b/ext/standard/php_filestat.h index b0aae0a76c..1062fc7460 100644 --- a/ext/standard/php_filestat.h +++ b/ext/standard/php_filestat.h @@ -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