Re: cvs: php4 /ext/standard basic_functions.c config.m4 dir.c file.c file.h php_dir.h
| From: | Markus Fischer | Date: | Thu, 21 Mar 2002 21:24:41 +0000 |
| Subject: | Re: cvs: php4 /ext/standard basic_functions.c config.m4 dir.c file.c file.h php_dir.h | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-10555@lists.php.net to get a copy of this message | ||
On Thu, Mar 21, 2002 at 07:18:13PM -0000, Hartmut Holzgraefe wrote :
> hholzgra Thu Mar 21 14:18:13 2002 EDT
>
> Modified files:
> /php4/ext/standard basic_functions.c config.m4 dir.c file.c file.h
> php_dir.h
> Log:
> added fnmatch() and glob() functions
> could someone please check if i got the virtual dir stuff right?
>
>
> Index: php4/ext/standard/basic_functions.c
> diff -u php4/ext/standard/basic_functions.c:1.462 php4/ext/standard/basic_functions.c:1.463
> --- php4/ext/standard/basic_functions.c:1.462 Thu Mar 21 10:28:46 2002
> +++ php4/ext/standard/basic_functions.c Thu Mar 21 14:18:11 2002
> @@ -17,7 +17,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: basic_functions.c,v 1.462 2002/03/21 15:28:46 andrei Exp $ */
> +/* $Id: basic_functions.c,v 1.463 2002/03/21 19:18:11 hholzgra Exp $ */
>
> #include "php.h"
> #include "php_streams.h"
> @@ -640,6 +640,12 @@
> PHP_FALIAS(realpath, warn_not_available, NULL)
> #endif
>
> +#ifdef HAVE_FNMATCH
> + PHP_FE(fnmatch, NULL)
> +#else
> + PHP_FALIAS(fnmatch, warn_not_available, NULL)
> +#endif
> +
> /* functions from fsock.c */
> PHP_FE(fsockopen, third_and_fourth_args_force_ref)
> PHP_FE(pfsockopen, third_and_fourth_args_force_ref)
> @@ -673,7 +679,11 @@
> PHP_FE(rewinddir, NULL)
> PHP_STATIC_FE("readdir", php_if_readdir, NULL)
> PHP_FALIAS(dir, getdir, NULL)
> -
> +#ifdef HAVE_GLOB
> + PHP_FE(glob, NULL)
> +#else
> + PHP_FALIAS(glob, warn_not_available, NULL)
> +#endif
Using 'warn_not_available' is actually very bad.
How is one supposed to write portable code which can run
everyone? Using this dummy function makes it immune to detect
this with 'function_exists()' (within the gd extension we've
seen this can lead to great trouble).
- Markus
--
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc