[PEPr] Comment on File Formats::File_Karma
| From: | Philippe Jausions | Date: | Mon, 22 Aug 2005 20:57:12 +0000 |
| Subject: | [PEPr] Comment on File Formats::File_Karma | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-39500@lists.php.net to get a copy of this message | ||
Philippe Jausions (http://pear.php.net/user/jausions) has commented on the proposal for File
Formats::File_Karma.
Comment:
Quick review:
- File_CVS_Karma or File_CVS_Avail is probably more suitable given that
File_Karma is really vague.
- You can't rely on /tmp to be the temp directory. There's probably a
PEAR package somewhere that deals with that. I don't remember right now.
- Whatever happened to flock() ?
- fopen() in binary mode ("b") is safer, although it *should* all be
ascii.
- I believe one @author tag for the package should be enough ;-)
- eregi('^#', $line) should simply be $line{0} == '#' and
eregi_replace('^#', '', $line) a substr($line, 1)
- Some PEAR CS problem with spaces after commas in function calls
- Before writing content (and overwriting the original file) make sure
the file was properly read first (i.e. is_resource()).
- For code clarity, you may want to do "if (!is_resource($fp)) {return
PEAR::raiseError(...)} ...do code..." instead of "if (is_resource($fd))
{...do code...} return PEAR::raiseError()"
I'll try to have a more detailed look at the code later on...
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=279
--
Sent by PEPr, the automatic proposal system at http://pear.php.net