Re: cvs: php4 /ext/standard basic_functions.c file.c file.h
| From: | Sterling Hughes | Date: | Mon, 08 Oct 2001 03:07:09 +0000 |
| Subject: | Re: cvs: php4 /ext/standard basic_functions.c file.c file.h | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-7715@lists.php.net to get a copy of this message | ||
On Sun, 7 Oct 2001, Derick Rethans wrote:
> derick Sun Oct 7 14:34:45 2001 EDT
>
> Modified files:
> /php4/ext/standard basic_functions.c file.c file.h
> Log:
> @- Added mmapfile(), read a file into a variabele with mmap (Ilia A, Derick)
> - Added mmapfile(), read a file into a variabele with mmap (Patch by:
> Ilia A. <ilia@prohost.org>)
>
I don't think this function belongs in the PHP core -- at least not
with its current name and semantics, because:
1) While it is a good idea to have a function that reads a file into
a variable (string), the implementation specific details should be
hidden. mmapfile() just isn't intuitive. Furthermore this function
should be able to fallback on open() and friends if mmap() isn't
supported (hint: stdio is a bad idea).
2) It should be extended to support URL's as well, something akin to
file('lalal'), except returning a string instead of an array.
3) Its not mmap(), well, yeah, underneath the hood it might be, but
this function has about 1/10 the usefulness of mmap(), if you want
to add a mmap() call to php (which might not be bad), I suggest it
be fully implemented, and split into a seperate extension.
So I'm against this patch (ie, +1 for revert), however, I would like
to see similair functionality added to php.
-Sterling