JibberBook XML Update
November 6th, 2007 in scripts | 3 Comments
I recently discovered a bug that occurred when simultaneous reading from and writing to the XML file was attempted that sometimes resulted in the deletion of all of the comments. Pretty serious I’d say, which is why I’ve been working hard to patch it. You can download the Comments class directly and place it in the ‘inc’ directory, or you can find it in the main package.
I used PHP’s flock(), or file locking, method to fix the problem. It’s a few milliseconds slower, but it’s worth not losing all your comments! If you don’t plan on extending the Comments class at all, it can be optimized to read quicker by saving the results in the constructor function.
As this has nothing to do with JibberBook’s core, its version number will remain at 2.0.

Hi, I'm Chris, a passionate freelance web developer. My languages of choice are PHP and JavaScript, and that's what you'll mostly find in my blog. You'll also find updates about 