[pmwiki-users] Re: Questions on release 2.0.0 (PageStore class)

Karl Loncarek dh2mll at web.de
Sat Sep 3 16:37:53 CDT 2005

"Patrick R. Michaud" <pmichaud at pobox.com> wrote in 
news:20050902205818.GD28385 at host.pmichaud.com:

> On Fri, Sep 02, 2005 at 04:29:57PM -0400, Radu wrote:
>> When calculating risk, it has to be compounded by the amount of loss 
>> possible in the worst case scenario. I lost several documentation 
>> hours that way. So I suggest that if you decide to comment that line 
>> out in the core, you at least make it a configuration option for us 
>> people on fickle servers.
> We have to be careful here -- it's not immediately clear what 
> such a configuration option would look like.
> Put another way, what percentage of the uncompressed file size 
> would be considered sufficient to assume that the entire file was
> successfully written?
> Just to provide some statistics, I did a test compression on the
> wiki.d/ files on pmwiki.org, and many of the files had 90-95%
> compression results.  So, the resulting line in the gzpagestore
> would have to look something like
>       $s = $s && (filesize("$pagefile,new") > $sz * 0.05);
> which says that as long as the size of the saved (compressed) file 
> is at least 5% of the uncompressed total, then it's considered
> good.  That doesn't seem like a test with much accuracy (false
> negatives), since it's also very possible that the file didn't 
> compress well and truncated to a size larger than 5% of the original.
> And any pages that managed to compress better than 95% would always
> be treated as "not saved".
> So it seems to me that in order for gzpagestore to provide this 
> level of reliability, it would have to re-read and uncompress the file
> that was just written to check its contents and length.  That sort
> of check could probably be provided by default, or as an option.

That sound reasonable to me, but how to do this? I would integrate this, 
but I'm no expert in PHP and especially in OOP.

Can I call the read function from within the write function?
How would this have to look like?

> Pm
>> At 02:01 PM 9/2/2005, Patrick R. Michaud wrote:
>> >Of course, this filesize check won't really work for gzipped files,
>> >since they typically compress to far less than 95% of the original
>> >size.  So, commenting it out is probably the right approach.  
>> >it also means that anyone who ends up on a system that doesn't
>> >correctly report disk write errors will be at a small risk of losing
>> >pages.
>> Cheers,
>> Radu
>> (www.monicsoft.net) 

Karl (aka Klonk)

More information about the pmwiki-users mailing list