[PEPr] Comment on File Formats::File_CSV_Get
| From: | Till Klampaeckel | Date: | Sat, 15 Nov 2008 12:55:49 +0000 |
| Subject: | [PEPr] Comment on File Formats::File_CSV_Get | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-51090@lists.php.net to get a copy of this message | ||
Till Klampaeckel (http://pear.php.net/user/till) has commented on the proposal for File
Formats::File_CSV_Get.
Comment:
Very sweet idea, this package is like a dream come true. :-)
I checked out your code and looked at it very briefly, ran tests - great
documentation, great examples.
There are small things I'd like you to change, for example, using
protected instead of private so people can extend/overload your class and
still access the properties and methods. Or making the code more robust by
checking that $res is not "false" in File_CSV_Get::_parse(), etc..
If you keep as-is, think about file_exists() vs. is_readable(). I *think*
on some systems there can be a difference, which can lead to a nasty error.
;-)
I'd also like to be able to "open" a URL which outputs CSV-data, and then
I wouldn't force the filename/URL to end in ".csv". In general, some
operating systems tend to omitt file extensions anyway, so in that case I'd
assume the file/URL contains CSV-data and make File_CSV_Get::_validate()
more robust and handle an error.
If you really want to stick to ".csv", I'd at least replace the check with
"substr($file, -4)".
Aside from those the package.xml, tests and maybe the structure in your
SVN needs some minor fixes, I can help you if you want. Those are just
minors though. ;-)
All in all, great idea and really well done!
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=577
--
Sent by PEPr, the automatic proposal system at http://pear.php.net