Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.3.0

Bug #19220 Empty cache files are not ignored
Submitted: 2012-01-13 09:20 UTC
From: brendansyra Assigned: avb
Status: Closed Package: HTML_Template_Sigma (version 1.2.0)
PHP Version: 5.3.8 OS: Debian GNU/Linux 6.0
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 15 - 6 = ?

 
 [2012-01-13 09:20 UTC] brendansyra (Brendan Smith)
Description: ------------ We have run into this problem several times, when for whatever reason the server has run out of space. HTML_Template_Sigma creates the cache file but is unable to write data to it. On first run, the template data is loaded fine as the cache file is only created (it is left with a file size of zero) and not used. Any subsequent time the script is run however, the cache file is read, which results in HTML_Template_Sigma throwing a "Cannot find block '__global__'" exception. HTML_Template_Sigma should ignore/remove the empty cache file instead of trying to read it.

Comments

 [2012-03-14 15:16 UTC] avb (Alexey Borzov)
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: avb
I think that rather than add a special case for cache loading, we need a more robust cache writing algorithm: 1) Cached template should be saved to a temporary file and then moved to a permanent filename; 2) An error should be raised if cache file cannot be saved or moved; Also probably: 1) Cache file should be touch()ed with mtime of original filename; 2) _isCached() should check mtimes for equality. Now if the template is replaced with an older version the cached file will not be regenerated, which is a minor WTF factor.
 [2014-01-08 03:09 UTC] avb (Alexey Borzov)
-Status: Analyzed +Status: Closed
Fixed in Git.