Re: [PEPr] Comment on File Formats::File_Karma
| From: | Philippe Jausions | Date: | Tue, 23 Aug 2005 13:20:26 +0000 |
| Subject: | Re: [PEPr] Comment on File Formats::File_Karma | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-39503@lists.php.net to get a copy of this message | ||
Joe Stump wrote:
Joe Stump (http://pear.php.net/user/jstump) has commented on the proposal for File Formats::File_Karma. Comment: 1.) I can't use any name with _CVS_ in it due to the PEAR CS and the fact that you can't create or check in directories named "CVS" into a CVS repository. I'm open to suggestions, but for now I'm keeping it as File_Avail.Good point, I overlooked that. Maybe File_CVSAvail? Unless you want to take 5 minutes typing File_ConcurrentVersionsSystem_Avail ;-)
2.) I switched from tmpnam() to tmpfile()mmm. Won't you have problem copying the file over then?
3.) flock()? You mean lock the tmp file or the actual avail file? Locking the actual avail file seems dangerous to me as the CVS server would need to read that.The flock() is only to lock the file so not 2 PHP processes manipulate (i.e. write to) it at the same time. I don't think it would have any impact on the CVS server (according the doc on PHP.net...) However, flock() not being perfect (i.e. multithreaded environment), add a warning in the doc to inform the users of the possible conflicts arising from 2 processes modiying the file at the same time.
4.) Done 5.) Removed gratuitous @author tags 6.) Done, despite me hating $line{0} ... I think it's less readable, though it is faster. I digress. 7.) Fixed comma spacing throughout 8.) Maybe I'm totally missing what you're saying about checking is_resource(). I actually check twice (in open() and read()).I meant check that both file pointers are resources. What happens when someone just does write() without open() & read() first. According to your code, I think it would simply write an empty file.
9.) I did this in a few places. If you notice any I missed I'll go back and fix them. I'll be releasing 0.0.2 soon and updating the package URL. Proposal information: http://pear.php.net/pepr/pepr-proposal-show.php?id=279