Re: php-src /ext/standard filestat.c php_filestat.h
| From: | Sara Golemon | Date: | Fri, 07 Nov 2003 16:41:25 +0000 |
| Subject: | Re: php-src /ext/standard filestat.c php_filestat.h | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-5318@lists.php.net to get a copy of this message | ||
If we're going to expose stat functionality to extensions (and I agree we
should), It needs to be part of the wrapper url_stat routing.
php_stream_url_stat_path() in main/streams/streams.c
Unfortunately we also need to get that layer of the streams API working
(which it isn't entirely yet)
Ultimately, php_stat() should call into php_stream_url_stat_path() as should
any extension which wishes to stat a file (local or remote).
-Sara
"Marcus Boerger" <helly@php.net> wrote in message
news:cvshelly1068196577@cvsserver...
> 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.
>
>
> Index: php-src/ext/standard/filestat.c
> diff -u php-src/ext/standard/filestat.c:1.126
php-src/ext/standard/filestat.c:1.127
> --- php-src/ext/standard/filestat.c:1.126 Mon Sep 1 21:22:02 2003
> +++ php-src/ext/standard/filestat.c Fri Nov 7 04:16:16 2003
> @@ -16,7 +16,7 @@
>
+----------------------------------------------------------------------+
> */
>
> -/* $Id: filestat.c,v 1.126 2003/09/02 01:22:02 sniper Exp $ */
> +/* $Id: filestat.c,v 1.127 2003/11/07 09:16:16 helly Exp $ */
>
> #include "php.h"
> #include "safe_mode.h"
> @@ -96,27 +96,6 @@
>
> #define S_IXROOT ( S_IXUSR | S_IXGRP | S_IXOTH )
>
> -/* Switches for various filestat functions: */
> -#define FS_PERMS 0
> -#define FS_INODE 1
> -#define FS_SIZE 2
> -#define FS_OWNER 3
> -#define FS_GROUP 4
> -#define FS_ATIME 5
> -#define FS_MTIME 6
> -#define FS_CTIME 7
> -#define FS_TYPE 8
> -#define FS_IS_W 9
> -#define FS_IS_R 10
> -#define FS_IS_X 11
> -#define FS_IS_FILE 12
> -#define FS_IS_DIR 13
> -#define FS_IS_LINK 14
> -#define FS_EXISTS 15
> -#define FS_LSTAT 16
> -#define FS_STAT 17
> -
> -
> PHP_RINIT_FUNCTION(filestat)
> {
> BG(CurrentStatFile)=NULL;
> @@ -555,7 +534,7 @@
>
> /* {{{ php_stat
> */
> -static void php_stat(const char *filename, php_stat_len filename_length,
int type, pval *return_value TSRMLS_DC)
> +PHPAPI void php_stat(const char *filename, php_stat_len filename_length,
int type, pval *return_value TSRMLS_DC)
> {
> zval *stat_dev, *stat_ino, *stat_mode, *stat_nlink, *stat_uid,
*stat_gid, *stat_rdev,
> *stat_size, *stat_atime, *stat_mtime, *stat_ctime, *stat_blksize,
*stat_blocks;
> Index: php-src/ext/standard/php_filestat.h
> diff -u php-src/ext/standard/php_filestat.h:1.20
php-src/ext/standard/php_filestat.h:1.21
> --- php-src/ext/standard/php_filestat.h:1.20 Tue Jun 10 16:03:38 2003
> +++ php-src/ext/standard/php_filestat.h Fri Nov 7 04:16:16 2003
> @@ -16,7 +16,7 @@
>
+----------------------------------------------------------------------+
> */
>
> -/* $Id: php_filestat.h,v 1.20 2003/06/10 20:03:38 imajes Exp $ */
> +/* $Id: php_filestat.h,v 1.21 2003/11/07 09:16:16 helly Exp $ */
>
> #ifndef PHP_FILESTAT_H
> #define PHP_FILESTAT_H
> @@ -74,5 +74,27 @@
> #define getgid() 1
> #define getuid() 1
> #endif
> +
> +PHPAPI void php_stat(const char *filename, php_stat_len filename_length,
int type, pval *return_value TSRMLS_DC);
> +
> +/* Switches for various filestat functions: */
> +#define FS_PERMS 0
> +#define FS_INODE 1
> +#define FS_SIZE 2
> +#define FS_OWNER 3
> +#define FS_GROUP 4
> +#define FS_ATIME 5
> +#define FS_MTIME 6
> +#define FS_CTIME 7
> +#define FS_TYPE 8
> +#define FS_IS_W 9
> +#define FS_IS_R 10
> +#define FS_IS_X 11
> +#define FS_IS_FILE 12
> +#define FS_IS_DIR 13
> +#define FS_IS_LINK 14
> +#define FS_EXISTS 15
> +#define FS_LSTAT 16
> +#define FS_STAT 17
>
> #endif /* PHP_FILESTAT_H */