ZF-1276: add ignore_user_abort to Zend_Cache_Backend_File


If the user disconnect during the write process the cache contains not clompleted data. This can shirk by set the ignore_user_abort to off and after writing to prior value again.


I suggest considering adding this as an option to Zend_Cache.

IMHO, this is useless.

With the default configuration, the hash key won't be ok so the cache will be dropped.

So it's not really a problem if the cache contains not completed data because it won't be used (readControl feature)

True, but in some situations, a failed cache write could be avoided using ingore_user_abort().

sure but is it enough to add a new option in Zend_Cache core ?

I prefer to keep the core away from "not really usefull" options because : - the code is cleaner - perfs are better

I don't have any strong feelings on this, and won't object if you close the issue, because developers could call ignore_user_abort() themselves. However, I doubt adding the following would affect perfs in any meaningful way for those not enabling the proposed option:

if ($this->_options['user_abort']) { $abort = ignore_user_abort(true); }
if ($this->_options['user_abort']) { ignore_user_abort($abort); }

On the other hand, if something slow and costly was calculated and written by Zend_Cache* corrupted because of a user abort not ignored, the perf cost could be large.

I don't know. I prefer to take some time to think about it.

Zend_Cache related issue, assigned to Fabien until he has thought about it ;-)

ok for 1.1.0

fixed in SVN